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
        
        
        

        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
              
              
              

              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
                    
                    
                    

                    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
                          
                          
                          

                          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
                                
                                
                                
                                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 Community Forums or browsing the Twilio tag on Stack Overflow.

                                      
                                      
                                      

                                      Thank you for your feedback!

                                      We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

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

                                      Thanks for your feedback!

                                      Refer us and get $10 in 3 simple steps!

                                      Step 1

                                      Get link

                                      Get a free personal referral link here

                                      Step 2

                                      Give $10

                                      Your user signs up and upgrade using link

                                      Step 3

                                      Get $10

                                      1,250 free SMSes
                                      OR 1,000 free voice mins
                                      OR 12,000 chats
                                      OR more