Skip to content
Documentation menu

Errors

Error format, codes to test, order of checks and retries.

Error format#

An error returns an HTTP status and a JSON body with message (readable text, translated according to the language of the token creator’s profile) and, most of the time, code (a stable identifier):

{
  "message": "Invalid, expired or revoked API token.",
  "code": "invalid_token"
}

Some errors have no code: a 403 caused by the role, a 404, an ordinary validation (422 with errors). In those cases, rely on the status.

Error codes#

StatusCodeWhen
401invalid_tokenToken missing, malformed, unknown, expired or revoked, or creator no longer in the workspace.
402plan_required, quota_reached, plan_restrictedThe plan does not include the API or the requested feature, a quota is reached, or the resource is read-only.
403insufficient_scopeMissing scope (the body gives required_scope).
403noneCreator’s role is insufficient (a viewer writing, for example).
403staff_disabledWebhook switched off by Hyllo staff.
404noneUnknown resource, or one from another workspace.
405noneDeleting a QR code or a link page: it does not exist in the API.
409idempotency_in_progressA request with the same Idempotency-Key is still running.
422none, with errorsValidation of the body or parameters.
422field_not_availableField that does not exist in the public API (folders).
422idempotency_key_mismatchIdempotency-Key reused with a different request.
422too_many_webhooks, webhook_url_not_publicWebhook: limit reached, or non-public address.
422logo_too_large, render_refused, export_not_availableQR code export that cannot be drawn.
429rate_limitedRate limit reached (Retry-After gives the wait), including a route’s own limit.
503renderer_unavailableQR code export: rendering engine unavailable, try again.

Order of checks#

Checks always apply in the same order; the first one that fails gives the response:

  1. 401: the token is valid.
  2. 402: the workspace’s plan includes the API.
  3. 403 insufficient_scope: the token carries the route’s scope.
  4. 404: the resource exists in the token’s workspace.
  5. 422: the body and parameters are valid.

Consequences: a token without the required scope gets 403, even on an identifier that does not exist (never 404); a resource’s existence is therefore only revealed to a token that has the scope. Validation comes last: fixing a 422 assumes everything else passes. A route’s own limits count after the 402 and the 403; the general budget per token and per workspace counts before, and every response, refusals included, carries X-RateLimit-*.

Validation errors#

A failed validation answers 422 with errors, a list of messages per field:

{
  "message": "The url field is required.",
  "errors": {
    "url": [
      "The url field is required."
    ]
  }
}

A field that does not exist in the public API (folders) answers 422 with code: field_not_available and one errors entry per refused field. An Idempotency-Key reused with a different request answers 422 idempotency_key_mismatch, with no errors.

Messages are translated: display them if needed, but do not parse them.

Retrying requests#

  • 429: wait Retry-After seconds, then replay. See Best practices.
  • 5xx and network errors: replay with a growing wait and a bounded number of attempts. For a creation, keep the same Idempotency-Key: see Idempotency.
  • 409 idempotency_in_progress: wait a moment, then replay.
  • Other 4xx: do not replay as is, the same request gives the same error. Fix the token, the scope, the plan or the body.

Read next