Skip to main content

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests.

HTTP Status Codes

CodeNameDescription
200OKRequest succeeded. Response body contains the requested data.
201CreatedResource created successfully. No response body.
204No ContentRequest succeeded. No response body (used for updates and deletes).
400Bad RequestInvalid request. Missing required fields, validation errors, or malformed input.
401UnauthorizedMissing or invalid authentication token.
403ForbiddenValid token, but insufficient permissions or node hierarchy violation.
404Not FoundThe requested resource does not exist or has been deleted.
409ConflictAction conflicts with the current state (e.g., duplicate approval, resource already exists).
413Payload Too LargeUploaded file exceeds the maximum allowed size (100 MB for documents).
500Internal Server ErrorAn unexpected error occurred on the server.

Error Response Format

Domain Errors

Most error responses return a JSON object with code, domain, and message fields:

{
"code": 30001,
"domain": 3,
"message": "account not found"
}
FieldTypeDescription
codeintegerApplication-specific error code
domainintegerError domain/category identifier
messagestringHuman-readable error description

Validation Errors

When request body validation fails (400), the response returns an array of validation error objects:

[
{
"field": "Name",
"message": "Validation failed on the 'required' tag"
},
{
"field": "Type",
"message": "Validation failed on the 'oneof' tag"
}
]
FieldTypeDescription
fieldstringThe field that failed validation
messagestringDescription of the validation failure

Authentication Errors

StatusScenario
401No Authorization header provided
401Token is expired
401Token signature is invalid
401API key is expired or inactive

Authorization Errors

StatusScenario
403API key's node cannot manage the target resource
403Insufficient role priority for the requested action
403Missing required permission (e.g., document:upload)

Best Practices

  1. Check the status code first -- different status codes require different handling strategies.
  2. Read the error message -- it provides specific details about what went wrong.
  3. Implement retry logic for 500 errors with exponential backoff.
  4. Do not retry 400, 401, 403, 404, or 409 errors -- these require changes to the request.
  5. Refresh tokens proactively before they expire to avoid 401 errors during operations.