Menu

Expand
Rate this page:

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
sid<AC> Not PII

The unique SID identifier of the Account.

sid
sid<DF> Not PII

A 34 character string that uniquely identifies this Subscription.

date_created
date_time<iso8601> Not PII

The date that this Subscription was created, given in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date that this Subscription was updated, given in ISO 8601 format.

description
string Not PII

A human readable description for the Subscription

sink_sid
sid<DG> Not PII

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
url Not PII

The URL of this resource.

links
uri_map Not PII

Contains a dictionary of URL links to nested resources of this Subscription.

Create a Subscription

post
https://events.twilio.com/v1/Subscriptions

Make a new Subscription.

Parameters
Parameters in REST API format
description
Required
post string Not PII

A human readable description for the Subscription This value should not contain PII.

sink_sid
Required
post sid<DG> Not PII

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
post object[] Not PII

An array of objects containing the subscribed Event Types

Example 1
Loading Code Sample...
        
        

        Create a new Subscription

        Fetch a Subscription

        get
        https://events.twilio.com/v1/Subscriptions/{Sid}

        Retrieve a specific Subscription using its Subscription ID.

        Parameters
        Parameters in REST API format
        sid
        Path
        get sid<DF> Not PII

        A 34 character string that uniquely identifies this Subscription.

        Example 1
        Loading Code Sample...
              
              

              Fetch Subscription

              Get all Subscriptions

              get
              https://events.twilio.com/v1/Subscriptions

              Retrieve information on all created subscriptions

              Parameters
              Parameters in REST API format
              sink_sid
              Optional
              get sid<DG> Not PII

              The SID of the sink that the list of Subscriptions should be filtered by.

              Example 1
              Loading Code Sample...
                    
                    

                    Read Subscriptions

                    Update a Subscription

                    post
                    https://events.twilio.com/v1/Subscriptions/{Sid}

                    Modify an existing Subscription identified by its Subscription ID.

                    Parameters
                    Parameters in REST API format
                    sid
                    Path
                    post sid<DF> Not PII

                    A 34 character string that uniquely identifies this Subscription.

                    description
                    Optional
                    post string Not PII

                    A human readable description for the Subscription.

                    sink_sid
                    Optional
                    post sid<DG> Not PII

                    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
                    Loading Code Sample...
                          
                          

                          Change subscription description

                          Delete a Subscription

                          delete
                          https://events.twilio.com/v1/Subscriptions/{Sid}

                          Remove a Subscription identified by its Subscription ID.

                          Parameters
                          Parameters in REST API format
                          sid
                          Path
                          delete sid<DF> Not PII

                          A 34 character string that uniquely identifies this Subscription.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete Subscription

                                Rate this page:

                                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.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif