Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Service-Scoped Conversation-Scoped Webhook Resource


Service-Scoped Conversation-Scoped Webhooks provide a way to attach a unique monitor, bot, or other integration to each service-scoped Conversation within a non-default Conversation Service.

Each individual service-scoped Conversation can have as many as five such webhooks, as needed for your use case.

Please see the API Reference for the Conversation-Scoped Webhook resource for creating and managing Conversation-Scoped Webhooks within the default Conversation Service.


API Base URL

api-base-url page anchor

All URLs in the reference documentation use the following base URL:


_10
https://conversations.twilio.com/v1

For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:


_10
GET /v1/Services/ISxx/Conversations/CHxx/Messages


Service-Scoped Conversation-Scoped Webhook Properties

service-scoped-conversation-scoped-webhook-properties page anchor
Resource properties
sidtype: SID<WH>Not PII

A 34 character string that uniquely identifies this resource.


chat_service_sidtype: SID<IS>Not PII

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


conversation_sidtype: SID<CH>Not PII

The unique ID of the Conversation(link takes you to an external page) for this webhook.


targettype: stringNot PII

The target of this webhook: webhook, studio, trigger


urltype: string<URI>Not PII

An absolute API resource URL for this webhook.


configurationtype: objectNot PII

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


date_createdtype: string<DATE TIME>Not PII

The date that this resource was created.


date_updatedtype: string<DATE TIME>Not PII

The date that this resource was last updated.


Create a Service-Scoped Conversation-Scoped Webhook resource

create-a-service-scoped-conversation-scoped-webhook-resource page anchor
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks

Parameters

create-parameters page anchor
URI parameters
ChatServiceSidtype: SID<IS>Not PII
Path Parameter

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


ConversationSidtype: stringNot PII
Path Parameter

The unique ID of the Conversation(link takes you to an external page) for this webhook.


Request body parameters
Targettype: enum<STRING>Not PII
Required

The target of this webhook: webhook, studio, trigger

Possible values:
webhooktriggerstudio

Configuration.Urltype: stringNot PII

The absolute url the webhook request should be sent to.


Configuration.Methodtype: enum<STRING>Not PII

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

Possible values:
GETPOST

Configuration.Filterstype: string[]Not PII

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


Configuration.Triggerstype: string[]Not PII

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


Configuration.FlowSidtype: SID<FW>Not PII

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


Configuration.ReplayAftertype: integerNot PII

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

Create a ServiceConversationScopedWebhook

create-a-serviceconversationscopedwebhook page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.webhooks
_12
.create({target: 'webhook'})
_12
.then(webhook => console.log(webhook.sid));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"target": "webhook",
_18
"configuration": {
_18
"url": "https://example.com",
_18
"method": "get",
_18
"filters": [
_18
"onMessageSent",
_18
"onConversationDestroyed"
_18
]
_18
},
_18
"date_created": "2016-03-24T21:05:50Z",
_18
"date_updated": "2016-03-24T21:05:50Z",
_18
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_18
}


Fetch a Service-Scoped Conversation-Scoped Webhook resource

fetch-a-service-scoped-conversation-scoped-webhook-resource page anchor
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks/{Sid}

URI parameters
ChatServiceSidtype: SID<IS>Not PII
Path Parameter

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


ConversationSidtype: stringNot PII
Path Parameter

The unique ID of the Conversation(link takes you to an external page) for this webhook.


Sidtype: SID<WH>Not PII
Path Parameter

A 34 character string that uniquely identifies this resource.

Fetch a ServiceConversationScopedWebhook

fetch-a-serviceconversationscopedwebhook page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.fetch()
_12
.then(webhook => console.log(webhook.sid));

Output

_13
{
_13
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_13
"target": "studio",
_13
"configuration": {
_13
"flow_sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_13
},
_13
"date_created": "2016-03-24T21:05:50Z",
_13
"date_updated": "2016-03-24T21:05:50Z",
_13
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_13
}


Read multiple Service-Scoped Conversation-Scoped Webhook resources

read-multiple-service-scoped-conversation-scoped-webhook-resources page anchor
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks

URI parameters
ChatServiceSidtype: SID<IS>Not PII
Path Parameter

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


