Queue Commands

Queue commands operations

Retrieve a call queue

Retrieve an existing call queue

SecuritybearerAuth
Request
path Parameters
queue_name
required
string

Uniquely identifies the queue by name

Responses
200

Successful response with details about a queue.

Response Schema: application/json
object (Queue)
record_type
required
string
Value: "queue"
id
required
string

Uniquely identifies the queue

name
required
string

Name of the queue

created_at
required
string

ISO 8601 formatted date of when the queue was created

updated_at
required
string

ISO 8601 formatted date of when the queue was last updated

current_size
required
integer

The number of calls currently in the queue

max_size
required
integer

The maximum number of calls allowed in the queue

average_wait_time_secs
required
integer

The average time that the calls currently in the queue have spent waiting, given in seconds.

404

Conference does not exist

get/queues/{queue_name}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Queue.retrieve("queue_name")import telnyx
telnyx.api_key = "YOUR_API_KEY"

telnyx.Queue.retrieve("queue_name")
Response samples
application/json
{
  • "data": {
    • "record_type": "queue",
    • "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    • "name": "support",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "updated_at": "2019-01-23T18:10:02.574Z",
    • "current_size": 20,
    • "max_size": 50,
    • "average_wait_time_secs": 175
    }
}

Retrieve calls from a queue

Retrieve the list of calls in an existing queue

SecuritybearerAuth
Request
path Parameters
queue_name
required
string

Uniquely identifies the queue by name

query Parameters
page[number]
integer >= 1
Default: 1

The page number to load

page[size]
integer [ 1 .. 250 ]
Default: 20

The size of the page

Responses
200

Successful response with a list of calls in a queue.

Response Schema: application/json
Array of objects (QueueCall)
object (PaginationMeta)
404

Conference does not exist

get/queues/{queue_name}/calls
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

queue = telnyx.Queue.retrieve("tier_1_support_queue")
queue_calls = queue.list_calls()
Response samples
application/json
{
  • "data": [
    • {
      • "call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
      • "call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
      • "call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
      • "record_type": "queue_call",
      • "connection_id": "7267xxxxxxxxxxxxxx",
      • "from": "+18005550101",
      • "to": "+18005550102",
      • "enqueued_at": "2019-01-23T18:10:02.574Z",
      • "wait_time_secs": 145,
      • "queue_position": 3,
      • "queue_id": "ae1626cc-6f42-11ea-becd-02420a0f8b69"
      }
    ],
  • "meta": {
    • "total_pages": 3,
    • "total_results": 55,
    • "page_number": 2,
    • "page_size": 25
    }
}

Retrieve a call from a queue

Retrieve an existing call from an existing queue

SecuritybearerAuth
Request
path Parameters
queue_name
required
string

Uniquely identifies the queue by name

call_control_id
required
string

Unique identifier and token for controlling the call

Responses
200

Successful response with details about a call in a queue.

Response Schema: application/json
object (QueueCall)
record_type
required
string
Value: "queue_call"
call_session_id
required
string

ID that is unique to the call session and can be used to correlate webhook events. Call session is a group of related call legs that logically belong to the same phone call, e.g. an inbound and outbound leg of a transferred call

call_leg_id
required
string

ID that is unique to the call and can be used to correlate webhook events

call_control_id
required
string

Unique identifier and token for controlling the call.

connection_id
required
string

Call Control App ID (formerly Telnyx connection ID) used in the call.

from
required
string

Number or SIP URI placing the call.

to
required
string

Destination number or SIP URI of the call.

enqueued_at
required
string

ISO 8601 formatted date of when the call was put in the queue

wait_time_secs
required
integer

The time the call has been waiting in the queue, given in seconds

queue_position
required
integer

Current position of the call in the queue

queue_id
required
string

Unique identifier of the queue the call is in.

404

Conference does not exist

get/queues/{queue_name}/calls/{call_control_id}
Request samples
import telnyx
telnyx.api_key = "YOUR_API_KEY"

queue = telnyx.Queue.retrieve("tier_1_support_queue")
queue_call = queue.retrieve_call(call_control_id)
Response samples
application/json
{
  • "data": {
    • "call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
    • "call_leg_id": "2dc6fc34-f9e0-11ea-b68e-02420a0f7768",
    • "call_session_id": "2dc1b3c8-f9e0-11ea-bc5a-02420a0f7768",
    • "record_type": "queue_call",
    • "connection_id": "7267xxxxxxxxxxxxxx",
    • "from": "+18005550101",
    • "to": "+18005550102",
    • "enqueued_at": "2019-01-23T18:10:02.574Z",
    • "wait_time_secs": 145,
    • "queue_position": 3,
    • "queue_id": "ae1626cc-6f42-11ea-becd-02420a0f8b69"
    }
}