Skip to main content
Every error response from the CA Colombia API returns a JSON body containing at least an error field with a human-readable message. Many errors also include a code field that identifies the specific failure condition, and validation errors add a details array with field-level information. You should always check both error and code when building error-handling logic in your application.

Error Response Shape

For validation failures, a details array is included alongside the error field:

HTTP Status Codes

The API uses standard HTTP status codes to communicate the outcome of every request. The table below describes what each code means in the context of CA Colombia.

Authentication Error Codes

When a 401 or 403 response is returned, the code field contains a machine-readable identifier. Use these codes to distinguish between different authentication failure states and respond accordingly in your application.
When INVALID_TOKEN is returned, the API automatically clears your session cookies. You will need to re-authenticate before making further requests.

Validation Errors

When you submit a request body that fails schema validation, the API returns a 400 response with "error": "Invalid form of body" and a details array. Each entry in the array corresponds to a specific field that failed validation. Example — creating a character with a missing field:
Each object in details contains:
  • path — an array of strings indicating which field or nested key failed. For top-level fields this is a single-element array, e.g. ["firstNames"].
  • message — a human-readable description of why the field failed validation.
Iterate over the details array to surface field-specific messages directly in your UI, rather than displaying the top-level error string alone.

Other Common Error Responses

500 responses may include a message field with additional context, but this is not guaranteed. Do not rely on its presence in production error-handling code.