Menu

Expand
Rate this page:

Subscribed Event Resource

With this API the user can perform CRUD operations on an Event associated with a Subscription.

With the Subscribed Event API you can:

  • Add an existing event type to a subscription
  • Get all events associated with a subscription
  • Update an event on a subscription
  • Delete an event on a subscription

SubscribedEvent properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The unique SID identifier of the Account.

type
string Not PII

Type of event being subscribed to.

schema_version
integer Not PII

The schema version that the Subscription should use.

subscription_sid
sid<DF> Not PII

The unique SID identifier of the Subscription.

url
url Not PII

The URL of this resource.

Add an Event Type

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

This endpoint adds an existing event type to a particular subscription. It is possible to specify the version of the schema to use for the given event type. Otherwise the last available schema version will be used for the added event type.

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

The unique SID identifier of the Subscription.

type
Required
post string Not PII

Type of event being subscribed to.

schema_version
Optional
post integer Not PII

The schema version that the Subscription should use.

Example 1
Loading Code Sample...
        
        
        Adds an event type to the subscription to the latest schema version available

        Add Event Type to Subscription

        Adds an event type to the subscription to the latest schema version available
        Example 2
        Loading Code Sample...
              
              
              Add an event type specifying the schema version to be used

              Add Event Type with schema version

              Add an event type specifying the schema version to be used

              Get All Events

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

              Get all event types associated with a particular subscription

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

              The unique SID identifier of the Subscription.

              Example 1
              Loading Code Sample...
                    
                    

                    Get all subscribed events types

                    Update Event

                    post
                    https://events.twilio.com/v1/Subscriptions/{SubscriptionSid}/SubscribedEvents/{Type}

                    Updates the event type

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

                    The unique SID identifier of the Subscription.

                    type
                    Path
                    post string Not PII

                    Type of event being subscribed to.

                    schema_version
                    Optional
                    post integer Not PII

                    The schema version that the Subscription should use.

                    Example 1
                    Loading Code Sample...
                          
                          
                          Downgrade the version of the subscribed event type

                          Change schema version of subscribed event type

                          Downgrade the version of the subscribed event type

                          Delete an Event

                          delete
                          https://events.twilio.com/v1/Subscriptions/{SubscriptionSid}/SubscribedEvents/{Type}

                          Deletes an event type on a subscription.

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

                          The unique SID identifier of the Subscription.

                          type
                          Path
                          delete string Not PII

                          Type of event being subscribed to.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Remove an event type from a 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