ConversationSidtype: stringNot PII
Path Parameter

The unique ID of the Conversation(link takes you to an external page) for this webhook.


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

List multiple ServiceConversationScopedWebhooks

list-multiple-serviceconversationscopedwebhooks page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.webhooks
_12
.list({limit: 20})
_12
.then(webhooks => webhooks.forEach(w => console.log(w.sid)));

Output

_62
{
_62
"meta": {
_62
"page": 0,
_62
"page_size": 5,
_62
"first_page_url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks?PageSize=5&Page=0",
_62
"previous_page_url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks?PageSize=5&Page=0",
_62
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks?PageSize=5&Page=0",
_62
"next_page_url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks?PageSize=5&Page=1",
_62
"key": "webhooks"
_62
},
_62
"webhooks": [
_62
{
_62
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"target": "webhook",
_62
"configuration": {
_62
"url": "https://example.com",
_62
"method": "get",
_62
"filters": [
_62
"onMessageSent",
_62
"onConversationDestroyed"
_62
]
_62
},
_62
"date_created": "2016-03-24T21:05:50Z",
_62
"date_updated": "2016-03-24T21:05:50Z",
_62
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_62
},
_62
{
_62
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"target": "trigger",
_62
"configuration": {
_62
"url": "https://example.com",
_62
"method": "post",
_62
"filters": [
_62
"keyword1",
_62
"keyword2"
_62
]
_62
},
_62
"date_created": "2016-03-24T21:05:50Z",
_62
"date_updated": "2016-03-24T21:05:50Z",
_62
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_62
},
_62
{
_62
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_62
"target": "studio",
_62
"configuration": {
_62
"flow_sid": "FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_62
},
_62
"date_created": "2016-03-24T21:05:50Z",
_62
"date_updated": "2016-03-24T21:05:50Z",
_62
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_62
}
_62
]
_62
}


Update a Service-Scoped Conversation-Scoped Webhook resources

update-a-service-scoped-conversation-scoped-webhook-resources page anchor
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks/{Sid}

URI parameters
ChatServiceSidtype: SID<IS>Not PII
Path Parameter

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


ConversationSidtype: stringNot PII
Path Parameter

The unique ID of the Conversation(link takes you to an external page) for this webhook.


Sidtype: SID<WH>Not PII
Path Parameter

A 34 character string that uniquely identifies this resource.


Request body parameters
Configuration.Urltype: stringNot PII

The absolute url the webhook request should be sent to.


Configuration.Methodtype: enum<STRING>Not PII

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

Possible values:
GETPOST

Configuration.Filterstype: string[]Not PII

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


Configuration.Triggerstype: string[]Not PII

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


Configuration.FlowSidtype: SID<FW>Not PII

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

Update a ServiceConversationScopedWebhook

update-a-serviceconversationscopedwebhook page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.update({'configuration.url': 'configuration.url'})
_12
.then(webhook => console.log(webhook.sid));

Output

_18
{
_18
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"chat_service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"sid": "WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_18
"target": "trigger",
_18
"configuration": {
_18
"url": "https://example.com",
_18
"method": "post",
_18
"filters": [
_18
"keyword1",
_18
"keyword2"
_18
]
_18
},
_18
"date_created": "2016-03-24T21:05:50Z",
_18
"date_updated": "2016-03-24T21:05:51Z",
_18
"url": "https://conversations.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks/WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_18
}


Delete a Service-Scoped, Conversation-Scoped Webhook resource

delete-a-service-scoped-conversation-scoped-webhook-resource page anchor
DELETE https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Webhooks/{Sid}

URI parameters
ChatServiceSidtype: SID<IS>Not PII
Path Parameter

The SID of the Conversation Service(link takes you to an external page) the Participant resource is associated with.


ConversationSidtype: stringNot PII
Path Parameter

The unique ID of the Conversation(link takes you to an external page) for this webhook.


Sidtype: SID<WH>Not PII
Path Parameter

A 34 character string that uniquely identifies this resource.

Delete a ServiceConversationScopedWebhook

delete-a-serviceconversationscopedwebhook page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.conversations.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.remove();


Rate this page: