Menu

Expand
Rate this page:

Service-Scoped Conversation Resource

A Service-scoped Conversation is a unique thread of a conversation that is scoped or limited to a specific, non-default Conversation Service.

Please see the Conversation Resource for Conversations within the default Conversation Service instance.

API Base URL

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

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:

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

Service-Scoped Conversation Properties

Resource Properties in REST API format
account_sid
sid<AC> Not PII

The unique ID of the Account responsible for this conversation.

chat_service_sid
sid<IS> Not PII

The unique ID of the Conversation Service this conversation belongs to.

messaging_service_sid
sid<MG> Not PII

The unique ID of the Messaging Service this conversation belongs to.

sid
sid<CH> Not PII

A 34 character string that uniquely identifies this resource.

friendly_name

The human-readable name of this conversation, limited to 256 characters. Optional.

unique_name

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.

attributes

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.

state
enum:state Not PII

Current state of this conversation. Can be either active, inactive or closed and defaults to active

date_created
date_time<iso8601> Not PII

The date that this resource was created.

date_updated
date_time<iso8601> Not PII

The date that this resource was last updated.

timers
object Not PII

Timer date values representing state update for this conversation.

url
url Not PII

An absolute API resource URL for this conversation.

links
uri_map Not PII

Contains absolute URLs to access the participants, messages and webhooks of this conversation.

bindings
object Not PII

Create a Service-Scoped Conversation

post
https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations
Parameters
Parameters in REST API format
chat_service_sid
Path
post sid<IS> Not PII

The SID of the Conversation Service the Conversation resource is associated with.

friendly_name
Optional
post string PII MTL: 30 DAYS

The human-readable name of this conversation, limited to 256 characters. Optional.

unique_name
Optional
post string PII MTL: 30 DAYS

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.

attributes
Optional
post string PII MTL: 30 DAYS

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.

messaging_service_sid
Optional
post sid<MG> Not PII

The unique ID of the Messaging Service this conversation belongs to.

date_created
Optional
post date_time<iso8601> Not PII

The date that this resource was created.

date_updated
Optional
post date_time<iso8601> Not PII

The date that this resource was last updated.

state
Optional
post ienum:state Not PII

Current state of this conversation. Can be either active, inactive or closed and defaults to active

timers.inactive
Optional
post string Not PII

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

timers.closed
Optional
post string Not PII

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

x_twilio_webhook_enabled
Header
post ienum:webhook_enabled_type Not PII

The X-Twilio-Webhook-Enabled HTTP request header

Example 1
Loading Code Sample...
        
        

        Create Conversation

        Fetch a Service-Scoped Conversation

        get
        https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{Sid}
        Parameters
        Parameters in REST API format
        chat_service_sid
        Path
        get sid<IS> Not PII

        The SID of the Conversation Service the Conversation resource is associated with.

        sid
        Path
        get sid_like<CH> Not PII

        A 34 character string that uniquely identifies this resource. Can also be the unique_name of the Conversation.

        Example 1
        Loading Code Sample...
              
              

              Fetch Conversation

              Read multiple Service-Scoped Conversation resources

              get
              https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations
              Parameters
              Parameters in REST API format
              chat_service_sid
              Path
              get sid<IS> Not PII

              The SID of the Conversation Service the Conversation resource is associated with.

              start_date
              Optional
              get string Not PII

              Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters.

              end_date
              Optional
              get string Not PII

              End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters.

              state
              Optional
              get ienum:state Not PII

              State for sorting and filtering list of Conversations. Can be active, inactive or closed

              Example 1
              Loading Code Sample...
                    
                    

                    Read Conversation

                    Update a Service-Scoped Conversation resource

                    post
                    https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{Sid}
                    Parameters
                    Parameters in REST API format
                    chat_service_sid
                    Path
                    post sid<IS> Not PII

                    The SID of the Conversation Service the Conversation resource is associated with.

                    sid
                    Path
                    post sid_like<CH> Not PII

                    A 34 character string that uniquely identifies this resource. Can also be the unique_name of the Conversation.

                    friendly_name
                    Optional
                    post string PII MTL: 30 DAYS

                    The human-readable name of this conversation, limited to 256 characters. Optional.

                    date_created
                    Optional
                    post date_time<iso8601> Not PII

                    The date that this resource was created.

                    date_updated
                    Optional
                    post date_time<iso8601> Not PII

                    The date that this resource was last updated.

                    attributes
                    Optional
                    post string PII MTL: 30 DAYS

                    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.

                    messaging_service_sid
                    Optional
                    post sid<MG> Not PII

                    The unique ID of the Messaging Service this conversation belongs to.

                    state
                    Optional
                    post ienum:state Not PII

                    Current state of this conversation. Can be either active, inactive or closed and defaults to active

                    timers.inactive
                    Optional
                    post string Not PII

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

                    timers.closed
                    Optional
                    post string Not PII

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

                    unique_name
                    Optional
                    post string PII MTL: 30 DAYS

                    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.

                    x_twilio_webhook_enabled
                    Header
                    post ienum:webhook_enabled_type Not PII

                    The X-Twilio-Webhook-Enabled HTTP request header

                    Example 1
                    Loading Code Sample...
                          
                          

                          Update Conversation

                          Delete a Service-Scoped Conversation

                          delete
                          https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{Sid}
                          Parameters
                          Parameters in REST API format
                          chat_service_sid
                          Path
                          delete sid<IS> Not PII

                          The SID of the Conversation Service the Conversation resource is associated with.

                          sid
                          Path
                          delete sid_like<CH> Not PII

                          A 34 character string that uniquely identifies this resource. Can also be the unique_name of the Conversation.

                          x_twilio_webhook_enabled
                          Header
                          delete ienum:webhook_enabled_type Not PII

                          The X-Twilio-Webhook-Enabled HTTP request header

                          Example 1
                          Loading Code Sample...
                                
                                

                                Delete Conversation

                                Rate this page:

                                Need some help?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif