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

# sip trunks

> bring your own carrier numbers.

if you already have numbers with a carrier, register them as SIP trunks: the
platform gets a SIP address your carrier sends inbound calls to, an agent
answers them, and the agent can dial out from the number through your carrier.
no rent, no KYC — the number stays yours.

Indian mobile numbers (`+91`) only for now; up to 10 per account.

## 1. get the origination uri

`GET /v1/sip-trunks/origination-uri` returns the SIP address to configure at
your carrier for inbound calls. it is one address for the platform's SIP host,
the same for every number, so you can set the carrier up before registering.

```bash curl theme={null}
curl https://silk-api.rumik.ai/v1/sip-trunks/origination-uri \
  -H "Authorization: Bearer rk_live_•••••••••"
```

```json theme={null}
{ "originationUri": "sip:sip.silk.rumik.ai;transport=tcp" }
```

point the carrier's trunk for the number at that address (host only — the
platform routes by the dialed number).

## 2. register the number

`POST /v1/sip-trunks`.

<ParamField body="phoneNumber" type="string" required>
  your number, E.164 (`+91…`; spaces and dashes tolerated).
</ParamField>

<ParamField body="terminationUri" type="string" required>
  your carrier's SIP endpoint for calls placed **from** the number: `sip:` or
  `sips:`, optional `user@`, port and `;transport=` params.
</ParamField>

<ParamField body="authUsername" type="string" required>
  the digest username your carrier authenticates with.
</ParamField>

<ParamField body="authPassword" type="string" required>
  the digest password. never returned.
</ParamField>

<ParamField body="displayName" type="string">
  a label. defaults to the number.
</ParamField>

```bash curl theme={null}
curl -X POST https://silk-api.rumik.ai/v1/sip-trunks \
  -H "Authorization: Bearer rk_live_•••••••••" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+91 98765 43210",
    "displayName": "support line",
    "terminationUri": "sip:pstn.example-carrier.in",
    "authUsername": "silk",
    "authPassword": "s3cret"
  }'
```

```json theme={null}
{
  "id": "019f7c10-2b4e-7d5f-8a6b-7c8d9e0f1a2b",
  "phoneNumber": "+919876543210",
  "displayName": "support line",
  "terminationUri": "sip:pstn.example-carrier.in",
  "authUsername": "silk",
  "hasAuth": true,
  "originationUri": "sip:sip.silk.rumik.ai;transport=tcp",
  "assignedAgentId": null,
  "assignedAgentName": null,
  "status": "active",
  "createdAt": "2026-09-11T10:00:00Z",
  "updatedAt": "2026-09-11T10:00:00Z"
}
```

the number is provisioned on the SIP host inside the request; if the host
refuses it (`502 sip_trunk_provision_failed`, the message says why) nothing is
stored. a number already registered — on any account — is
`409 sip_trunk_number_taken`.

<Warning>
  both credentials are required. the inbound trunk's number list is routing,
  not authorisation — without digest credentials anyone reaching the SIP host
  could ring the number on your account.
</Warning>

## 3. assign an agent

`POST /v1/sip-trunks/{id}/assign` chooses which agent answers the number.

```bash curl theme={null}
curl -X POST https://silk-api.rumik.ai/v1/sip-trunks/019f7c10-2b4e-7d5f-8a6b-7c8d9e0f1a2b/assign \
  -H "Authorization: Bearer rk_live_•••••••••" \
  -H "Content-Type: application/json" \
  -d '{ "agentId": "ua_fe3277d8" }'
```

only a **deployed** agent can take a number (`409 agent_not_deployed`). the
number is detached from any previous agent; `"agentId": null` unassigns.
inbound calls are billed to your account like any other call and show up in
`GET /v1/calls` with `channel: "phone"`.

## dialing out from it

pass the trunk to [`POST /v1/calls`](/outbound-calls) as `fromTrunkId`, or its
number as `fromNumber`. the call goes out through your carrier's
`terminationUri` with the number as caller id; no platform number and no
carrier charge from us are involved.

## list, get, remove

```bash curl theme={null}
curl https://silk-api.rumik.ai/v1/sip-trunks -H "Authorization: Bearer rk_live_•••••••••"
curl https://silk-api.rumik.ai/v1/sip-trunks/019f7c10-2b4e-7d5f-8a6b-7c8d9e0f1a2b -H "Authorization: Bearer rk_live_•••••••••"
curl -X DELETE https://silk-api.rumik.ai/v1/sip-trunks/019f7c10-2b4e-7d5f-8a6b-7c8d9e0f1a2b -H "Authorization: Bearer rk_live_•••••••••"
```

`DELETE` removes the SIP objects first, then the assignment, then the number
(`204`). a refusal from the SIP host keeps everything as it was (`502`).

next: back to the [agents api overview](/agents-api), or the
[api reference](/api-reference).
