Invite an Agent or a TaskQueue to a Channel.

POST /v1/Interactions/{InteractionSid}/Channels/{ChannelSid}/Invites

Invite an Agent or a TaskQueue to a Channel.

Path parameters

  • InteractionSid string Required

    The Interaction SID for this Channel.

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

  • ChannelSid string Required

    The Channel SID for this Invite.

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

application/x-www-form-urlencoded

Body

  • Routing Required

    The Interaction's routing logic.

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

      The unique string created by Twilio to identify an Interaction Channel Invite resource.

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

    • interaction_sid string | null

      The Interaction SID for this Channel.

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

    • channel_sid string | null

      The Channel SID for this Invite.

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

    • routing

      A JSON object representing the routing rules for the Interaction Channel. See Outbound SMS Example for an example Routing object. The Interactions resource uses TaskRouter for all routing functionality. All attributes in the Routing object on your Interaction request body are added “as is” to the task. For a list of known attributes consumed by the Flex UI and/or Flex Insights, see Known Task Attributes.

    • url string(uri) | null
POST /v1/Interactions/{InteractionSid}/Channels/{ChannelSid}/Invites
curl \
 --request POST 'https://flex-api.twilio.com/v1/Interactions/{InteractionSid}/Channels/{ChannelSid}/Invites' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Routing=%7B%22properties%22%3A%7B%22workspace_sid%22%3A%22WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22workflow_sid%22%3A%22WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22worker_sid%22%3A%22WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22queue_sid%22%3A%22WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%22%2C%22attributes%22%3A%7B%22customerName%22%3A%22customer+name%22%2C%22customerAddress%22%3A%22customer+email+address%22%7D%7D%7D'
Request example
{"Routing"=>"{\"properties\":{\"workspace_sid\":\"WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"workflow_sid\":\"WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"worker_sid\":\"WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"queue_sid\":\"WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"attributes\":{\"customerName\":\"customer name\",\"customerAddress\":\"customer email address\"}}}"}
Response examples (201)
{
  "sid": "KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://flex-api.twilio.com/v1/Interactions/KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "routing": {
    "properties": {
      "age": 0,
      "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "addons": "{}",
      "reason": "",
      "timeout": 86400,
      "priority": 0,
      "queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "attributes": "{\"customerAddress\":\"customer phone address\",\"flexChannelInviteSid\":\"KGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"conversationSid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"channelType\":\"sms\",\"customers\":{\"phone\":\"customer phone address\",\"name\":\"customer name\"},\"conversations\":{\"conversation_id\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"media\":[{\"type\":\"ChatTranscript\",\"sid\":\"CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}]},\"customerName\":\"customer name\",\"flexInteractionChannelSid\":\"UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"flexInteractionSid\":\"KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}",
      "queue_name": "Sample Queue",
      "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "age_in_queue": 0,
      "date_created": 1634845217,
      "date_updated": 1634845217,
      "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "workflow_name": "Default Fifo Workflow",
      "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "routing_target": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "assignmentCounter": 0,
      "assignment_status": "pending",
      "task_queue_entered_date": 1634845217,
      "task_channel_unique_name": "default"
    },
    "reservation": null
  },
  "channel_sid": "UOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "interaction_sid": "KDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}