Safe retries

Retry a request without sending it twice.

A request can time out after Aloware already did the work. Retry it blindly and the contact gets the text twice, or two calls. Send an Idempotency-Key header and Aloware runs the request once, however many times you send it.

How it works

  • Make up a key for each action you want done once, up to 255 characters. A UUID, or your own record ID plus the date, works well.
  • Send the same key every time you retry that action, with the same body.
  • A repeat within 24 hours gets the first answer back, with the header Idempotent-Replayed: true, and nothing runs again.
  • Only successful answers are kept. If the first try failed, a retry with the same key runs again.

Header

Idempotency-Key: lead-8f14e45f-2026-10-28

Example

curl --location --request POST 'https://app.aloware.io/api/v1/webhook/sms-gateway/send' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Idempotency-Key: order-5521-confirmation' \
--data-raw '{
    "api_token": "[API_TOKEN]",
    "line_id": 1234,
    "to": "+18182563429",
    "message": "Your order is confirmed."
}'

Answers to watch for

  • 409: the first request with this key is still running. Wait, then try again.
  • 409 for longer than 5 minutes: the first request never finished, and repeats keep getting 409 for up to 24 hours. Check whether it took effect, then retry with a new key.
  • 422: you reused a key with a different body. Use a new key for a different action.

Endpoints that take the key

SMSPOST /webhook/sms-gateway/send
Ringless voicemailPOST /webhook/rvm-gateway/send
Two-legged callPOST /webhook/two-legged-call
AloAi outbound callPOST /webhook/aloai-outbound-call
Lead APIPOST /webhook/forms
Sequence enrollPOST /webhook/sequence-enroll
Sequence disenrollPOST /webhook/sequence-disenroll
Number lookupPOST /webhook/lookup
Power Dialer: add contactsPOST /webhook/powerdialer-add-contacts
Power Dialer: remove a contactPOST /webhook/powerdialer-remove-contact-from-lists
Power Dialer: clear a listPOST /webhook/powerdialer-clear-list
Power Dialer: clear a user's listsPOST /webhook/powerdialer-clear-user-lists

GET requests only read, so they don't need a key.

Need another endpoint?

For other API functions or any question about this one, email support@aloware.com with what you're trying to do.

Need a hand?

Our support team can help you set this up.

Contact support