Create SIP Trunk
curl --request POST \
--url https://app.famulor.de/api/user/phone-numbers/sip-trunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"country_code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sip_trunk_type: '<string>',
phone_number: '<string>',
sip_username: '<string>',
sip_password: '<string>',
sip_address: '<string>',
sip_calling_format: '<string>',
inbound_authorization_type: '<string>',
country_code: '<string>'
})
};
fetch('https://app.famulor.de/api/user/phone-numbers/sip-trunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload = {
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"country_code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/phone-numbers/sip-trunks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sip_trunk_type' => '<string>',
'phone_number' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<string>',
'sip_address' => '<string>',
'sip_calling_format' => '<string>',
'inbound_authorization_type' => '<string>',
'country_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload := strings.NewReader("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"country_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
Create SIP Trunk
Create a new SIP trunk with credentials, address, and proxy settings
POST
/
api
/
user
/
phone-numbers
/
sip-trunks
Create SIP Trunk
curl --request POST \
--url https://app.famulor.de/api/user/phone-numbers/sip-trunks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"country_code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sip_trunk_type: '<string>',
phone_number: '<string>',
sip_username: '<string>',
sip_password: '<string>',
sip_address: '<string>',
sip_calling_format: '<string>',
inbound_authorization_type: '<string>',
country_code: '<string>'
})
};
fetch('https://app.famulor.de/api/user/phone-numbers/sip-trunks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload = {
"sip_trunk_type": "<string>",
"phone_number": "<string>",
"sip_username": "<string>",
"sip_password": "<string>",
"sip_address": "<string>",
"sip_calling_format": "<string>",
"inbound_authorization_type": "<string>",
"country_code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.famulor.de/api/user/phone-numbers/sip-trunks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sip_trunk_type' => '<string>',
'phone_number' => '<string>',
'sip_username' => '<string>',
'sip_password' => '<string>',
'sip_address' => '<string>',
'sip_calling_format' => '<string>',
'inbound_authorization_type' => '<string>',
'country_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.famulor.de/api/user/phone-numbers/sip-trunks"
payload := strings.NewReader("{\n \"sip_trunk_type\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"sip_username\": \"<string>\",\n \"sip_password\": \"<string>\",\n \"sip_address\": \"<string>\",\n \"sip_calling_format\": \"<string>\",\n \"inbound_authorization_type\": \"<string>\",\n \"country_code\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
This endpoint creates a new SIP trunk. The platform automatically provisions inbound and outbound trunks on the voice infrastructure using the provided credentials.
Body Parameters
string
required
The type of SIP trunk:
extension for a SIP extension, or number for a phone number (DID). This determines the expected format of the phone_number field.string
required
The SIP extension (1-15 characters, e.g.
1000) when sip_trunk_type is extension, or a phone number in E.164 format (e.g. +14155551234) when sip_trunk_type is number.string
A short, human-friendly label for the trunk (e.g. “Provider X — Main”). Maximum 50 characters.
string
required
Username for SIP authentication (3-128 characters)
string
required
Password for SIP authentication (minimum 3 characters)
string
required
The SIP server address without port (e.g.
sip.provider.com)string
required
The outbound calling number format:
+e164- International with+prefix (e.g.+12025550123)e164- International without+prefix (e.g.12025550123)national- National format without country code (e.g.0741926265)
string
required
How inbound calls are authenticated:
auth- Uses the same SIP username and password configured for outboundip- Whitelists specific IP addresses (requiresallowed_inbound_ips)
array
Array of IP addresses allowed to send inbound calls. Required when
inbound_authorization_type is ip. Must contain at least one valid IP address.string
required
ISO 3166-2 country code where the SIP trunk is located (e.g.
US, GB, DE). When sip_trunk_type is number, the country is auto-detected from the phone number if possible.boolean
Route outbound calls through a fixed IP address. Default:
false. Only enable this if your SIP provider requires IP-based authentication for outbound traffic.Response
string
Success message
object
The created SIP trunk object (same fields as Get SIP trunk)
{
"message": "SIP trunk created successfully.",
"data": {
"id": 42,
"phone_number": "1000",
"nickname": "Provider X — Main",
"sip_username": "myuser",
"sip_address": "sip.provider.com",
"sip_calling_format": "+e164",
"inbound_authorization_type": "auth",
"allowed_inbound_ips": null,
"outbound_proxy": false,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"message": "SIP trunk created successfully.",
"data": {
"id": 43,
"phone_number": "+14155551234",
"nickname": null,
"sip_username": "trunk_user",
"sip_address": "sip.provider.com",
"sip_calling_format": "e164",
"inbound_authorization_type": "ip",
"allowed_inbound_ips": ["203.0.113.10", "198.51.100.20"],
"outbound_proxy": true,
"country_code": "US",
"inbound_trunk_id": "ST_xxxxxxxxxxxx",
"outbound_trunk_id": "ST_yyyyyyyyyyyy",
"created_at": "2026-03-31T10:00:00.000000Z",
"updated_at": "2026-03-31T10:00:00.000000Z"
}
}
{
"error": "A SIP trunk with the same phone number, username, and address already exists."
}
{
"message": "The given data was invalid.",
"errors": {
"sip_address": ["SIP server address is required."],
"sip_calling_format": ["SIP calling format must be one of: +e164, e164, national."]
}
}
{
"error": "Failed to create SIP trunk. Please try again or contact support."
}
What happens after creation
When you create a SIP trunk, the platform automatically:- Provisions an inbound trunk on the voice infrastructure - using either username/password or IP-based authentication depending on your
inbound_authorization_typesetting - Provisions an outbound trunk - using the SIP address and credentials you provided, optionally through the outbound proxy
500 error is returned.
Next steps
After creating a SIP trunk, assign it to an AI assistant:- Create Assistant - Use the
phone_number_idparameter - Update Assistant - Change the phone number on an existing assistant