SIP trunks API

SIP trunks connect Seny telephony to your own PBX. This API manages the trunk records; gated on org.read / org.write.

The password is write-only

The SIP password is supplied on create/update, stored encrypted, and never returned by the API. Responses include the host and username but no credential.

List & get

GET /api/v1/rest/sip-trunks
GET /api/v1/rest/sip-trunks/:id

Create a trunk

POST /api/v1/rest/sip-trunks
{
  "label":        "Dealership PBX",
  "sip_host":     "pbx.dealership.example",
  "sip_username": "seny",
  "password":     "…"
}

Update & delete

PATCH  /api/v1/rest/sip-trunks/:id
DELETE /api/v1/rest/sip-trunks/:id

Pass password on PATCH to rotate the credential. sip_host is normalized to a bare hostname[:port] (schemes and paths are stripped). Deleting a trunk that transfer rules still reference returns 409 — reassign or delete those rules first, so a live SIP transfer never silently breaks.