Skip to contentSkip to navigationSkip to topbar
Rate this Page:

REST API: UsageTrigger


A UsageTrigger is a webhook that notifies your application of usage thresholds.

(information)

Info

Twilio can send your web application an HTTP request when certain events happen, such as an incoming text message to one of your Twilio phone numbers. These requests are called webhooks, or status callbacks. For more, check out our guide to Getting Started with Twilio Webhooks. Find other webhook pages, such as a security guide and an FAQ in the Webhooks section of the docs.

(warning)

Warning

It can take some amount of time for the data used by usage triggers to be reflected in the UsageTriggers evaluations.

Using this resource, you can make or update a new UsageTrigger, fetch information about an existing UsageTrigger or multiple UsageTriggers, or delete an existing UsageTrigger.

You can configure UsageTriggers to recur daily, monthly, or yearly. UsageTriggers are evaluated frequently — about once a minute — to provide timely information to your application.

You can also set UsageTriggers for any usage category. For example, you can create a single UsageTrigger to track daily usage. In this case, a UsageTrigger notifies your application when your cost exceeds a set daily amount. If used together with Subaccounts created for each end-user, then a UsageTrigger would notify your application that a specific user has exceeded an allocated monthly usage.

(information)

Info

For more information, see Usage categories in Usage Records as well as Subaccounts.


UsageTrigger Properties

usagetrigger-properties page anchor

A UsageTrigger is represented by the following properties:

Resource properties
account_sidtype: SID<AC>

api_versiontype: string

The API version used to create the resource.


callback_methodtype: enum<HTTP METHOD>

The HTTP method we use to call callback_url. Can be: GET or POST.

Possible values:
HEADGETPOSTPATCHPUTDELETE

callback_urltype: string<URI>
PII MTL: 60 days

The URL we call using the callback_method when the trigger fires.


current_valuetype: string

The current value of the field the trigger is watching.


date_createdtype: string<DATE TIME RFC 2822>

The date and time in GMT that the resource was created specified in RFC 2822(link takes you to an external page) format.


date_firedtype: string<DATE TIME RFC 2822>

The date and time in GMT that the trigger was last fired specified in RFC 2822(link takes you to an external page) format.


date_updatedtype: string<DATE TIME RFC 2822>

The date and time in GMT that the resource was last updated specified in RFC 2822(link takes you to an external page) format.


friendly_nametype: string

The string that you assigned to describe the trigger.


recurringtype: enum<STRING>

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.

Possible values:
dailymonthlyyearlyalltime

sidtype: SID<UT>

The unique string that that we created to identify the UsageTrigger resource.


trigger_bytype: enum<STRING>

The field in the UsageRecord(link takes you to an external page) resource that fires the trigger. Can be: count, usage, or price, as described in the UsageRecords documentation(link takes you to an external page).

Possible values:
countusageprice

trigger_valuetype: string

The value at which the trigger will fire. Must be a positive, numeric value.


uritype: string

The URI of the resource, relative to https://api.twilio.com.


usage_categorytype: enum<STRING>

The usage category the trigger watches. Must be one of the supported usage categories(link takes you to an external page).


usage_record_uritype: string

The URI of the UsageRecord(link takes you to an external page) resource this trigger watches, relative to https://api.twilio.com.


When an account's usage category crosses a UsageTrigger's TriggerValue during the specified interval, then Twilio makes a request to the CallbackUrl using the HTTP method CallbackMethod with the CallbackUrl Request parameters.

Twilio guarantees that a UsageTrigger will fire once (at most) during its recurring interval and will quickly retry the callback URL three times after a 5xx error.

(information)

Info

For more information, see CallbackUrl Request Parameters below.


Create a UsageTrigger Resource

create-a-usagetrigger-resource page anchor
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json

Each account can create up to 1,000 UsageTriggers. If UsageTrigger creation is successful, Twilio will respond with a representation of the new trigger.

(warning)

Warning

Inactive UsageTriggers will not be deleted automatically.

You need to delete triggers you no longer need. For more information, see Delete a UsageTrigger resource below.

Parameters

create-parameters page anchor
URI parameters
AccountSidtype: SID<AC>
Path Parameter

The SID of the Account(link takes you to an external page) that will create the resource.


Request body parameters
CallbackUrltype: string<URI>Required

