# Create a SIP trunk

Creates a SIP trunk.

```http
POST https://api.pozy.ai/v1/phone-numbers/sip-trunks
```

- Area: Phone & voice / Voice
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `label`, string, required: Up to 80 characters
- `sipHost`, string, required
- `sipPort`, integer: 1 to 65535
- `transport`, string: One of `tls`, `tcp`, `udp`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/phone-numbers/sip-trunks" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "label": "string",
  "sipHost": "string"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/phone-numbers/sip-trunks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    label: "string",
    sipHost: "string"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/phone-numbers/sip-trunks",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "label": "string",
        "sipHost": "string",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 201

- `id`, string
- `label`, string
- `sipHost`, string
- `sipPort`, integer
- `transport`, string: One of `tls`, `tcp`, `udp`
- `termination`, object
  - `uri`, string
  - `username`, string
- `numbersAttached`, integer
- `createdAt`, string (date-time): Can be null
- `digestPassword`, string

```json
{
  "id": "6bfebd43ddc270f6d2c56fc5",
  "label": "string",
  "sipHost": "string",
  "sipPort": 1,
  "transport": "tls",
  "termination": {
    "uri": "string",
    "username": "acme"
  },
  "numbersAttached": 1,
  "createdAt": "2026-10-02T09:00:00.000Z",
  "digestPassword": "string"
}
```
