Errors & pagination
Errors & pagination
This page covers shared error, pagination, response-header, and idempotency conventions. Endpoint-specific responses remain authoritative in the API reference.
Errors
Rightbrain uses several error forms:
- Domain errors use
detail.reason,detail.message, and sometimes an error-specific details field. - Request validation usually returns a
detailarray. Items can use eithermsgormessage. - Some routes return a string
detail. - Authentication failures use a top-level
errorobject. - Gmail integration preconditions use
detail.code. - MCP OAuth startup failures can be returned through redirect query parameters.
The Error reference documents these forms, common reason codes, run failures, and recovery guidance.
Status codes
Pagination
Most list endpoints return a paginated envelope: a pagination object plus a results array.
Page with two query parameters:
Pass the previous response’s pagination.next_cursor to fetch the next page. Omit it for the first page.
The maximum number of items per page.
Stop when has_next is false (next_cursor will be null).
Endpoints that return plain arrays
Some endpoints return a bare JSON array with no pagination envelope:
GET .../modelGET .../input_processorGET .../task_forwarder_typeGET .../guardrailGET .../api_keyGET .../task/{id}/share- Skill source lists
- Skill revision lists
- Trigger-level event lists
Response headers
Task runs return two headers you can use for correlation and debugging:
x-task-run-id— the ID of the run just executed.x-task-revision-id— the revision that served it.
Idempotency
Public webhook triggers accept an idempotency key so a retried delivery is not processed twice. Use it when the caller might resend the same event. See Triggers & runs for configuring public webhook invocation.