Create a new webhook scoped to the conversation

POST /v1/Conversations/{ConversationSid}/Webhooks

A Scoped Webhook resource manages a set of callback URLs and their configuration for receiving events specific to one conversation.

Create a new webhook scoped to the conversation

Path parameters

Body

  • The list of events, firing webhook event for this Conversation.

  • The studio flow SID, where the webhook should be sent to.

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

  • The HTTP method to be used when sending a webhook request.

    Values are GET or POST.

  • The message index for which and it's successors the webhook will be replayed. Not set by default

  • The list of keywords, firing webhook event for this Conversation.

  • The absolute url the webhook request should be sent to.

  • Target string Required

    The target of this webhook: webhook, studio, trigger

    Values are webhook, trigger, or studio.

Responses

  • Created

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

      The unique ID of the Account responsible for this conversation.

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

    • The configuration of this webhook.

    • conversation_sid string | null

      The unique ID of the Conversation for this webhook.

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

    • date_created string(date-time) | null

      The date that this resource was created.

    • date_updated string(date-time) | null

      The date that this resource was last updated.

    • sid string | null

      A 34 character string that uniquely identifies this resource.

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

    • target string | null

      The target of this webhook.

    • url string(uri) | null

      An absolute URL for this webhook.

POST /v1/Conversations/{ConversationSid}/Webhooks
curl \
 -X POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'Configuration.Filters=string&Configuration.FlowSid=string&Configuration.Method=GET&Configuration.ReplayAfter=42&Configuration.Triggers=string&Configuration.Url=string&Target=webhook'
Request example
{
  "Configuration.Filters": [
    "string"
  ],
  "Configuration.FlowSid": "string",
  "Configuration.Method": "GET",
  "Configuration.ReplayAfter": 42,
  "Configuration.Triggers": [
    "string"
  ],
  "Configuration.Url": "string",
  "Target": "webhook"
}
Request examples
{
  "Configuration.Filters": [
    "string"
  ],
  "Configuration.FlowSid": "string",
  "Configuration.Method": "GET",
  "Configuration.ReplayAfter": 42,
  "Configuration.Triggers": [
    "string"
  ],
  "Configuration.Url": "string",
  "Target": "webhook"
}
Response examples (201)
{
  "account_sid": "string",
  "conversation_sid": "string",
  "date_created": "2023-05-04T09:42:00+00:00",
  "date_updated": "2023-05-04T09:42:00+00:00",
  "sid": "string",
  "target": "string",
  "url": "https://example.com"
}
Response examples (201)
{
  "account_sid": "string",
  "conversation_sid": "string",
  "date_created": "2024-05-04T09:42:00+00:00",
  "date_updated": "2024-05-04T09:42:00+00:00",
  "sid": "string",
  "target": "string",
  "url": "https://example.com"
}