curl --request POST \
--url https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"address": "<string>",
"numbers": [
"<string>"
],
"username": "<string>",
"password": "<string>",
"transport": "tcp",
"country_code": "<string>",
"is_default_outbound": false
}
'import requests
url = "https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision"
payload = {
"name": "<string>",
"address": "<string>",
"numbers": ["<string>"],
"username": "<string>",
"password": "<string>",
"transport": "tcp",
"country_code": "<string>",
"is_default_outbound": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
address: '<string>',
numbers: ['<string>'],
username: '<string>',
password: '<string>',
transport: 'tcp',
country_code: '<string>',
is_default_outbound: false
})
};
fetch('https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision",
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([
'name' => '<string>',
'address' => '<string>',
'numbers' => [
'<string>'
],
'username' => '<string>',
'password' => '<string>',
'transport' => 'tcp',
'country_code' => '<string>',
'is_default_outbound' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}"
response = http.request(request)
puts response.read_body{
"configuration_id": 123,
"ready": true,
"route_id": 123,
"route_state": "<string>",
"numbers": [],
"reason": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Provision Sip Trunk
Add a SIP trunk line from any carrier with its numbers in one request and build its call route. Numbers are checked before anything is created; if a number is still refused while numbers are added, the new line is removed again and the original error is returned. The organization’s default outbound line changes only after everything succeeds. The first number is the default caller ID. Returns the line’s readiness. 400: invalid trunk settings or numbers, or a number listed twice (nothing created). 409: the name is already used, or a number belongs to another line in the organization.
curl --request POST \
--url https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"address": "<string>",
"numbers": [
"<string>"
],
"username": "<string>",
"password": "<string>",
"transport": "tcp",
"country_code": "<string>",
"is_default_outbound": false
}
'import requests
url = "https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision"
payload = {
"name": "<string>",
"address": "<string>",
"numbers": ["<string>"],
"username": "<string>",
"password": "<string>",
"transport": "tcp",
"country_code": "<string>",
"is_default_outbound": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
address: '<string>',
numbers: ['<string>'],
username: '<string>',
password: '<string>',
transport: 'tcp',
country_code: '<string>',
is_default_outbound: false
})
};
fetch('https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision",
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([
'name' => '<string>',
'address' => '<string>',
'numbers' => [
'<string>'
],
'username' => '<string>',
'password' => '<string>',
'transport' => 'tcp',
'country_code' => '<string>',
'is_default_outbound' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://athena.tryopencomputer.com/api/v1/organizations/sip-trunks/provision")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"numbers\": [\n \"<string>\"\n ],\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"transport\": \"tcp\",\n \"country_code\": \"<string>\",\n \"is_default_outbound\": false\n}"
response = http.request(request)
puts response.read_body{
"configuration_id": 123,
"ready": true,
"route_id": 123,
"route_state": "<string>",
"numbers": [],
"reason": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
Body for POST /sip-trunks/provision: a SIP trunk from any carrier plus the numbers on it.
1 - 64SIP trunk host your carrier gave you, e.g. trunk.example.com
E.164 numbers on this trunk; the first is the caller ID
1 - 50 elementsSIP login (blank if the carrier authorises by IP)
SIP password
tcp (recommended), tls or udp
2