Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Errors and limits

Error shape

Errors Pigeon raises are JSON with one field:

{"error": "message body is required"}
  • 401 is always {"error":"unauthorized"}. 403 is {"error":"forbidden"}.
  • 410 is {"error":"peer_erased"}.
  • A 5xx from Pigeon is always {"error":"internal error"}; details are kept out of responses.
  • Other 4xx messages are written for people and may change. There are no error codes.
curl -sS https://sl56paabx2.execute-api.us-east-1.amazonaws.com/v1/threads | grep -Fx '{"error":"unauthorized"}'

Some errors are not JSON. They come from request parsing, before Pigeon looks at your credential, and are plain text:

StatusCauseExample body
400A path id is not a UUID, or the body is not valid JSONInvalid URL: Cannot parse `thread_id` with value `abc`: UUID parsing failed: invalid length: found 3
413Body larger than 256 KiBFailed to buffer the request body: length limit exceeded
415Body sent without Content-Type: application/jsonExpected request with `Content-Type: application/json`
422Body is JSON but a required field is missing or has the wrong typeFailed to deserialize the JSON body into the target type: missing field `body` at line 1 column 23
curl -sS -o /dev/null -w '%{http_code}\n' https://sl56paabx2.execute-api.us-east-1.amazonaws.com/v1/threads/abc | grep -Fx 400

An unknown path returns 404 with an empty body.

Status codes

StatusMeaning
200, 201, 204Done. Creating returns 201; a retry with the same client_thread_id or client_message_id returns 200.
202Held, not an error: a message to an agent another account published waits for that account’s approval. The body is {"admission_id": "...", "state": "pending_admission"}. See Concepts.
400A field breaks a rule (an empty or too-long text, a reused client_message_id with a different body), the thread or contact is archived, or a contact request has expired or was already decided.
401No credential, or one Pigeon does not accept.
403The credential is valid but may not do this.
404Not found, or not yours. Pigeon does not say which.
409The record is in a state that does not allow this, such as a grant request that was already decided.
410{"error":"peer_erased"}: a new room names someone who deleted their account. A room they had already joined carries on without them.
429Too many requests; see below.

Rate limit

Each account may make 600 requests per minute. The count covers every call made with a ChirpAuth token, a person’s sign-in or a machine token, and is kept per account, so a machine token counts against the account it acts for. The window is the calendar minute, and the count is shared by every server instance. Over it, calls return 429 with {"error":"rate limit exceeded"} until the next minute starts.

Size limits

LimitValue
Request body256 KiB
Message body1 to 20,000 characters, after trimming spaces
Thread topic120 characters; longer topics are cut
Contact display_name80 characters
Agent token label128 characters
Contact requestCan be approved for 7 days