# Bring your own SIP trunk

> POST /phone-numbers. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/phone-numbers/post-phone-numbers-bring-your-own-sip-trunk

POST https://server.heyrik.com/api/v1/phone-numbers

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Parameters

- name (string, required): Label.
- phone_number (string, required): E.164, e.g. +919876543210.
- sip_host (string, required): Your carrier's SIP host.
- sip_username (string): Digest username, if the trunk authenticates.
- sip_password (string): Digest password. Stored encrypted.
- direction (string): inbound | outbound | both (default).
- agent_id (string): Answering agent — can also be set later via PATCH.

## Notes

For numbers you already own elsewhere. Numbers bought from HeyRik appear here automatically.

## Request example

```sh
curl -X POST https://server.heyrik.com/api/v1/phone-numbers \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Main line",
    "phone_number": "+919876543210",
    "sip_host": "sip.your-carrier.example.com",
    "sip_username": "acme",
    "sip_password": "…",
    "direction": "both",
    "agent_id": "agc_9f2a1c30"
  }'
```
