BunnyDoc
APIE-Signing API

Errors

Every error the E-Signing API can return, with a stable machine-readable code you can branch on.

Every error response has the same shape. Read error.code — it's a stable, machine-readable value. The message is for humans and may change at any time, so never branch on the message text.

Error shape
{
  "error": {
    "code": "unknown_signer_role",
    "message": "One or more recipient roles do not match this template.",
    "details": { }
  }
}

details is optional and, when present, carries structured context about the error.

Error codes

HTTPerror.codeMeaning
401missing_api_keyNo X-API-Key header on the token request.
401invalid_api_keyThe key is unknown, revoked, expired, or not a live-mode key.
401missing_tokenNo Authorization: Bearer token was sent.
401invalid_tokenThe token is malformed or expired. Request a new one.
401key_revokedThe key behind this token was revoked or rotated — its tokens no longer work.
403insufficient_scopeThe key doesn't carry the scope this endpoint requires.
403forbiddenThe key's owner lacks the underlying permission, or API access isn't in your plan.
403signing_links_disabledThe envelope doesn't share signing links with the sender.
402quota_exceededNo remaining API signature requests (on send).
403quota_exceededA resource limit was reached (for example, the contact limit).
404template_not_foundNo template with that id exists in your company.
404envelope_not_foundNo envelope with that id exists in your company.
404webhook_not_foundNo webhook subscription with that id exists in your company.
422unknown_signer_roleA recipient role doesn't match the template, or a locked role was supplied.
422sender_not_foundsender_email isn't an active user with an eSignature seat in your company.
422validation_failedThe request body is malformed or missing a required field.
429rate_limitedToo many requests — back off and retry.
5xxsend_failedThe envelope was created but couldn't be sent, so it was discarded. Nothing was delivered.
500internal_errorSomething went wrong on our side. Safe to retry.

Why some errors are deliberately vague

On the token endpoint, "no such key", "revoked", "expired", and "not live-mode" all return the same 401 body. Likewise, a template in another company and a template that doesn't exist both return 404 template_not_found. This is intentional — a more specific error would let someone probe which ids or keys exist.

Handling errors well

  • Branch on error.code, never on message.
  • Retry 5xx, 429, and network errors with backoff. Don't retry 4xx — the request reached us and was rejected; fix the request instead.
  • Refresh on 401 invalid_token by exchanging your key for a new token. If you get key_revoked, the key itself was revoked — mint a new one in Settings → API Keys.
  • Treat quota_exceeded as a plan signal, not a transient error — it clears when the period resets or your plan is upgraded.

On this page