Skip to content

Idempotency ​

POST /quotes, POST /organizations, POST /leads, and the batch versions require an idempotency key so a retried HTTP call does not double-write.

Directory and lead sync also send external_reference. That id updates the same company or lead on later runs, after the idempotency key has expired. Use a new idempotency key when the JSON body changes. Reusing the old key with a different body returns 409.

http
Idempotency-Key: 01J8Z3V…   # or any opaque string ≤ 128 chars

Recommendations:

  • Use a UUID / ULID per user submit action.
  • Persist the key with your form submission id.
  • Reuse the same key when retrying after timeouts.
  • Use a new key for a genuinely new submission.

Behavior ​

CaseResult
First request with keyProcessed; full response body stored with status and resource id
Replay, same key + same body fingerprintOriginal response replayed (same resource id and body)
Replay, same key + different body409 idempotency_conflict
Key expired (retention ~72 hours)Treated as new

Retention and purge: public-api-spec.md §8.

Example ​

bash
KEY=submit-10482-attempt
curl -sS "$AF_API/quotes" \
  -H "Authorization: Bearer $AF_API_KEY" \
  -H "Idempotency-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d @payload.json
# network blip — safe to repeat with same KEY

API base: https://api.appraiserflow.ai/public/v1. Test and live keys created in this environment both use this base.