Skip to main content
POST
/
calls
/
{call_control_id}
/
actions
/
enqueue
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const response = await client.calls.actions.enqueue('call_control_id', { queue_name: 'support' });

console.log(response.data);
{
  "data": {
    "result": "ok"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

call_control_id
string
required

Unique identifier and token for controlling the call

Body

application/json

Enqueue call request

queue_name
string
required

The name of the queue the call should be put in. If a queue with a given name doesn't exist yet it will be created.

Example:

"tier_1_support"

client_state
string

Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

Example:

"aGF2ZSBhIG5pY2UgZGF5ID1d"

command_id
string

Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

Example:

"891510ac-f3e4-11e8-af5b-de00688a4901"

max_wait_time_secs
integer

The number of seconds after which the call will be removed from the queue.

Example:

600

max_size
integer
default:100

The maximum number of calls allowed in the queue at a given time. Can't be modified for an existing queue.

Example:

200

keep_after_hangup
boolean
default:false

If set to true, the call will remain in the queue after hangup. In this case bridging to such call will fail with necessary information needed to re-establish the call.

Example:

true

Response

Successful response upon making a call control command.

data
Call Control Command Result · object
Example:
{ "result": "ok" }