Create a queue

POST /2010-04-01/Accounts/{AccountSid}/Queues.json

Queues of calls

Create a queue

Path parameters

  • AccountSid string Required

    The SID of the Account that will create the resource.

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

application/x-www-form-urlencoded

Body

  • FriendlyName string Required

    A descriptive string that you created to describe this resource. It can be up to 64 characters long.

  • MaxSize integer

    The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000.

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
    • date_updated string(date-time-rfc-2822) | null

      The date and time in GMT that this resource was last updated, specified in RFC 2822 format.

    • current_size integer

      The number of calls currently in the queue.

      Default value is 0.

    • friendly_name string | null

      A string that you assigned to describe this resource.

    • uri string | null

      The URI of this resource, relative to https://api.twilio.com.

    • account_sid string | null

      The SID of the Account that created this Queue resource.

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

    • average_wait_time integer

      The average wait time in seconds of the members in this queue. This is calculated at the time of the request.

      Default value is 0.

    • sid string | null

      The unique string that that we created to identify this Queue resource.

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

    • date_created string(date-time-rfc-2822) | null

      The date and time in GMT that this resource was created specified in RFC 2822 format.

    • max_size integer

      The maximum number of calls that can be in the queue. The default is 1000 and the maximum is 5000.

      Default value is 0.

POST /2010-04-01/Accounts/{AccountSid}/Queues.json
curl \
 --request POST 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Queues.json' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'MaxSize=1&FriendlyName=friendly_name'
Request example
{"MaxSize"=>1, "FriendlyName"=>"friendly_name"}
Response examples (201)
{
  "sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",
  "max_size": 100,
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "current_size": 0,
  "date_created": "Tue, 04 Aug 2015 18:39:09 +0000",
  "date_updated": "Tue, 04 Aug 2015 18:39:09 +0000",
  "friendly_name": "0.361280134646222",
  "subresource_uris": {
    "members": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json"
  },
  "average_wait_time": 0
}