Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Track webhook rule changes


(new)

Public Beta

The Webhooks configuration API, including the Webhook Settings and Webhook Rules resources, has been released as a Public Beta product. Before Twilio declares this product as Generally Available, the information contained in this document might change. Twilio might implement additional features or change others. No Twilio SLA(link takes you to an external page) covers Public Beta products.

A Webhook Rule write is saved immediately, but it doesn't take effect until it propagates to the plane that delivers your webhooks. An Operation tracks that propagation so you can confirm when the change is live.

Settings, AuthProfiles, and SharedKeys propagate on the same 30 to 60 second timescale, but they create no Operation. There's nothing to poll, so allow that window before relying on them.


What happens when you change a rule

what-happens-when-you-change-a-rule page anchor
  1. Twilio validates your request. An invalid request returns 400, 409, or 422 and nothing changes.
  2. A valid request returns 202 Accepted with three headers: Operation-Id, Location pointing at the Operation, and Retry-After.
  3. The change propagates to every region, which typically takes 30 to 60 seconds.
  4. The Operation's status becomes COMPLETED.

The 202 response body carries the Operation and, for create and update, the Rule as it stood when Twilio accepted the change. Delete responses omit the Rule.

(warning)

Behavior during propagation

Until the Operation completes, some webhooks may still use the previous configuration. A newly created Rule may not match yet, so its traffic can fall through to another Rule or to the default Rule. Don't remove the old Setting until the Operation reports COMPLETED.


PropertyTypeDescription
idstringThe Operation's identifier, in the form webhooks_operation_ plus 26 characters.
statusUrlstringWhere to poll for status. Matches the Location header on the 202 response.
statusenumThe Operation's current state.
resourceIdstringThe Rule the Operation affects.
errorobjectPresent only when status is FAILED.
createdAtstringWhen Twilio accepted the change, as an ISO 8601 timestamp.
completedAtstringWhen the Operation finished, as an ISO 8601 timestamp.
retentionPeriodstringHow long Twilio keeps the record, as an ISO 8601 duration. Fixed at seven days.

statusMeaning
PENDINGAccepted, not yet started.
RUNNINGPropagating to all regions.
COMPLETEDThe change is active globally.
CANCELLEDThe Operation stopped before completing.
FAILEDThe Operation couldn't complete. See error for the reason.

When status is FAILED, error carries a type URI, a title, a numeric Twilio code, and a detail explaining this occurrence.


Poll the Operation-Id you received from the Rule change.

1
curl -X GET https://webhooks.twilio.com/v1/Webhooks/Operations/{OPERATION_ID} \
2
-u {API_KEY_SID}:{API_KEY_SECRET}

Respect the Retry-After header from the 202 response rather than polling tightly. Most Operations complete within a minute.


Recover a lost operation ID

recover-a-lost-operation-id page anchor

If your process lost the Operation-Id before persisting it, list your Operations. Results come back newest first.

1
curl -X GET https://webhooks.twilio.com/v1/Webhooks/Operations \
2
-u {API_KEY_SID}:{API_KEY_SECRET}

Narrow the list by state or by the Rule it affects.

1
curl -X GET 'https://webhooks.twilio.com/v1/Webhooks/Operations?status=RUNNING&resourceId={RULE_ID}' \
2
-u {API_KEY_SID}:{API_KEY_SECRET}

Operation records are retained for seven days from creation, so an Operation older than that no longer appears.