Sample - Twilio API
POST/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json

Update a usage trigger

Updates an existing usage trigger for an account. Use CallbackUrl, CallbackMethod, and FriendlyName to change how the trigger is described and called. The response includes the trigger's current configuration and firing state.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 3 body fields
AccountSidstringrequired
The 34-character SID of the account that created the usage trigger, matching the `AC` SID format.
Sidstringrequired
The 34-character SID of the usage trigger to update, matching the `UT` SID format.

Optional form data containing the usage trigger properties to update.

CallbackMethodstringoptional
The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`.
Allowed:GETPOST
CallbackUrlstringoptional
The URL we should call using `callback_method` when the trigger fires.
FriendlyNamestringoptional
A descriptive string that you create to describe the resource. It can be up to 64 characters long.

1 status code
200Returns the updated usage trigger, including its account, callback configuration, current value, firing dates, recurrence, trigger criteria, and resource URI.
account_sidstringoptional
The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the trigger monitors.
api_versionstringoptional
The API version used to create the resource.
callback_methodstringoptional
The HTTP method we use to call `callback_url`. Can be: `GET` or `POST`.
Allowed:GETPOST
callback_urlstringoptional
The URL we call using the `callback_method` when the trigger fires.
current_valuestringoptional
The current value of the field the trigger is watching.
date_createdstringoptional
The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
date_firedstringoptional
The date and time in GMT that the trigger was last fired specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
date_updatedstringoptional
The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.
friendly_namestringoptional
The string that you assigned to describe the trigger.
recurringstringoptional
The frequency of a recurring UsageTrigger. Can be: `daily`, `monthly`, or `yearly` for recurring triggers or empty for non-recurring triggers. A trigger will only fire once during each period. Recurring times are in GMT.
Allowed:dailymonthlyyearlyalltime
sidstringoptional
The unique string that that we created to identify the UsageTrigger resource.
trigger_bystringoptional
The field in the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource that fires the trigger. Can be: `count`, `usage`, or `price`, as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price).
Allowed:countusageprice
trigger_valuestringoptional
The value at which the trigger will fire. Must be a positive, numeric value.
uristringoptional
The URI of the resource, relative to `https://api.twilio.com`.
usage_categorystringoptional
The usage category the trigger watches. Must be one of the supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories).
usage_record_uristringoptional
The URI of the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource this trigger watches, relative to `https://api.twilio.com`.

Error handling

AccountSid must be a 34-character account SID beginning with AC, and Sid must be a 34-character usage trigger SID beginning with UT. If provided, CallbackMethod must be GET or POST, CallbackUrl must be a valid URI, and FriendlyName can be up to 64 characters.