Errors and rate limits

The application/problem+json error envelope, the status codes and types the Amanucci API returns, and its rate-limit headers.

The error envelope

Every refusal is an RFC 9457 problem, with content type application/problem+json:

{
  "type": "period_not_locked",
  "title": "A filing is generated from a locked period only",
  "status": 409,
  "detail": "…",
  "instance": "/v1/entities/0192f0c4-.../filings"
}
MemberMeaning
typethe machine-readable code. Branch on this.
statusthe HTTP status, repeated
titlea human summary of the type, stable per type
detaila human summary of this occurrence (may be absent)
instancethe request path

title and detail are prose for people. Do not parse them. A few types add a member a client needs to act, such as findings on an e-invoice that fails validation, or instructions and windowSeconds on step-up-required.

Status codes

StatusWhenExample types
401no credential, or one that is no longer validunauthenticated
403authenticated but refused: role, grant, seat or step-upstep-up-required, grant-required, seat-required, authority-required, signing-reserved
404absent, or hidden from you (the two look the same)not-found, document_not_found
409a conflict: a stale version, or a transition not allowed nowperiod_not_locked, filing_exists
410something that existed and is closed for goodinvite_expired, invite_revoked
422the request did not satisfy the schema, or a domain rule refused itinvalid-input, batch_full
429too many requestsrate-limited
503temporarily unavailable; retry after Retry-Afterrate-limit-unavailable, about:blank

401 means only "your credential is dead". A permission problem is always a 403 or a hidden 404, never a 401, so a valid session is never told to sign in again.

Each operation's possible types are listed in its API reference page.

Retrying

  • Creates are idempotent by id. Send the same client-minted id again and you get the existing row, not a duplicate.
  • Appends carry the version you read. If someone else changed the record meanwhile, you get a 409. Read again and decide; nothing is merged silently.
  • 503 always carries Retry-After. Wait that many seconds.

Rate limits

Every request is counted, per person (or per address when unauthenticated), and some operations also spend a narrower bucket. Most responses carry:

HeaderMeaning
X-RateLimit-Limitthe bucket's limit for the window
X-RateLimit-Remainingrequests left in the window
X-RateLimit-Resetseconds until the window resets

When a bucket is exhausted, the API answers 429 with type rate-limited and a Retry-After header in seconds. Wait that long before sending again.

Requests that involve one-time codes, such as signing in or stepping up, are limited more tightly and never carry X-RateLimit-* headers.

A list request with limit above 200 is not rate-limited but refused with 422 invalid-input. Page through results with cursor instead.