API reference: Retries and idempotency

Retries and idempotency. Safe to retry, charged once.

Networks fail. Send an Idempotency-Key with a POST and a retry returns the first result instead of doing the work again.

First try201 Created
Idempotency-Key: order-1001-q1
Retry after a timeoutReplayed
Idempotency-Key: order-1001-q1
One message, charged once

How it works

  • Send Idempotency-Key: <a unique string> (up to 255 characters, a UUID is ideal) with POST …/messages or POST …/replies.
  • Retry with the same key and the same body within 24 hours and you get the first response again, with the header Idempotent-Replayed: true. No second message is sent and nothing is charged twice.
  • Generate a new key for each new message, and reuse it only for retries of that message.

Conflicts

StatusCodeWhen
409idempotency_in_progressThe first request with this key is still running. Wait a moment and retry.
409idempotency_key_reusedThe key was used with a different body. Use a new key.

Other requests are safe to retry as they are: reads change nothing, and a second take-over, resolve or delete returns a 409 or 404 you can treat as done.

Try SimplyBoost with your own content

Start a 7-day free trial with 100 AI replies. Add your website, install the widget and see how the agent answers your customers.

See pricing
  • No credit card required
  • 7 days, 100 AI replies
  • From €39 a month
  • Hosted in Europe