The URL we should call using callback_method when the trigger fires.


TriggerValuetype: stringRequired

The usage value at which the trigger should fire. For convenience, you can use an offset value such as +30 to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a + as %2B.


UsageCategorytype: enum<STRING>Required

The usage category that the trigger should watch. Use one of the supported usage categories(link takes you to an external page) for this value.


CallbackMethodtype: enum<HTTP METHOD>

The HTTP method we should use to call callback_url. Can be: GET or POST and the default is POST.

Possible values:
HEADGETPOSTPATCHPUTDELETE

FriendlyNametype: string

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


Recurringtype: enum<STRING>

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.

Possible values:
dailymonthlyyearlyalltime

TriggerBytype: enum<STRING>

The field in the UsageRecord(link takes you to an external page) resource that should fire the trigger. Can be: count, usage, or price as described in the UsageRecords documentation(link takes you to an external page). The default is usage.

Possible values:
countusageprice

Create a new UsageTrigger with parameters

create-a-new-usagetrigger-with-parameters page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_14
// Download the Node helper library from twilio.com/docs/node/install
_14
// These consts are your accountSid and authToken from https://www.twilio.com/console
_14
// To set up environmental variables, see http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.usage.triggers
_14
.create({
_14
triggerValue: '1000',
_14
usageCategory: 'sms',
_14
callbackUrl: 'http://www.example.com/',
_14
})
_14
.then(trigger => process.stdout.write(trigger.sid));

Output

_17
{
_17
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=sms",
_17
"date_updated": "Sat, 13 Oct 2012 21:32:30 +0000",
_17
"date_fired": null,
_17
"friendly_name": "Trigger for sms at usage of 1000",
_17
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UTc142bed7b38c4f8186ef41a309814fd2.json",
_17
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_17
"callback_method": "POST",
_17
"trigger_by": "usage",
_17
"sid": "UTc142bed7b38c4f8186ef41a309814fd2",
_17
"current_value": "57",
_17
"date_created": "Sat, 13 Oct 2012 21:32:30 +0000",
_17
"callback_url": "http://www.example.com",
_17
"recurring": null,
_17
"usage_category": "sms",
_17
"trigger_value": "1000.000000"
_17
}

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.usage.triggers
_14
.create({
_14
callbackUrl: 'https://example.com',
_14
triggerValue: 'trigger_value',
_14
usageCategory: 'a2p-registration-fees'
_14
})
_14
.then(trigger => console.log(trigger.sid));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"api_version": "2010-04-01",
_18
"callback_method": "GET",
_18
"callback_url": "http://cap.com/streetfight",
_18
"current_value": "0",
_18
"date_created": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"date_fired": null,
_18
"date_updated": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"friendly_name": "raphael-cluster-1441544325.86",
_18
"recurring": "yearly",
_18
"sid": "UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"trigger_by": "price",
_18
"trigger_value": "50",
_18
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"usage_category": "totalprice",
_18
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice"
_18
}


Fetch a UsageTrigger resource

fetch-a-usagetrigger-resource page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json

URI parameters
AccountSidtype: SID<AC>
Path Parameter

The SID of the Account(link takes you to an external page) that created the UsageTrigger resource to fetch.


Sidtype: SID<UT>
Path Parameter

The Twilio-provided string that uniquely identifies the UsageTrigger resource to fetch.

Fetch a UsageTrigger resource

fetch-a-usagetrigger-resource-1 page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_11
// Download the Node helper library from twilio.com/docs/node/install
_11
// These consts are your accountSid and authToken from https://www.twilio.com/console
_11
// To set up environmental variables, see http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.usage
_11
.triggers('UT33c6aeeba34e48f38d6899ea5b765ad4')
_11
.fetch()
_11
.then(trigger => trigger.currentValue);

Output

