Idempotency
Safely retry sends without creating duplicate messages by sending an
Idempotency-Key header.
Supported endpoints
POST /emailsPOST /emails/batch
Header: Idempotency-Key: <string max 256>
Behavior
- Window: 24 hours per API key / tenant.
- Same key + same body → original response is replayed.
- Same key + different body → 409
idempotency_conflict. - For batch, the key applies to the whole batch request, not per item.
Example
cURL
curl https://api.xurel.co/v1/emails \
-H "Authorization: Bearer $XUREL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-42-receipt" \
-d '{"from":"billing@yourdomain.com","to":["user@example.com"],"subject":"Receipt","html":"<p>Thanks</p>","type":"transactional"}'