---
title: "Errors, idempotency & versioning"
description: "Problem details, retry semantics and the compatibility contract"
url: https://docs.gleap.ai/en/articles/724-errors-idempotency-and-versioning
collection: "Guide"
updated: 2026-11-01
language: en
---

# Errors, idempotency & versioning

Problem details, retry semantics and the compatibility contract

## Errors — RFC 9457 problem details

Every error is `application/problem+json` with a stable machine-readable `code`:

```json
{ "type": "https://docs.gleap.io/s2s/problems/conversation_closed",
  "title": "Conversation Closed", "status": 409, "code": "conversation_closed",
  "detail": "This conversation is closed. Reopen it to send messages.",
  "request_id": "req_66c0ffee0000000000000001" }
```

Branch on `code`, never on `detail` (human wording can change). Every response — success or error — carries a `Gleap-Request-Id` header; include it when contacting support about a request.

<table style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Code</p></th><th colspan="1" rowspan="1"><p>Status</p></th><th colspan="1" rowspan="1"><p>Meaning</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>unauthorized</code></p></td><td colspan="1" rowspan="1"><p>401</p></td><td colspan="1" rowspan="1"><p>Missing, invalid or revoked service-account token</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>forbidden</code></p></td><td colspan="1" rowspan="1"><p>403</p></td><td colspan="1" rowspan="1"><p>Token cannot access this resource/channel</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>not_found</code></p></td><td colspan="1" rowspan="1"><p>404</p></td><td colspan="1" rowspan="1"><p>Resource does not exist in this project (also: pruned/deleted conversations)</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>validation_failed</code></p></td><td colspan="1" rowspan="1"><p>400</p></td><td colspan="1" rowspan="1"><p>Request shape invalid (<code>errors</code> extension carries field details)</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>conversation_closed</code></p></td><td colspan="1" rowspan="1"><p>409</p></td><td colspan="1" rowspan="1"><p>Customer messages rejected until reopened</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>contact_blocked</code></p></td><td colspan="1" rowspan="1"><p>403</p></td><td colspan="1" rowspan="1"><p>The contact is blocked in this project</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>agent_not_capable</code></p></td><td colspan="1" rowspan="1"><p>400</p></td><td colspan="1" rowspan="1"><p>The AI agent lacks the "Reply to customer" tool</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>workflow_not_found</code></p></td><td colspan="1" rowspan="1"><p>404</p></td><td colspan="1" rowspan="1"><p>Unknown or non-live workflow</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>idempotency_in_flight</code></p></td><td colspan="1" rowspan="1"><p>409</p></td><td colspan="1" rowspan="1"><p>Original request with this key still processing — retry after <code>Retry-After</code></p></td></tr><tr><td colspan="1" rowspan="1"><p><code>idempotency_key_reuse</code></p></td><td colspan="1" rowspan="1"><p>422</p></td><td colspan="1" rowspan="1"><p>Same key, different request body</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>rate_limited</code></p></td><td colspan="1" rowspan="1"><p>429</p></td><td colspan="1" rowspan="1"><p>Over budget — honor <code>Retry-After</code></p></td></tr><tr><td colspan="1" rowspan="1"><p><code>rate_limiter_unavailable</code></p></td><td colspan="1" rowspan="1"><p>503</p></td><td colspan="1" rowspan="1"><p>Transient infrastructure state — retry after <code>Retry-After</code></p></td></tr><tr><td colspan="1" rowspan="1"><p><code>unsupported_version</code></p></td><td colspan="1" rowspan="1"><p>400</p></td><td colspan="1" rowspan="1"><p>Unknown <code>Gleap-Version</code> value</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>webhook_limit_reached</code></p></td><td colspan="1" rowspan="1"><p>409</p></td><td colspan="1" rowspan="1"><p>More than 5 webhook endpoints</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>payload_too_large</code></p></td><td colspan="1" rowspan="1"><p>413</p></td><td colspan="1" rowspan="1"><p>Upload exceeds 25 MB</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>upload_failed</code></p></td><td colspan="1" rowspan="1"><p>500</p></td><td colspan="1" rowspan="1"><p>Storage/transcode failure</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>internal_error</code></p></td><td colspan="1" rowspan="1"><p>500</p></td><td colspan="1" rowspan="1"><p>Unexpected server error — safe to retry</p></td></tr></tbody></table>

## Idempotency

Send an `Idempotency-Key` header (≤255 chars, e.g. a UUID) on any POST you might retry:

-   A **successful** response is stored and replayed for **24 hours** — replays carry `Gleap-Idempotency-Replayed: true` and are byte-equivalent (file URLs re-signed fresh).
    
-   **Error responses are never stored** — retry them normally with the same key.
    
-   The same key with a **different body** returns `422 idempotency_key_reuse`.
    
-   Semantics are **at-least-once**: a retry racing a crashed or >60-second-running original may re-execute. Design consumers to tolerate a rare duplicate (e.g. reconcile by conversation `number`/content), as you would with Stripe-style idempotency.
    

## Versioning & compatibility

-   Pin with `Gleap-Version: 2026-08-01`; responses echo the resolved version.
    
-   Within a version, changes are **additive only** — ignore unknown fields and unknown event types.
    
-   Breaking changes ship as a new dated version; the previous version remains supported for **at least 12 months** with written notice.

## Related

- [Overview](https://docs.gleap.ai/en/articles/718-overview.md)
- [Authentication](https://docs.gleap.ai/en/articles/719-authentication.md)
- [Quickstart](https://docs.gleap.ai/en/articles/720-quickstart.md)
- [Workflows & bots](https://docs.gleap.ai/en/articles/721-workflows-and-bots.md)
- [Webhooks & events](https://docs.gleap.ai/en/articles/722-webhooks-and-events.md)
