Create a new webhook scoped to the conversation

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://twilio.demo.bump-doc.com/doc/conversations/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
"Conversations MCP server": {
  "url": "https://twilio.demo.bump-doc.com/doc/conversations/mcp"
}
Close
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

  • ConversationSid string Required

    The unique ID of the Conversation for this webhook.

application/x-www-form-urlencoded

Body

  • Target string Required

    The target of this webhook: webhook, studio, trigger

    Values are webhook, trigger, or studio.

  • Configuration.Url string

    The absolute url the webhook request should be sent to.

  • Configuration.Method string

    Values are get or post.

  • Configuration.Filters array[string]

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

  • Configuration.Triggers array[string]

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

  • Configuration.FlowSid string

    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}$.

  • Configuration.ReplayAfter integer

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

Responses

  • 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
    • 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}$.

    • 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}$.

    • 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}$.

    • target string | null

      The target of this webhook: webhook, studio, trigger

    • url string(uri) | null

      An absolute API resource URL for this webhook.

    • configuration

      The configuration of this webhook. Is defined based on target.

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

POST /v1/Conversations/{ConversationSid}/Webhooks
curl \
 --request POST 'https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Webhooks' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Target=webhook&Configuration.Url=https%3A%2F%2Fexample.com&Configuration.Method=get&Configuration.Filters=onMessageSent&Configuration.Filters=onConversationDestroyed&Configuration.ReplayAfter=7'
Request example
{"Target" => "webhook", "Configuration.Url" => "https://example.com", "Configuration.Method" => "get", "Configuration.Filters" => ["onMessageSent", "onConversationDestroyed"], "Configuration.ReplayAfter" => 7}
Response examples (201)
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "sid": "WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "target": "webhook",
  "configuration": {
    "url": "https://example.com",
    "method": "get",
    "filters": [
      "onMessageSent",
      "onConversationDestroyed"
    ]
  },
  "date_created": "2016-03-24T21:05:50Z",
  "date_updated": "2016-03-24T21:05:50Z",
  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}