Add an event type to a Subscription.

POST /v1/Subscriptions/{SubscriptionSid}/SubscribedEvents

Event subscribed to in the parent Subscription

Add an event type to a Subscription.

Path parameters

  • SubscriptionSid string Required

    The unique SID identifier of the Subscription.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^DF[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • Type string Required

    Type of event being subscribed to.

  • SchemaVersion integer

    The schema version that the Subscription should use.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The unique SID identifier of the Account.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • type string | null

      Type of event being subscribed to.

    • schema_version integer

      The schema version that the Subscription should use.

      Default value is 0.

    • subscription_sid string | null

      The unique SID identifier of the Subscription.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^DF[0-9a-fA-F]{32}$.

    • url string(uri) | null

      The URL of this resource.

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • account_sid string | null

      The unique SID identifier of the Account.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • type string | null

      Type of event being subscribed to.

    • schema_version integer

      The schema version that the Subscription should use.

      Default value is 0.

    • subscription_sid string | null

      The unique SID identifier of the Subscription.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^DF[0-9a-fA-F]{32}$.

    • url string(uri) | null

      The URL of this resource.

POST /v1/Subscriptions/{SubscriptionSid}/SubscribedEvents
curl \
 --request POST 'https://events.twilio.com/v1/Subscriptions/{SubscriptionSid}/SubscribedEvents' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Type=com.twilio.messaging.message.delivered&SchemaVersion=2'
Request examples
{"Type"=>"com.twilio.messaging.message.delivered", "SchemaVersion"=>2}
{"Type"=>"com.twilio.messaging.message.delivered", "SchemaVersion"=>2}
Response examples (200)
{
  "url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/com.twilio.messaging.message.delivered",
  "type": "com.twilio.messaging.message.delivered",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "schema_version": 2,
  "subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
Response examples (201)
{
  "url": "https://events.twilio.com/v1/Subscriptions/DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedEvents/com.twilio.messaging.message.delivered",
  "type": "com.twilio.messaging.message.delivered",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "schema_version": 2,
  "subscription_sid": "DFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}