Create a new Subscription

POST /v1/Subscriptions

Subscription to send Event Types to a Sink

Create a new Subscription.

application/x-www-form-urlencoded

Body

  • Description string Required

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

  • SinkSid string 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.

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

  • Types array Required

    An array of objects containing the subscribed Event Types

Responses

  • 201

    Created

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

      Account SID.

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

    • date_created string(date-time) | null

      The date this Subscription was created

    • date_updated string(date-time) | null

      The date this Subscription was updated

    • description string | null

      Subscription description

    • sid string | null

      A string that uniquely identifies this Subscription.

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

    • sink_sid string | null

      Sink SID.

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

    • url string(uri) | null

      The URL of this resource.

POST /v1/Subscriptions
curl \
 -X POST https://events.twilio.com/v1/Subscriptions \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'Description=string&SinkSid=string&'
Request example
{
  "Description": "string",
  "SinkSid": "string",
  "Types": []
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2023-05-04T09:42:00+00:00",
  "date_updated": "2023-05-04T09:42:00+00:00",
  "description": "string",
  "links": {},
  "sid": "string",
  "sink_sid": "string",
  "url": "https://example.com"
}