Errors and limits
Error format, response codes and API limits.
Error format
Every error has the same shape:
{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid input for this action.",
"issues": ["name: Required"]
}
}
code is stable, so branch on it in your code. message is for people and may change. issues comes only with invalid input.
Response codes
| HTTP | code | Meaning |
|---|---|---|
| 400 | INVALID_INPUT | The input doesn't match the action's schema, see issues |
| 400 | INVALID_JSON | The body isn't a JSON object |
| 400 | IDEMPOTENCY_KEY_INVALID | idempotencyKey isn't 1 to 255 characters long |
| 400 | an app code | The action couldn't be done, e.g. API_KEY_LIMIT_REACHED |
| 401 | UNAUTHORIZED | The key is missing, invalid, revoked or expired |
| 403 | INSUFFICIENT_SCOPE | A read key tried to write |
| 403 | FORBIDDEN or an app code | Your role in the app doesn't allow this action |
| 404 | UNKNOWN_ACTION | The action doesn't exist or isn't available through the API |
| 404 | e.g. INVOICE_NOT_FOUND | The record doesn't exist or you can't access it |
| 409 | e.g. TAG_NAME_EXISTS | The record already exists or changed in the meantime |
| 409 | IDEMPOTENCY_KEY_REUSED | The same idempotencyKey was used with a different input |
| 409 | IDEMPOTENCY_KEY_PENDING | The first request with this idempotencyKey hasn't finished |
| 429 | RATE_LIMITED | Too many requests, see the Retry-After header |
| 500 | INTERNAL_SERVER_ERROR | Something went wrong on our side |
Limits
- 300 requests a minute per key. Above that you get
429with aRetry-Afterheader in seconds. - One action may run for up to 60 seconds.
- Uploads: up to 20 files at once, each up to 20 MB.
Retrying
Retry only 429, 5xx and timeouts, waiting longer each time. Retrying a 4xx doesn't help. Send actions that create or send something with an idempotencyKey and reuse the key when you retry: Moniary runs them once (see Actions). Without a key, a repeated request runs again. If IDEMPOTENCY_KEY_PENDING lasts more than a minute, the first request failed unexpectedly: check with a read action whether it went through before sending it with a new key.