> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# queueLeave

> Remove a call from a queue.

[calling-call-queue]: /docs/server-sdks/reference/typescript/relay/call#events

[call-events]: /docs/server-sdks/reference/typescript/relay/call#events

Remove the call from a queue.

This method emits [`calling.call.queue`][calling-call-queue] events. See [Call Events][call-events] for payload details.

## **Parameters**

**`queueName`** `string` — required

Name of the queue to leave.

---

**`controlId`** `string | undefined`

Custom control ID. Auto-generated if not provided.

---

**`queueId`** `string | undefined`

Specific queue ID to leave (if the call is in multiple queues with the
same name).

---

**`statusUrl`** `string | undefined`

URL to receive queue status webhooks.

---

## **Returns**

`Promise<Record<string, unknown>>` -- Server response confirming the call left the queue.

## **Example**

```typescript {17}
import { RelayClient } from '@signalwire/sdk';

const client = new RelayClient({
  project: process.env.SIGNALWIRE_PROJECT_ID!,
  token: process.env.SIGNALWIRE_API_TOKEN!,
  contexts: ['default']
});

client.onCall(async (call) => {
  await call.answer();

  // Enter the queue
  await call.queueEnter('support');

  // Remove from queue after a timeout
  await new Promise((resolve) => setTimeout(resolve, 300_000)); // 5 minute max wait
  await call.queueLeave('support');
  await call.play([{ type: 'tts', text: 'No agents available. Please try again later.' }]);
  await call.hangup();
});

await client.run();
```