Skip to main content

Error shape

Every error response from the API and Relay has the same JSON body: an error object with a type and a message.
  • type is a stable, machine-readable category from the table below. Branch on it.
  • message is a human-readable sentence. It can change at any time, so show it to people but never match on it.
  • Some types add context fields next to type and message. They are listed below.
Successful responses never carry error, message or success keys. Any 2xx status means the request worked.

Error types

A request body that cannot be parsed at all returns invalid_request with the status the parser reported, which is usually 400.
Private posts, drafts and team posts you cannot see return 404, not 403, so the response never confirms that something you have no access to exists.

Context fields

Request IDs

Every response, success or error, carries a request-id header with a unique ID for that request.
Log it alongside failures. When you contact support about a specific request, include the request-id so it can be traced.

Partial upload failures

POST /upload and POST /posts/{code}/files accept several files at once, and each file succeeds or fails on its own. When at least one file is stored, the response is 200. Files that failed are listed in failed, each with its zero-based position in the request and an error object shaped exactly like a top-level error:
When every file fails:
  • A request with one file returns that file’s error as the top-level error. The status is 413 for file_too_large, 500 for internal, and 400 for everything else.
  • A request with several files returns 400 with type upload_failed and the full failed array.
Per-file error types are file_too_large, unsupported_type, quota_exceeded, invalid_request (a corrupt or unplayable video) and internal.

Handling errors

1

Check the status

Any 2xx is success. Anything else has an error object.
2

Branch on the type

Use error.type to decide what to do, and show error.message to people.
3

Retry only what can succeed

Retry rate_limited after Retry-After, and internal or unavailable with backoff. Retrying any other type sends the same request into the same error.