_17
{
_17
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls",
_17
"date_updated": "Sat, 29 Sep 2012 19:47:54 +0000",
_17
"date_fired": null,
_17
"friendly_name": "Trigger for calls at usage of 500",
_17
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UT33c6aeeba34e48f38d6899ea5b765ad4.json",
_17
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_17
"callback_method": "POST",
_17
"trigger_by": "usage",
_17
"sid": "UT33c6aeeba34e48f38d6899ea5b765ad4",
_17
"current_value": "21",
_17
"date_created": "Sat, 29 Sep 2012 19:45:43 +0000",
_17
"callback_url": "http://www.example.com/",
_17
"recurring": null,
_17
"usage_category": "calls",
_17
"trigger_value": "500.000000"
_17
}

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.triggers('UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(trigger => console.log(trigger.friendlyName));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"api_version": "2010-04-01",
_18
"callback_method": "GET",
_18
"callback_url": "http://cap.com/streetfight",
_18
"current_value": "0",
_18
"date_created": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"date_fired": null,
_18
"date_updated": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"friendly_name": "raphael-cluster-1441544325.86",
_18
"recurring": "yearly",
_18
"sid": "UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"trigger_by": "price",
_18
"trigger_value": "50",
_18
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"usage_category": "totalprice",
_18
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice"
_18
}


Read multiple UsageTrigger resources

read-multiple-usagetrigger-resources page anchor
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Triggers.json

URI parameters
AccountSidtype: SID<AC>
Path Parameter

The SID of the Account(link takes you to an external page) that created the UsageTrigger resources to read.


Recurringtype: enum<STRING>
Query Parameter

The frequency of recurring UsageTriggers to read. Can be: daily, monthly, or yearly to read recurring UsageTriggers. An empty value or a value of alltime reads non-recurring UsageTriggers.

Possible values:
dailymonthlyyearlyalltime

TriggerBytype: enum<STRING>
Query Parameter

The trigger field of the UsageTriggers to read. Can be: count, usage, or price as described in the UsageRecords documentation(link takes you to an external page).

Possible values:
countusageprice

UsageCategorytype: enum<STRING>
Query Parameter

The usage category of the UsageTriggers to read. Must be a supported usage categories(link takes you to an external page).


PageSizetype: integer
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integer
Query Parameter

The page index. This value is simply for client state.


PageTokentype: string
Query Parameter

The page token. This is provided by the API.

Read multiple UsageTrigger resources

read-multiple-usagetrigger-resources-1 page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_15
// Download the Node helper library from twilio.com/docs/node/install
_15
// These consts are your accountSid and authToken from https://www.twilio.com/console
_15
// To set up environmental variables, see http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = require('twilio')(accountSid, authToken);
_15
_15
const filterOpts = {
_15
recurring: 'daily',
_15
usageCategory: 'calls',
_15
};
_15
_15
client.usage.triggers.each(filterOpts, trigger =>
_15
console.log(trigger.currentValue)
_15
);

Output

_27
{
_27
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/.json?UsageCategory=calls&Recurring=daily&Page=0&PageSize=50",
_27
"previous_page_uri": null,
_27
"usage_triggers": [
_27
{
_27
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records/Today.json?Category=calls",
_27
"date_updated": "Sat, 29 Sep 2012 19:42:57 +0000",
_27
"date_fired": null,
_27
"friendly_name": "a trigger",
_27
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers//UTc2db285b0cbf4c60a2f1a8db237a5fba.json",
_27
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"callback_method": "POST",
_27
"trigger_by": "count",
_27
"sid": "UTc2db285b0cbf4c60a2f1a8db237a5fba",
_27
"current_value": "0",
_27
"date_created": "Sun, 23 Sep 2012 23:07:29 +0000",
_27
"callback_url": "http://www.google.com",
_27
"recurring": "daily",
_27
"usage_category": "calls",
_27
"trigger_value": "0.000000"
_27
}
_27
],
_27
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers.json?UsageCategory=calls&Recurring=daily",
_27
"page_size": 50,
_27
"next_page_uri": null,
_27
"page": 0
_27
}

List multiple UsageTriggers

list-multiple-usagetriggers page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.triggers.list({limit: 20})
_10
.then(triggers => triggers.forEach(t => console.log(t.sid)));

Output

