sign.ytDocs

Core concepts

Errors

Every error response from the API has the same JSON shape. Branch on code, show message, and quote request_id when you contact support.

Error envelope#

{
  "code": "not_found",
  "message": "Document not found",
  "detail": "Document not found",
  "request_id": "9f2c1a7e4b0d3e11"
}
FieldDescription
codeStable, machine-readable snake_case string. Always present. Use it in your code.
messageHuman-readable explanation in English. Always present. Wording may change; do not parse it.
detailLegacy field kept for backward compatibility: always the same string as message, except for request validation errors (422 validation_error) it is the list of field errors.
request_idSame value as the X-Request-Id response header. Include it in support requests.
extraOptional object with error-specific data, for example quota numbers (current, limit), the missing plan feature, or retry_after.

Clients should branch on code, not on message. New codes may be added at any time, so always fall back to handling by HTTP status for codes you do not recognize.

Generic codes by status#

When no more specific code applies, code is derived from the HTTP status:

StatusCodeMeaning
400bad_requestMalformed request, for example a file that is not a PDF.
401unauthenticatedMissing, invalid, revoked or expired API key.
402payment_required, quota_exceededA plan feature or limit blocks the request. Specific codes such as feature_not_in_plan or documents_per_month are usual.
403forbidden, insufficient_scopeAuthenticated, but not allowed: wrong role, endpoint not available to API keys, or a missing scope.
404not_foundThe resource does not exist or belongs to another organization. Tenancy never leaks existence.
405method_not_allowedThe path exists but not with this method.
409conflictThe resource is in a state that does not allow this action, for example document_not_draft.
410goneThe resource existed but is no longer available.
413payload_too_largeRequest body over the limit (30 MB for most endpoints).
415unsupported_media_typeWrong content type for an upload.
422validation_errorThe body or parameters failed validation, or a business rule rejected them.
429rate_limitedToo many requests. Wait for Retry-After seconds.
500internal_errorUnexpected server error. Safe to retry idempotent requests.
502upstream_errorA dependency (email, SMS, registry lookup) failed.
503service_unavailableTemporarily unavailable. Retry with backoff.

See the error code reference for the specific codes you are most likely to meet.

Validation errors#

When the request does not match the schema, the status is 422, code is validation_error, and detail lists every problem with its location:

{
  "code": "validation_error",
  "message": "Request validation failed",
  "detail": [
    {"loc": ["body", "fields", 0, "position_x"], "msg": "Input should be less than or equal to 100", "type": "less_than_equal"}
  ],
  "request_id": "0b7e51f2c9a84d60"
}

Business-rule failures also use 422 but carry a specific code and a string detail, for example signer_missing_signature_field when sending a draft where a signer has no signature field.

Handling errors#

# -w prints the status; the body is the error envelope.
curl -sS -w '\n%{http_code}\n' "https://api.sign.yt/v1/documents/00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $SIGNYT_API_KEY"

What to retry#

  • Retry 429, 500, 502, 503 and network errors with exponential backoff and jitter. For POST requests send an Idempotency-Key so retries cannot create duplicates.
  • Do not retry other 4xx responses unchanged: fix the request, the state, or the plan first.
  • The SDKs retry GET, PUT and DELETE on 429/5xx/network errors (2 retries by default, honoring Retry-After) and never retry POST or PATCH automatically.