Create web channel

POST /v2/WebChats

Headers

  • Ui-Version string

    The Ui-Version HTTP request header

application/x-www-form-urlencoded

Body

  • AddressSid string Required

    The SID of the Conversations Address. See Address Configuration Resource for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration.

  • ChatFriendlyName string

    The Conversation's friendly name. See the Conversation resource for an example.

  • CustomerFriendlyName string

    The Conversation participant's friendly name. See the Conversation Participant Resource for an example.

  • PreEngagementData string

    The pre-engagement data.

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
    • conversation_sid string | null

      The unique string representing the Conversation resource created.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^CH[0-9a-fA-F]{32}$.

    • identity string | null

      The unique string representing the User created and should be authorized to participate in the Conversation. For more details, see User Identity & Access Tokens.

POST /v2/WebChats
curl \
 --request POST 'https://flex-api.twilio.com/v2/WebChats' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --header "Ui-Version: string" \
 --data 'AddressSid=IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ChatFriendlyName=LoquaciousLarry&CustomerFriendlyName=LarryDavid'
Request example
{"AddressSid"=>"IGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ChatFriendlyName"=>"LoquaciousLarry", "CustomerFriendlyName"=>"LarryDavid"}
Response examples (201)
{
  "identity": "seinfeld",
  "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}