Code | Meaning | Description |
---|---|---|
200 | OK | Successful request (default response) |
201 | Created | Resource was successfully created |
400 | Bad Request | Request failed schema or logic validation |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Valid auth but insufficient permissions |
404 | Not Found | Resource not found (trace, plan, event) |
409 | Conflict | Resource already exists or cannot be merged |
422 | Unprocessable Entity | Failed Pydantic model validation |
429 | Too Many Requests | Exceeded rate limits |
500 | Internal Server Error | Unhandled backend error or crash |
HTTPException
to raise structured errors with code and message pairs. Pydantic model validation automatically returns 422
errors on bad inputs.
Custom exceptions include:
TraceConflictException
– raised on conflicting trace uid
or edit attemptsPlanError
– raised when agent plans fail structural checks or exceed constraintsUnauthorizedAgentAccess
– used when an agent is not permitted to access a user traceField | Description |
---|---|
error | Brief label describing the error |
status | HTTP status code |
detail | Expanded explanation, with field or context references |
trace_id | Request-level identifier for tracing/debugging |
hint | (Optional) Fix suggestions or reference documentation |
logging
module and Uvicorn’s structured output for diagnostics.
trace_id
header or field (if an error occurs)TRACE
, INFO
, WARNING
, ERROR
curl -v
or Postman to inspect headers and bodyContent-Type: application/json
in all POST requestsscheduled_for
or malformed tempo_token
can cause 422 errorsError Code | Pattern | Resolution |
---|---|---|
422 | Pydantic validation fail | Check required fields and types |
409 | Duplicate uid or plan | Use PATCH or regenerate trace ID |
403 | Agent not authorized | Check agent scope or user ID binding |
404 | Trace or event not found | Verify task_id or trace_uid |
500 | Server error | Retry or contact support with trace_id |
/debug/trace-dump
trace_uid
, task_id
, or linked_event_uid
DEBUG=true
)100 requests / minute / user
429 Too Many Requests
Retry-After: 30
(seconds)