Developers

Errors

Every error has the same shape and a stable code.

Errors use HTTP status codes and always return the same body:

{
  "error": {
    "type": "invalid_request_error",
    "code": "validation_failed",
    "message": "The email field must be a valid email address.",
    "param": "email"
  }
}
  • type groups errors: authentication_error, permission_error, invalid_request_error, rate_limit_error or api_error.
  • code is stable and meant for your code. Branch on it, not on message.
  • message is for humans and may change.
  • param names the related parameter, when there is one.
  • Validation errors (422, code validation_failed) also include errors with every invalid field.

Common codes

StatusCodeMeaning
401invalid_tokenMissing, unknown, expired or revoked token, or the owner left the company
403insufficient_scopeThe token lacks the scope for this endpoint
403permission_deniedThe token's owner lacks the permission
403package_requiredThe company is not on the Automate package
403ip_not_allowedThe request came from an IP address outside the allowlist
404resource_missingThe object does not exist or is outside the token's reach
409request_in_progressA request with the same Idempotency-Key is still running
422validation_failedThe request is invalid; see param and errors
409duplicate_external_referenceA recipient with this external_reference already exists
422no_trees_availableNot enough unassigned trees to assign to a recipient or reserve for a gift code
422gift_code_claimedThe gift code was already claimed and cannot be revoked
422idempotency_key_reusedThe Idempotency-Key was used for a different request
429rate_limitedToo many requests; wait Retry-After seconds

On this page