sip_trunk.invalid
The SIP trunk request failed validation for the given auth_mode.
The SIP trunk request failed validation for the given auth_mode.
sip_trunk.invalid means PUT /v1/sip-trunk was refused before anything was saved: a field in the request body does not fit the trunk's auth_mode. The error message names the field.
The same rules apply to a first connection and to an edit.
For both modes:
auth_mode must be "registration" or "ip_allowlist".username must not be empty.proxy must be a bare hostname or host:port: letters, digits, ., _, -, and an optional : followed by 1 to 5 digits. No scheme, no path, no spaces.realm, if you send it, follows the same rule as proxy.transport must be udp, tcp or tls. It defaults to udp.registration mode only:
password is required the first time a trunk is connected. On a later edit you can leave it out to keep the saved password.ip_allowlist mode only:
country_code must have a leading + (for example +254), then 1 to 3 digits with no leading zero.signaling_ips must contain at least one entry. Every entry is an IP address or a CIDR block.media_ips must contain at least one entry. Every entry is an IP address or a CIDR block. It is a separate field from signaling_ips, and both are required even when your carrier uses the same address for call setup and audio.Fix the field the message names. A minimal registration trunk:
await fetch("https://api.sautikit.com/v1/sip-trunk", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SAUTIKIT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
label: "Head office trunk",
auth_mode: "registration",
proxy: "sip.example-carrier.com",
transport: "udp",
username: "sautikit_100",
password: process.env.CARRIER_SIP_PASSWORD,
}),
});A minimal ip_allowlist trunk:
await fetch("https://api.sautikit.com/v1/sip-trunk", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.SAUTIKIT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
label: "Head office trunk",
auth_mode: "ip_allowlist",
proxy: "sip.example-carrier.com",
transport: "udp",
username: "sautikit_100",
country_code: "+254",
signaling_ips: ["203.0.113.10", "203.0.113.0/28"],
media_ips: ["203.0.113.10", "203.0.113.0/28"],
}),
});{
"error": {
"code": "sip_trunk.invalid",
"message": "proxy must be a host or host:port",
"request_id": "req_01900000abc"
}
}