Subscription Resource
You can use the Subscriptions API to subscribe to specific Twilio events and versions, and manage your subscriptions.
With the Subscriptions API you can:
- Create new Subscriptions.
- Fetch a specific Subscription.
- Fetch a list of Subscriptions.
- Update a Subscription.
- Delete a Subscription.
A subscription is comprised of a set of pairs of Event Types and Schema versions that can be modified using the SubscribedEvents API.
Subscription properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The unique SID identifier of the Account. |
sid
|
A 34 character string that uniquely identifies this Subscription. |
date_created
|
The date that this Subscription was created, given in ISO 8601 format. |
date_updated
|
The date that this Subscription was updated, given in ISO 8601 format. |
description
|
A human readable description for the Subscription |
sink_sid
|
The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. |
url
|
The URL of this resource. |
links
|
Contains a dictionary of URL links to nested resources of this Subscription. |
Create a Subscription
https://events.twilio.com/v1/Subscriptions
Make a new Subscription.
Parameters
Parameters in REST API format | |
---|---|
description
Required
|
A human readable description for the Subscription This value should not contain PII. |
sink_sid
Required
|
The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. |
types
Required
|
An array of objects containing the subscribed Event Types |
Example 1
Fetch a Subscription
https://events.twilio.com/v1/Subscriptions/{Sid}
Retrieve a specific Subscription using its Subscription ID.
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this Subscription. |
Example 1
Get all Subscriptions
https://events.twilio.com/v1/Subscriptions
Retrieve information on all created subscriptions
Parameters
Parameters in REST API format | |
---|---|
sink_sid
Optional
|
The SID of the sink that the list of Subscriptions should be filtered by. |
Example 1
Update a Subscription
https://events.twilio.com/v1/Subscriptions/{Sid}
Modify an existing Subscription identified by its Subscription ID.
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this Subscription. |
description
Optional
|
A human readable description for the Subscription. |
sink_sid
Optional
|
The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. |
Example 1
Delete a Subscription
https://events.twilio.com/v1/Subscriptions/{Sid}
Remove a Subscription identified by its Subscription ID.
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this Subscription. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.