Concepts
Idempotency
Retry a request safely without doing the work, or spending the allowance, twice.
Operations that create something take an idempotency key: a UUID you generate, sent as idempotency_key in the body or as the Idempotency-Key header. If the connection drops, send the same request with the same key and you get the original result back.
curl -X POST https://api.coherenceltd.com/v1/briefs \
-H "Authorization: Bearer $COHERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_name": "Glow serum",
"idempotency_key": "5f1c9f3e-2a4b-4b1a-9f0e-3c2d1e0f9a8b"
}'- Use a fresh UUID for each new operation; reuse it only to retry that operation.
- The same key with the same body returns the original. With a different body it answers
409conflict. - Brief keys are kept for good: a key creates at most one brief in your workspace.
- If a create answers
503queue_unavailable, the work was saved; retrying with the same key resumes it.