# Queue

The emergencies waiting for a call taker, and when a wait is too long.

## Get the Queue

Returns the calls and texts waiting for an answer, and the abandoned and cut-off calls nobody has called back.

| Method | Path |
| --- | --- |
| GET | `/api/v1/queue` |

A request marks its user online for 45 seconds.

### Query Parameters

| Name | Description |
| --- | --- |
| `version` | The `version` the client has. |
| `wait` | Seconds, 0 to 30, to wait for a change when `version` is the current version. On timeout, the queue returns unchanged. Default: `0`. |

### Response Fields

| Field | Type | Description |
| --- | --- | --- |
| `version` | integer | Changes whenever the queue may have changed. |
| `now` | string | Time of the server. |
| `warning_after_seconds` | integer | See [Update the Queue Settings](<#update-the-queue-settings>). |
| `available` | integer | Call takers online and available. |
| `items` | array | Ringing calls and unanswered texts, oldest first. |
| `abandoned` | array | The latest abandoned or cut-off call of each caller of an open incident, until a call or a text is placed to that caller, or a later call from them is answered. Oldest first. |
| `items[].kind` | string | `call` or `text`. `abandoned` or `cut_off` in `abandoned`. |
| `items[].incident_id` | string | The ID of the [incident](<https://docs.ellanetworks.com/psap/reference/api/incidents/index.md>). |
| `items[].call_id` | integer | The ringing, abandoned or cut-off [call](<https://docs.ellanetworks.com/psap/reference/api/calls/index.md>). `null` for a text. |
| `items[].text_id` | integer | The first [text](<https://docs.ellanetworks.com/psap/reference/api/texts/index.md>) of the conversation. `null` for a call. |
| `items[].number` | string | The caller. |
| `items[].service` | string | The service URN of a call, or the emergency number of a text. |
| `items[].text` | string | The first 160 characters of the first text. |
| `items[].located` | boolean | The call came with a location. |
| `items[].waiting_since` | string | When the call arrived, the first text arrived, or the call was abandoned or ended. |

`abandoned[]` has the same fields as `items[]`.

### Sample Response

```
{
    "result": {
        "version": 42,
        "now": "2026-12-01T12:00:12.000Z",
        "warning_after_seconds": 15,
        "available": 2,
        "items": [
            {
                "kind": "call",
                "incident_id": "urn:emergency:uid:incidentid:01M8Y7C5PM7FKCY9P1VEKRJMB1:psap.example.org",
                "call_id": 12,
                "text_id": null,
                "number": "+15551230001",
                "service": "urn:service:sos",
                "text": "",
                "located": true,
                "waiting_since": "2026-12-01T12:00:04.000Z"
            }
        ],
        "abandoned": []
    }
}
```

## Get the Queue Settings

Returns when a waiting emergency is waiting too long.

| Method | Path |
| --- | --- |
| GET | `/api/v1/queue/settings` |

### Response Fields

| Field | Type | Description |
| --- | --- | --- |
| `warning_after_seconds` | integer | Seconds after which a waiting emergency is waiting too long. Default: `15`, the NENA-STA-020.2 answer target. |

### Sample Response

```
{
    "result": {
        "warning_after_seconds": 15
    }
}
```

## Update the Queue Settings

Sets when a waiting emergency is waiting too long.

| Method | Path |
| --- | --- |
| PUT | `/api/v1/queue/settings` |

### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `warning_after_seconds` | integer | Yes | From 5 to 300. |

### Sample Request

```
{
    "warning_after_seconds": 20
}
```

### Sample Response

```
{
    "result": {
        "warning_after_seconds": 20
    }
}
```
