Skip to content

Errors

Pixelfed uses standard HTTP status codes. Errors come back as JSON with an error string you can log or show, and validation failures add an errors object keyed by field.

Send Accept: application/json on every request. Without it, errors render as HTML pages, and a missing or expired token can redirect to the sign in page instead of returning 401.
StatusWhat happened
400 Bad requestThe request could not be used. Some lookups also return this for unknown accounts.
401 UnauthorizedThe token is missing, expired or revoked. Send the person through authorization again.
403 ForbiddenThe token lacks the scope for this endpoint, the account is not allowed to do this, or the feature is turned off on this server.
404 Not foundNo such record, or it is not visible to this account.
422 UnprocessableValidation failed. errors lists the fields to fix.
429 Too many requestsSlow down. Retry after the number of seconds in the Retry-After header.
5xx Server errorSomething broke on the server. The body says Server Error. Retry with backoff.

Some endpoints abort without a message, so error can be an empty string. Rely on the status code, not the text.

Response
{
  "error": "Unauthenticated."
}
Pixelfed is free and open source software. Edit this page Report a docs issue