Bring your own SIP trunk
POST
https://server.heyrik.com/api/v1/phone-numbersHeaders
AuthorizationstringRequiredUse Bearer $HEYRIK_API_KEY with an account-scoped API key. Keep the key on your server.
Parameters 7
Fields documented for this operation. See the request example for placement and structure.
namestringRequiredLabel.
phone_numberstringRequiredE.164, e.g. +919876543210.
sip_hoststringRequiredYour carrier's SIP host.
sip_usernamestringDigest username, if the trunk authenticates.
sip_passwordstringDigest password. Stored encrypted.
directionstringinbound | outbound | both (default).
agent_idstringAnswering agent — can also be set later via PATCH.
Response
No response example is documented for this operation yet.
Error referencePOST/phone-numbers
cURL
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"
}'Illustrative examples · No live request is sent
