Assign the agent that answers this number
PATCH
https://server.heyrik.com/api/v1/phone-numbers/{id}Path parameters
idRequiredReplace {id} in the request URL with the value for this resource.
Headers
AuthorizationstringRequiredUse Bearer $HEYRIK_API_KEY with an account-scoped API key. Keep the key on your server.
Parameters 3
Fields documented for this operation. See the request example for placement and structure.
agent_idstringRequiredThe agent id (from POST /agents) that should answer inbound calls. Send null to unassign. (`agency_id` also accepted.)
namestringRename the number in your dashboard.
activebooleanfalse stops it receiving calls without releasing it.
Response
Explore the example values. This is not a complete response schema.
dataobjectExplore 5 properties
idstringExample "sip_45723ca5"
phone_numberstringExample "+918071578563"
agency_idstringExample "agc_9f2a1c30"
directionstringExample "both"
activebooleanExample true
PATCH/phone-numbers/{id}
cURL
curl -X PATCH https://server.heyrik.com/api/v1/phone-numbers/sip_45723ca5 \
-H "Authorization: Bearer $HEYRIK_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "agent_id": "agc_9f2a1c30" }'Response example
JSON
{
"data": {
"id": "sip_45723ca5",
"phone_number": "+918071578563",
"agency_id": "agc_9f2a1c30",
"direction": "both",
"active": true
}
}Illustrative examples · No live request is sent
