SIP configuration API
Bring your own number so an agent can answer or place calls. MediaSFU-provided numbers are for outgoing non-AI calls only.
Endpoint: https://mediasfu.com/v1/sipconfigs
Authenticate with Authorization: Bearer <api-username>:<api-key> from your server. Try every action and copy the request in the API Sandbox.
▶ Watch this: Create and edit a phone line, 1:33.
Add a number
POST https://mediasfu.com/v1/sipconfigs with action: "create"
Register your own SIP number.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
contactNumber | text | Phone number. The number this config controls, E.164 format. | |
provider | text | Provider. Your telephony provider. | |
supportSipActive | boolean | Number active. Take and place calls on this number. | true |
supportSipNameCalls | boolean | Show caller names. Pass display names through with calls. | true |
allowOutgoing | boolean | Allow outgoing calls. Let agents and your app place calls from this number. | true |
curl -X POST https://mediasfu.com/v1/sipconfigs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"create","contactNumber":"+15551234567","provider":"twilio","supportSipActive":true,"supportSipNameCalls":true,"allowOutgoing":true}'
Example response:
{
"success": true,
"sipConfig": {
"contactNumber": "+15551234567",
"provider": "telnyx",
"supportSipActive": true,
"supportSipNameCalls": true,
"allowOutgoing": true,
"preferPCMA": false,
"autoRecordSip": false,
"webAgentConfigId": null,
"autoAgent": {
"enabled": false,
"outgoingType": "PLAYBACK",
"…": "agent settings"
},
"peer": {
"host": "sip.telnyx.com",
"port": 5060,
"transport": "udp",
"register": true,
"auth": {
"username": "trunk-user",
"password": "****"
}
},
"…": "and the routing, allow-list and callback options"
}
}
Update a number
POST https://mediasfu.com/v1/sipconfigs with action: "update"
Change a SIP config, identified by number. Only the fields you send change; send null or an empty string to clear one.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
contactNumber | text | Phone number. The number this config controls, E.164 format. |
Optional: Changes
Send only what you want to change.
| Field | Type | Description | Default |
|---|---|---|---|
provider | text | Provider. Your telephony provider. |
curl -X POST https://mediasfu.com/v1/sipconfigs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"update","contactNumber":"+15551234567"}'
Example response:
{
"success": true,
"sipConfig": {
"contactNumber": "+15551234567",
"provider": "twilio",
"…": "same fields as create"
}
}
Remove a number
POST https://mediasfu.com/v1/sipconfigs with action: "delete"
Delete a SIP config by number.
Required fields
| Field | Type | Description | Default |
|---|---|---|---|
contactNumber | text | Phone number. The number this config controls, E.164 format. |
curl -X POST https://mediasfu.com/v1/sipconfigs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY" \
-d '{"action":"delete","contactNumber":"+15551234567"}'
Example response:
{
"success": true,
"sipConfig": {
"contactNumber": "+15551234567"
}
}
List / get
GET https://mediasfu.com/v1/sipconfigs with action: "get"
Retrieve records. Everything is optional — send as-is to list all.
No fields are required.
Optional: Filters
All optional — narrow or page the results.
| Field | Type | Description | Default |
|---|---|---|---|
startIndex | number | Start index | 0 |
pageSize | number (10–50) | Page size. Between 10 and 50. | 20 |
curl "https://mediasfu.com/v1/sipconfigs?action=get" \
-H "Authorization: Bearer $MEDIASFU_API_USERNAME:$MEDIASFU_API_KEY"
Example response:
{
"success": true,
"sipConfigs": [
{
"contactNumber": "+15551234567",
"provider": "telnyx",
"supportSipActive": true,
"…": "same fields as create"
}
],
"total": 1,
"totalCount": 1,
"startIndex": 0,
"pageSize": 10
}
See errors and response format for failure handling.