Create a new conversation in your account's default service
A Conversation resource represents an omnichannel group conversation with an ordered list of messages and a participant roster.
Create a new conversation in your account's default service
Body
-
The human-readable name of this conversation, limited to 256 characters. Optional.
-
An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's
sid
in the URL. -
The date that this resource was created.
-
The date that this resource was last updated.
-
The unique ID of the Messaging Service this conversation belongs to.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^MG[0-9a-fA-F]{32}$
. -
An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.
-
Current state of this conversation. Can be either
initializing
,active
,inactive
orclosed
and defaults toactive
Values are
inactive
,active
, orclosed
. -
ISO8601 duration when conversation will be switched to
inactive
state. Minimum value for this timer is 1 minute. -
ISO8601 duration when conversation will be switched to
closed
state. Minimum value for this timer is 10 minutes. -
The default email address that will be used when sending outbound emails in this conversation.
-
The default name that will be used when sending outbound emails in this conversation.
curl \
--request POST 'https://conversations.twilio.com/v1/Conversations' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--header "X-Twilio-Webhook-Enabled: true" \
--data 'State=inactive&Attributes=%7B+%22topic%22%3A+%22feedback%22+%7D&UniqueName=unique_name&DateCreated=2015-12-16T22%3A18%3A37Z&DateUpdated=2015-12-16T22%3A18%3A38Z&FriendlyName=friendly_name&Timers.Closed=PT10M&Timers.Inactive=PT1M&MessagingServiceSid=MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
{"State"=>"inactive", "Attributes"=>"{ \"topic\": \"feedback\" }", "UniqueName"=>"unique_name", "DateCreated"=>"2015-12-16T22:18:37Z", "DateUpdated"=>"2015-12-16T22:18:38Z", "FriendlyName"=>"friendly_name", "Timers.Closed"=>"PT10M", "Timers.Inactive"=>"PT1M", "MessagingServiceSid"=>"MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"State"=>"active", "DateCreated"=>"2020-07-01T22:18:37Z", "DateUpdated"=>"2020-07-01T22:18:37Z", "FriendlyName"=>"friendly_name", "MessagingServiceSid"=>"MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"DateCreated"=>"2020-07-01T22:18:37Z", "DateUpdated"=>"2020-07-01T22:18:37Z", "FriendlyName"=>"friendly_name", "Bindings.Email.Name"=>"Example", "Bindings.Email.Address"=>"example@example.com"}
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"export": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export",
"messages": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
"webhooks": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks",
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
},
"state": "inactive",
"timers": {
"date_closed": "2015-12-16T22:28:38Z",
"date_inactive": "2015-12-16T22:19:38Z"
},
"bindings": {},
"attributes": "{ \"topic\": \"feedback\" }",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"unique_name": "unique_name",
"date_created": "2015-12-16T22:18:37Z",
"date_updated": "2015-12-16T22:18:38Z",
"friendly_name": "friendly_name",
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"export": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export",
"messages": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
"webhooks": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks",
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
},
"state": "active",
"timers": {},
"bindings": {},
"attributes": "{}",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"unique_name": null,
"date_created": "2020-07-01T22:18:37Z",
"date_updated": "2020-07-01T22:18:37Z",
"friendly_name": "friendly_name",
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
{
"sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"export": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export",
"messages": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
"webhooks": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks",
"participants": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
},
"state": "active",
"timers": {},
"bindings": {
"email": {
"name": "example",
"projected_address": "example+123@example.com"
}
},
"attributes": "{}",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"unique_name": null,
"date_created": "2020-07-01T22:18:37Z",
"date_updated": "2020-07-01T22:18:37Z",
"friendly_name": "friendly_name",
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}