Skip to main content
Every Roughy API endpoint reports failures with the same response shape, regardless of which endpoint failed or which HTTP status code is returned. Successful responses are the resource directly (no wrapper); error responses are always the envelope below.

Envelope

Error codes

Only the transient codes carry a Retry-After header: asset_processing (on POST /v1/cuts, while the asset is still being prepared) and upstream_unavailable. Back off for the header’s seconds and retry the same request. The list is closed — Roughy won’t introduce a new code without a backward-compatible documentation update. If you encounter a code not listed here, treat it as internal_error.

Correlating with logs

Every response (success or error) carries an X-Request-Id response header. Our server-side structured logs bind the same id to every line emitted while processing the request, so including the header value in a support ticket lets us trace the chain. The id is header-only — the error envelope body does not echo it. When opening a ticket, grab the X-Request-Id from the response (visible in your browser’s network panel or curl -v) and paste it alongside the JSON.

Example — validation_error with fields

Example — not_found

Note fields is absent — it’s only present for validation errors.

Success responses

For symmetry, the success side: status codes carry the meaning, the body is the resource directly. No wrapper. Listings carry pagination metadata — { items: [...], total, limit, offset }. That’s a pagination shape, not a generic envelope.