Idempotency
Make retries of create requests safe with the Idempotency-Key header.
Networks fail. If a request that creates something times out, you cannot tell whether it ran. Endpoints that support it accept an Idempotency-Key header so you can retry safely.
How it works#
Send a unique key (up to 200 characters, for example a UUID or renewals-2026-12-07) with the request:
- The same key with the same body runs once within 24 hours. A retry gets the first answer, with the header
Idempotent-Replayed: true. - The same key with a different body is refused with
422. - A retry while the first request is still running gets
409; retry again a moment later. - A request that fails frees its key, so you can retry it.
Supported today on campaign creation from JSON (POST /agents/campaigns/json) and adding contacts (POST /agents/campaigns/{id}/contacts).
curl -X POST https://api.voicemint.io/api/v1/agents/campaigns/json \
-H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: renewals-2026-12-07" \
-d '{"name": "December renewals", "agent_id": "AGENT_ID", "contacts": [{"phone": "+919876543210", "name": "Asha"}]}'Other writes#
Credit charges are idempotent internally (each charge has its own reference, so a retried generation is never billed twice), but most create endpoints do not de-duplicate a repeated request. Before retrying a create without idempotency support, list what exists (for example the agent by name) to check whether the first attempt succeeded.