_33
{
_33
"end": 0,
_33
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers?PageSize=1&Page=0",
_33
"last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers?PageSize=1&Page=626",
_33
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers?PageSize=1&Page=1",
_33
"num_pages": 627,
_33
"page": 0,
_33
"page_size": 1,
_33
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers?PageSize=1&Page=0",
_33
"start": 0,
_33
"total": 627,
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers",
_33
"usage_triggers": [
_33
{
_33
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"api_version": "2010-04-01",
_33
"callback_method": "GET",
_33
"callback_url": "http://cap.com/streetfight",
_33
"current_value": "0",
_33
"date_created": "Sun, 06 Sep 2015 12:58:45 +0000",
_33
"date_fired": null,
_33
"date_updated": "Sun, 06 Sep 2015 12:58:45 +0000",
_33
"friendly_name": "raphael-cluster-1441544325.86",
_33
"recurring": "yearly",
_33
"sid": "UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"trigger_by": "price",
_33
"trigger_value": "50",
_33
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_33
"usage_category": "totalprice",
_33
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice"
_33
}
_33
]
_33
}


Update a UsageTrigger Resource

update-a-usagetrigger-resource page anchor
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json

Attempts a UsageTrigger's properties update and, if successful, returns the updated resource representation.

The returned response is identical to the returned response of a GET request.

URI parameters
AccountSidtype: SID<AC>
Path Parameter

The SID of the Account(link takes you to an external page) that created the UsageTrigger resources to update.


Sidtype: SID<UT>
Path Parameter

The Twilio-provided string that uniquely identifies the UsageTrigger resource to update.


Request body parameters
CallbackMethodtype: enum<HTTP METHOD>

The HTTP method we should use to call callback_url. Can be: GET or POST and the default is POST.

Possible values:
HEADGETPOSTPATCHPUTDELETE

CallbackUrltype: string<URI>

The URL we should call using callback_method when the trigger fires.


FriendlyNametype: string

A descriptive string that you create to describe the resource. It can be up to 64 characters long.

Update a UsageTrigger Resource

update-a-usagetrigger-resource-1 page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_14
// Download the Node helper library from twilio.com/docs/node/install
_14
// These consts are your accountSid and authToken from https://www.twilio.com/console
_14
// To set up environmental variables, see http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.usage
_14
.triggers('UT33c6aeeba34e48f38d6899ea5b765ad4')
_14
.update({
_14
friendlyName: 'Monthly Maximum Call Usage',
_14
callbackUrl: 'https://www.example.com/monthly-usage-trigger',
_14
})
_14
.then(trigger => console.log(trigger.dateFired));

Output

_17
{
_17
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records.json?Category=calls",
_17
"date_updated": "Sat, 13 Oct 2012 21:24:35 +0000",
_17
"date_fired": null,
_17
"friendly_name": "Monthly Maximum Call Usage",
_17
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UT33c6aeeba34e48f38d6899ea5b765ad4.json",
_17
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_17
"callback_method": "POST",
_17
"trigger_by": "usage",
_17
"sid": "UT33c6aeeba34e48f38d6899ea5b765ad4",
_17
"current_value": "21",
_17
"date_created": "Sat, 29 Sep 2012 19:45:43 +0000",
_17
"callback_url": "https://www.example.com/monthly-usage-trigger",
_17
"recurring": null,
_17
"usage_category": "calls",
_17
"trigger_value": "500.000000"
_17
}

(warning)

Warning

Currently, you cannot update the category or value of an existing UsageTrigger. Instead, use POST to create a new UsageTrigger and use DELETE to remove an old UsageTrigger.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.triggers('UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({callbackMethod: 'GET'})
_10
.then(trigger => console.log(trigger.friendlyName));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"api_version": "2010-04-01",
_18
"callback_method": "GET",
_18
"callback_url": "http://cap.com/streetfight",
_18
"current_value": "0",
_18
"date_created": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"date_fired": null,
_18
"date_updated": "Sun, 06 Sep 2015 12:58:45 +0000",
_18
"friendly_name": "raphael-cluster-1441544325.86",
_18
"recurring": "yearly",
_18
"sid": "UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"trigger_by": "price",
_18
"trigger_value": "50",
_18
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Triggers/UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"usage_category": "totalprice",
_18
"usage_record_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Usage/Records?Category=totalprice"
_18
}


Delete a UsageTrigger resource

delete-a-usagetrigger-resource page anchor
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Usage/Triggers/{Sid}.json

URI parameters
AccountSidtype: SID<AC>
Path Parameter

The SID of the Account(link takes you to an external page) that created the UsageTrigger resources to delete.


Sidtype: SID<UT>
Path Parameter

The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.usage.triggers('UTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();


Rate this Page: