# List connections

`GET https://api.morevoice.ai/v1/connections`

Lists your SIP connections, oldest first, with their registration status and the calls on them now. Passwords are never returned. Live mode only: a test key answers `403` with the code `live_only`.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `connections_list`.

## Parameters

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `integer` | no | How many objects to return, 1–100 (default 20). |
| `starting_after` | `string` | no | A cursor (`next_cursor`) or object ID: return the objects after it (older). |
| `ending_before` | `string` | no | A cursor or object ID: return the objects before it (newer). |

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |

## Responses

### 200 OK

OK Returns `ConnectionList`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"list"` | — |
| `data` | `Connection[]` | — |
| `has_more` | `boolean` | Whether more objects follow in the requested direction. |
| `next_cursor` | `string \| null` | Pass as starting_after (or ending_before, when paging backwards) to continue; null on the last page. |
| `url` | `string` | The list's path. |

Example:

```json
{
  "data": [
    {
      "active_calls": 2,
      "answer_inbound": true,
      "auth_username": "",
      "backend": "native",
      "caller_ids": [
        "+97231234567"
      ],
      "codecs": [
        "pcma",
        "pcmu"
      ],
      "created": "2026-11-03T09:14:22.000Z",
      "default_caller_id": "+97231234567",
      "display_name": "",
      "enabled": true,
      "host": "sip.carrier.example.com",
      "id": "conn_2Wq8RfLx0bZt7nKp1VdYhC",
      "inbound_acl": [
        "198.51.100.0/24"
      ],
      "inbound_assistant_id": "asst_3cYbE6uYvGkH8w4ZK1rTqd",
      "inbound_reserve_pct": 15,
      "livemode": true,
      "max_channels": 30,
      "max_cps": 5,
      "name": "Main trunk",
      "object": "connection",
      "overflow_policy": "busy",
      "password_set": false,
      "port": 5060,
      "register": false,
      "register_expires_seconds": 300,
      "status": {
        "error": null,
        "expires_seconds": null,
        "registered_at": null,
        "state": "listening"
      },
      "transport": "udp",
      "type": "trunk",
      "updated": "2026-11-03T09:14:22.000Z",
      "username": ""
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "object": "list",
  "url": "/v1/connections"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

for await (const connection of mv.connections.list()) {
	console.log(connection);
}
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

for connection in client.connections.list():
    print(connection)
```

**cURL**

```sh
curl https://api.morevoice.ai/v1/connections \
  -H "Authorization: Bearer $MOREVOICE_API_KEY"
```
