How do pages, limits and errors work in the API?
Pages. Lists return 25 items at a time as data, newest first (folders and groups oldest first), with a next_cursor. Add ?limit= (1 to 100) for more at a time. For the next page, send ?cursor= with the next_cursor you were given; when it is null, you have them all.
Limits. Each key can make 120 requests a minute. Past that, Galley answers 429 with a Retry-After header: the seconds to wait.
Errors look like {"error": {"code": "invalid_request", "message": "…", "field": "email"}}. field is there when one part of the request is the problem, and the message is written so you can show it to a person.
| Code | Status | What it means |
|---|---|---|
unauthorized | 401 | The key is missing, wrong or revoked, or its maker is no longer an Owner. |
plan_required | 403 | The company isn't on Pro. |
not_found | 404 | There's no such investor, document, folder, group or address. |
invalid_request | 400 | Something in the request isn't right; field says what. |
conflict | 409 | It's already there, like inviting someone who already has an account. |
file_too_large | 413 | The file is over 50 MB (200 MB for a video). |
rate_limited | 429 | More than 120 requests in a minute. |
server_error | 500 | Something went wrong on our side. Try again. |