Response Format and Errors
Last updated
The API uses a consistent envelope so clients can rely on data for success and errors for failure.
POST /graphql)Every response follows the GraphQL spec: { data?, errors? }.
data is present. The key matches the operation name (e.g. data.me, data.channel, data.createContent).
Use response.data for the result.
Example:
{
"data": {
"me": {
"id": "did:rad.live:user:...",
"username": "alice"
}
}
}errors is an array of objects: { message: string, path?: string[], extensions?: object }.
HTTP status may still be 200; always check response.errors when present.
Use response.errors for user-facing or logged error messages.
Example:
Partial data: GraphQL can return both data and errors when some fields resolve and others fail. Inspect both.
For non-GraphQL JSON endpoints (e.g. generate-api-key, youtube disconnect):
Body shape: { data: <payload> }. The payload is the response body.
Example (generate-api-key):
Example (disconnect):
Body shape: { "errors": [ { "message": string, "code"?: string } ] }.
HTTP status indicates the error type; the body provides a consistent shape for parsing.
Last updated
{
"errors": [
{
"message": "Authentication required.",
"path": ["me"]
}
]
}{
"data": {
"id": "did:rad.live:user:...",
"key": "..."
}
}{
"data": { "ok": true }
}
