Verbs

<Enqueue>

Place the caller into a named waiting queue.

Element body

The queue name (required). The queue is created on demand if it does not already exist.

Example

<Response>
  <Say>Placing you in the support queue.</Say>
  <Enqueue waitUrl="https://app.example.com/queue-hold"
           action="https://app.example.com/queue-exit">support</Enqueue>
</Response>

Attributes

Attribute Default Behaviour
action unset URL posted once when the call exits the queue — dequeued to an agent, left via <Leave>, or the caller hung up. The returned VoiceML replaces the rest of the original document. When empty, execution continues with the next verb after <Enqueue>.
method POST HTTP method for the action request: POST or GET.
waitUrl default hold playlist A VoiceML URL fetched in a loop while the caller waits, re-fetched with fresh queue-position parameters so position announcements work. Three states: absent plays the platform default hold playlist (fetched with GET); set to an empty string plays silence; set to a URL fetches it with waitUrlMethod.
waitUrlMethod POST HTTP method used to fetch the wait URL: POST or GET.
maxSize 0 (unlimited) VoiceML extension. Caps the queue size at creation time; when the cap is reached, <Enqueue> is rejected with a 503. Negative values are rejected.

Callbacks

action request

Field Description
CallSid Unique identifier of the queued call.
QueueSid Unique identifier of the queue.
QueueResult Why the call left the queue: bridged, hangup, leave, redirected, error, or system-error.
QueueTime How long the caller waited.

waitUrl request

Field Description
CallSid Unique identifier of the waiting call.
QueueSid Unique identifier of the queue.
QueuePosition The caller's current 1-based position; 1 is the front.
QueueTime How long this caller has been waiting.
AvgQueueTime Average wait over dequeue exits in the trailing 5-minute window; 0 when there are no recent exits.
CurrentQueueSize Number of callers currently waiting.
MaxQueueSize The queue's configured size cap; 0 when uncapped.

Every callback also carries the standard call parameters (CallSid, AccountSid, From, To, CallStatus) and is signed with your account's API key.

Notes

  • The wait URL's returned document executes on the waiting caller's leg each iteration; a <Leave> inside it exits the queue.
  • workflowSid is not supported — setting it returns an error.
  • Queues are isolated per account: two accounts using the same queue name get independent queues, and cross-account access returns 404.
  • Queues live in process memory: a platform restart drops waiting members, whose action URLs fire with QueueResult=system-error.