Skip to contentSkip to navigationSkip to topbar
On this page

Configuration Resource


The Twilio Conversations' Configuration resource represents settings applied at the account level, across all Conversation Services.


Configuration Properties

configuration-properties page anchor
Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>Optional
Not PII

The SID of the Account responsible for this configuration.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

default_chat_service_sidSID<IS>Optional

The SID of the default Conversation Service used when creating a conversation.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

default_messaging_service_sidSID<MG>Optional

The SID of the default Messaging Service used when creating a conversation.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

default_inactive_timerstringOptional

Default ISO8601 duration when conversation will be switched to inactive state. Minimum value for this timer is 1 minute.


default_closed_timerstringOptional

Default ISO8601 duration when conversation will be switched to closed state. Minimum value for this timer is 10 minutes.


urlstring<uri>Optional

An absolute API resource URL for this global configuration.


linksobject<uri-map>Optional

Contains absolute API resource URLs to access the webhook and default service configurations.


Fetch a Configuration resource

fetch-a-configuration-resource page anchor
GET https://conversations.twilio.com/v1/Configuration

Fetch a ConfigurationLink to code sample: Fetch a Configuration
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchConfiguration() {
11
const configuration = await client.conversations.v1.configuration().fetch();
12
13
console.log(configuration.accountSid);
14
}
15
16
fetchConfiguration();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"default_inactive_timer": "PT1M",
6
"default_closed_timer": "PT10M",
7
"url": "https://conversations.twilio.com/v1/Configuration",
8
"links": {
9
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
10
"webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
11
}
12
}

Update a Configuration resource

update-a-configuration-resource page anchor
POST https://conversations.twilio.com/v1/Configuration

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
DefaultChatServiceSidSID<IS>Optional

The SID of the default Conversation Service to use when creating a conversation.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

DefaultMessagingServiceSidSID<MG>Optional

The SID of the default Messaging Service to use when creating a conversation.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

DefaultInactiveTimerstringOptional

Default ISO8601 duration when conversation will be switched to inactive state. Minimum value for this timer is 1 minute.


DefaultClosedTimerstringOptional

Default ISO8601 duration when conversation will be switched to closed state. Minimum value for this timer is 10 minutes.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateConfiguration() {
11
const configuration = await client.conversations.v1
12
.configuration()
13
.update({ defaultChatServiceSid: "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" });
14
15
console.log(configuration.accountSid);
16
}
17
18
updateConfiguration();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"default_chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"default_messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"default_inactive_timer": "PT1M",
6
"default_closed_timer": "PT10M",
7
"url": "https://conversations.twilio.com/v1/Configuration",
8
"links": {
9
"service": "https://conversations.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Configuration",
10
"webhooks": "https://conversations.twilio.com/v1/Configuration/Webhooks"
11
}
12
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.