Triggers
Create, update, delete, and query usage Triggers in Twilio.
Table-Specific Information
SELECT
The driver uses the Twilio API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client-side within the driver.
| Column | Supported Operators |
| Sid | = |
| UsageCategory | = |
| TriggerBy | = |
| Recurring | = |
For example:
SELECT * FROM Triggers WHERE Sid = 'X123456789'
INSERT
To add a Trigger specify the UsageCategory, TriggerValue, and CallbackUrl. Other optional columns are Name, TriggerBy, Recurring, and CallbackMethod.
INSERT INTO Triggers (UsageCategory, TriggerValue, CallbackUrl, CallbackMethod, Name, Recurring, TriggerBy)
VALUES ('sms', 100, 'http://twilio.com/test', 'POST', 'trigger test', 'monthly', 'price')
UPDATE
Triggers allow UPDATEs for the Name, CallbackUrl, and CallbackMethod columns.
UPDATE Triggers SET Name = 'updated' WHERE Sid = 'X123456789'
Columns
| Name | Type | ReadOnly | References | Description |
| Sid [KEY] | String | True |
The Id of the trigger. | |
| AccountSid | String | True |
The account Id of the trigger. | |
| DateCreated | Datetime | True |
The creation date of the trigger. | |
| DateUpdated | Datetime | True |
The modification date of the trigger. | |
| DateFired | Datetime | True |
The fired date of the trigger. | |
| Name | String | False |
The friendly name of the trigger. | |
| UsageCategory | String | False |
The usage category the trigger watches. For example: calls, sms, phonenumbers, recordings, transcriptions, totalprice. | |
| TriggerBy | String | False |
The usage record field that the trigger is watching. Allowed values: count, usage, and price. The allowed values are count, usage, price. | |
| Recurring | String | False |
The recurring interval of the trigger. Allowed values: daily, monthly, and yearly. The allowed values are daily, monthly, yearly. | |
| TriggerValue | Double | False |
The value of the usage record field that will fire the trigger. | |
| CurrentValue | Double | True |
The current value of the field the trigger is watching. | |
| CallbackUrl | String | False |
The callback URL of the trigger, where Twilio makes a request when the trigger fires. | |
| CallbackMethod | String | False |
The HTTP method to be used to make requests to the callback URL. | |
| UsageRecordUri | String | True |
The URI of the usage record the trigger is watching. | |
| Uri | String | True |
The URI of the trigger. | |
| ApiVersion | String | True |
The API version of the trigger. |