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

Update a usage trigger

Updates an existing usage trigger for an account. Supply the trigger fields you want to change, such as CallbackUrl, CallbackMethod, or FriendlyName; the request body is optional. The callback URL is used when the trigger fires.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 3 body fields
AccountSidstringrequired
The account SID, in the format `AC` followed by 32 hexadecimal characters.
Sidstringrequired
The usage trigger SID, in the format `UT` followed by 32 hexadecimal characters.

Optional usage trigger fields 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 and trigger SIDs, callback settings, current value, dates, recurrence, trigger field and value, and usage category.
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

The AccountSid path parameter must be a 34-character SID beginning with AC followed by 32 hexadecimal characters. The Sid path parameter must be a 34-character SID beginning with UT followed by 32 hexadecimal characters. CallbackUrl must be a URI, CallbackMethod must be GET or POST, and FriendlyName can be up to 64 characters.