Skip to main content

Handle Errors

All DVS error responses share a common JSON envelope:

{
"error_code": "071-403-document-type-not-allowed",
"message": "Provider does not have access to the requested document_type/country/agreement combination",
"additional_information": {
"document_type": "OPME",
"country_code": "BR",
"agreement_code": "BRADESCO_xxx"
}
}

Error code format

071-<HTTP_STATUS>-<optional-suffix>

  • 071 is the DVS prefix.
  • <HTTP_STATUS> is the HTTP status code (e.g., 403, 422).
  • <optional-suffix> disambiguates multiple causes of the same status.

Common errors

Statuserror_codeCauseAction
401071-401Missing or invalid Bearer tokenRefresh token. Retry once.
403071-403Token valid but lacks required authorityCheck scope when requesting token.
403071-403-document-type-not-allowedProvider not authorized for that (doc_type, country, agreement)Use GET /v1/document-types to discover what's allowed. Contact OSIGU if you need more access.
403071-403-tenant-mismatchTrying to read another tenant's resourceDon't.
409071-409-idempotency-mismatchSame Idempotency-Key used with different bodyUse a fresh key.
413071-413-file-too-largeInline file exceeds 3MB (sync) / 6MB (async)Use S3 URL or external URL variant.
422071-422Body failed validationInspect additional_information. Fix and resubmit.
422071-422-agreement-requiredValidation request with multiple agreement optionsResubmit with explicit agreement_code.
422071-422-ssrf-blockedExternal URL points to a private IP / blocked hostUse a public HTTPS URL.
422071-422-unknown-document-typedocument_type not in catalogUse GET /v1/document-types to see valid slugs.
429071-429Daily quota exceededWait until midnight UTC. additional_information.retry_after_seconds gives the exact wait.
502071-502-classifier-upstreamClassification engine upstream failed after DVS retriesWait and resubmit with fresh Idempotency-Key.
502071-502-extraction-failedDocument Processor failed after retriesSame — wait and resubmit.
504071-504-sync-timeoutSync classification exceeded budgetResource still processing. Poll GET /classification-requests/{id} with the returned id.

Retry strategy

Don't retry 4xx (except 429)

4xx errors indicate a client problem. Retrying without changes will produce the same error. Fix the request first.

Retry 5xx with exponential backoff

Use 3 attempts: immediate, +30s, +120s. Use a fresh Idempotency-Key to be safe.

On 429, respect retry_after_seconds

The error includes additional_information.retry_after_seconds. Don't retry before that.

On 504, switch to polling

The resource is still being processed. Get the classification_request_id from the error body and poll GET /classification-requests/{id} every few seconds.

Network failures

If your request never reaches DVS (timeout, connection reset), DVS may or may not have processed it. Use Idempotency-Key on every request so that retries don't duplicate work.

See Idempotency for the full pattern.