Skip to content

Safe retries and edits

Networks fail. These three tools let you retry without making duplicates, and edit without losing someone else’s work.

Send an Idempotency-Key header when you open a ticket:

Terminal window
curl https://api.supportaka.com/api/v1/organizations/$ORG/products/$PRODUCT/tickets \
-H "Authorization: Bearer $SUPPORTAKA_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042-refund" \
-d '{ "customer_id": "…", "subject": "Refund for order #1042", "description": "…" }'
  • The same key with the same request returns the ticket made the first time, instead of a second ticket.
  • The same key with a different request answers 409 IDEMPOTENCY_KEY_REUSED.
  • Use something that identifies the thing you’re reporting (an order or form submission ID), or a random UUID you store before sending. Up to 200 printable characters.

Every chat reply carries your own client_message_id:

{ "client_message_id": "7b0c2e4e-0d64-4d0c-a4bb-0f1d3f9a2c11", "body": "Your order is on its way!" }

Sending the same ID again returns the stored message (200) instead of posting it twice. The same ID with different content is 409 CLIENT_MESSAGE_ID_REUSED. Generate a UUID per message and keep it until the send succeeds.

A ticket has a version that goes up with every change. Some changes, such as a status change, require the version you last saw:

POST …/tickets/{ticketID}/status
{ "status": "resolved", "version": 7 }

If someone changed the ticket after you read it, you get 409 TICKET_VERSION_CONFLICT instead of overwriting their change. Read the ticket again, decide whether your change still makes sense, and send it with the new version.

FAQs and articles work the same way with revision (409 REVISION_CONFLICT).

Request Safe to retry?
GET Always
Creating a ticket with an Idempotency-Key Yes
A chat reply with the same client_message_id Yes
A status change with version Yes: a repeat is refused rather than applied twice
Other POST/PATCH requests Only if repeating them does no harm. Check the result first

Retry 429 after the Retry-After header, and 5xx with exponential backoff (for example 1 s, 2 s, 4 s, 8 s, then give up and alert).