> ## Documentation Index
> Fetch the complete documentation index at: https://ringq.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Control

> Make, divert, transfer, drop, and pick up calls on your RingQ PBX.

## Make Call

Performs the makeCall action when a call is ringing on a specified extension. Requires both an agent extension and a pickup extension.

**`POST /api/values/makeCall`**

### Parameters

| Parameter         | Type   | Required | Description                         |
| ----------------- | ------ | -------- | ----------------------------------- |
| `action`          | string | ✓        | `"makeCall"`                        |
| `agentextension`  | string | ✓        | The extension with the ringing call |
| `pickupextension` | string | ✓        | The extension to pick up the call   |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/makeCall" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "makeCall",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "uuid": "ebe5a7ae-803b-427f-bcda-b25bc9bb20a1",
  "result": "Content-Type: api/response"
}
```

***

## Divert Call

Redirects a ringing call to another extension.

**`POST /api/values/divertCallByExtension`**

### Parameters

| Parameter         | Type   | Required | Description                         |
| ----------------- | ------ | -------- | ----------------------------------- |
| `action`          | string | ✓        | `"divertCallByExtension"`           |
| `agentextension`  | string | ✓        | The extension with the ringing call |
| `pickupextension` | string | ✓        | The extension to divert the call to |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/divertCallByExtension" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "divertCallByExtension",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "ringing_extension": "1013",
  "diverted_to": "1160",
  "uuid": "4a7b0547-a5b9-45a8-9c72-06548db8f8f3"
}
```

***

## Divert Call to Voicemail

Diverts a ringing call directly to the specified extension's voicemail box.

**`POST /api/values/divertCallToVoicemail`**

### Parameters

| Parameter         | Type   | Required | Description                                     |
| ----------------- | ------ | -------- | ----------------------------------------------- |
| `action`          | string | ✓        | `"divertCallToVoicemail"`                       |
| `agentextension`  | string | ✓        | The extension with the ringing call             |
| `pickupextension` | string | ✓        | The extension whose voicemail receives the call |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/divertCallToVoicemail" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "divertCallToVoicemail",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "ringing_extension": "1013",
  "diverted_to": "1160",
  "uuid": "9a51bd63-e5d8-4b6d-8ac5-c64e22231756"
}
```

***

## Drop Call

Terminates an active or ringing call on the specified agent extension.

**`POST /api/values/dropCall`**

### Parameters

| Parameter         | Type   | Required | Description                      |
| ----------------- | ------ | -------- | -------------------------------- |
| `action`          | string | ✓        | `"dropCall"`                     |
| `agentextension`  | string | ✓        | The extension whose call to drop |
| `pickupextension` | string | ✓        | The other party's extension      |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/dropCall" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "dropCall",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "extension": "1013",
  "uuid": "412b201b-826c-4357-bcce-8ae9c4959602",
  "message": "Call dropped successfully"
}
```

***

## Transfer Call

Transfers an active call from one extension to another within the RingQ PBX.

**`POST /api/values/transferCall`**

### Parameters

| Parameter         | Type   | Required | Description                           |
| ----------------- | ------ | -------- | ------------------------------------- |
| `action`          | string | ✓        | `"transferCall"`                      |
| `agentextension`  | string | ✓        | The extension currently on the call   |
| `pickupextension` | string | ✓        | The extension to transfer the call to |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/transferCall" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "transferCall",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "from_extension": "1013",
  "transferred_to": "1160",
  "uuid": "b5718047-d50b-4c67-9024-98a625786220"
}
```

***

## Pickup Call

Allows a specified extension to pick up a call that is currently ringing on another extension.

**`POST /api/values/pickupCallByExtension`**

### Parameters

| Parameter         | Type   | Required | Description                              |
| ----------------- | ------ | -------- | ---------------------------------------- |
| `action`          | string | ✓        | `"pickupCallByExtension"`                |
| `agentextension`  | string | ✓        | The extension where the call is ringing  |
| `pickupextension` | string | ✓        | The extension that will pick up the call |

### Example

```bash theme={null}
curl -X POST "http://<ringq-fqdn>:8443/api/values/pickupCallByExtension" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: <API_KEY>" \
  -H "X-Secret-Key: <SECRET_KEY>" \
  -d '{
    "action": "pickupCallByExtension",
    "agentextension": "101",
    "pickupextension": "102"
  }'
```

### Response

```json theme={null}
{
  "status": "success",
  "ringing_extension": "1013",
  "picked_by": "1160",
  "ringing_uuid": "082b3034-7e7c-4205-bb2e-513704799241"
}
```
