Dashboard
DocsAPI ReferenceError Codes

Error Codes

All API endpoints return standard HTTP status codes. Here's a reference for the most common error responses.

Client Errors (4xx)

StatusErrorDescription
400Bad RequestThe request body is malformed or missing required fields. Check the request payload.
401UnauthorizedMissing or invalid authentication token. Ensure you're including a valid Bearer token.
403ForbiddenYou don't have permission to access this resource. Typically means you're trying to access another user's project.
404Not FoundThe requested resource doesn't exist. Verify the project/document/chat ID.
422Unprocessable EntityThe request body is valid JSON but contains invalid values (e.g., invalid enum value for rag_strategy).

Server Errors (5xx)

StatusErrorDescription
500Internal Server ErrorAn unexpected error occurred on the server. Contact support if this persists.
503Service UnavailableThe server is temporarily unavailable, typically during deployment or maintenance.

Error Response Format

All API errors return a JSON response with a detail field:

{
  "detail": "Project not found"
}

For validation errors (422), the response includes field-level information:

{
  "detail": [
    {
      "loc": ["body", "name"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Common Troubleshooting

ErrorSolution
401 on every requestYour JWT token may be expired. Refresh the token via Clerk.
404 for a projectVerify the project ID. It must belong to the authenticated user.
500 when sending a messageCheck if the project has any processed documents. The RAG agent needs indexed content.
422 on settings updateEnsure enum values match exactly: basic, hybrid, multi_query_vector, multi_query_hybrid.
Was this page helpful?