Errors
When a request fails, the API answers with a problem document (RFC 9457) and Content-Type: application/problem+json.
The code member is the one to act on. The title and detail members are text for people: they follow the Accept-Language header (English, Japanese or Vietnamese), and Content-Language says which language was used.
The problem document
| Field | Description |
|---|---|
type | https://docs.docwize.com/api/errors/{code}, the page of the code on this site. |
title | The title of the code, in the response language. |
status | The HTTP status, the same as the response's. |
code | The problem code. The codes are listed below. |
detail | What went wrong in this request, in the response language. |
request_id | The ID of the request. Quote it when you report a problem. |
errors | Only on 422: one entry per invalid part of the request, with in (body, query, path or header), pointer, code and message. |
Some codes add members of their own, for example scope on insufficient_scope and base_url on wrong_region. Their pages say so.
Problem codes
| Code | Status | Title |
|---|---|---|
invalid_version | 400 | Invalid version |
malformed_json | 400 | Malformed JSON |
token_expired | 401 | Token expired |
unauthenticated | 401 | Unauthenticated |
forbidden | 403 | Forbidden |
insufficient_scope | 403 | Insufficient scope |
token_owner_inactive | 403 | Token owner inactive |
not_found | 404 | Not found |
method_not_allowed | 405 | Method not allowed |
not_acceptable | 406 | Not acceptable |
already_exists | 409 | Already exists |
conflict | 409 | Conflict |
idempotency_in_progress | 409 | Request in progress |
in_use | 409 | In use |
locked | 409 | Locked |
cursor_expired | 410 | Cursor expired |
task_expired | 410 | Task expired |
precondition_failed | 412 | Precondition failed |
payload_too_large | 413 | Payload too large |
response_too_large | 413 | Response too large |
unsupported_media_type | 415 | Unsupported media type |
wrong_region | 421 | Wrong region |
idempotency_key_reused | 422 | Idempotency key reused |
invalid_cursor | 422 | Invalid cursor |
unsupported_for_tenant | 422 | Unsupported for this company |
validation_failed | 422 | Validation failed |
rate_limited | 429 | Too many tool calls |
internal_error | 500 | Internal error |
not_attempted | 503 | Not attempted |
tenant_unavailable | 503 | Company database unavailable |
unavailable | 503 | Unavailable |
timeout | 504 | Timeout |
Field codes
The code of each errors entry is one of these. The message shown is the default message; a word in braces is filled in.
| Code | Default message |
|---|---|
duplicate | {field} is given more than once. |
invalid_character | {field} contains a NUL character. |
invalid_choice | {field} must be one of: {choices}. |
invalid_date | {field} must be a date (YYYY-MM-DD). |
invalid_decimal | {field} must be a decimal number{scale_hint}. |
invalid_format | {field} has the wrong format: {expected}. |
invalid_type | {field} must be {expected}. |
out_of_range | {field} is out of range. |
read_only | {field} is read-only and cannot be changed. |
reference_forbidden | {field}: you cannot use {id}; {reason} |
reference_not_found | {field}: {id} does not exist. |
reference_unverifiable | {field}: {id} cannot be checked because {reason}. |
required | {field} is required. |
unknown_field | {field} is not a known field. |
value_too_long | {field} is {actual_length} characters; the limit is {max_length}. |