API Error Codes & Troubleshooting Guide

Understand API error responses, debugging techniques, troubleshooting workflows, and implementation solutions.

Error Response Format

{
  "error": {
    "code": "AGENT_NOT_FOUND",
    "message": "Agent with ID 'abc-123' not found.",
    "status": 404,
    "correlation_id": "req-xyz-789"
  }
}

HTTP Status Codes

CodeMeaningWhen
200OKSuccessful request
201CreatedResource created successfully
400Bad RequestInvalid parameters or request body
401UnauthorizedMissing or invalid Bearer token
403ForbiddenInsufficient RBAC permissions
404Not FoundResource does not exist
409ConflictDuplicate resource or version conflict
422UnprocessableValidation error in request body
429Too Many RequestsRate limit exceeded
500Server ErrorInternal error — contact support

Common Error Codes

CodeDescription
AGENT_NOT_FOUNDThe specified agent ID does not exist
INVALID_CONFIGURATIONAgent configuration is missing required fields
CALL_IN_PROGRESSCannot modify agent while a call is active
PROVIDER_UNAVAILABLESTT/TTS/LLM provider returned an error
VERSION_CONFLICTOptimistic lock failure — refresh and retry
TOOL_EXECUTION_FAILEDMCP/API/Connector tool returned an error
RATE_LIMIT_EXCEEDEDToo many requests — see Retry-After header
TENANT_MISMATCHResource belongs to a different tenant