Skip to content

Rute inbound și outbound ​

8 endpoint-uri. Fiecare cale de mai jos este relativă la URL-ul de bază al API-ului și include deja prefixul /api/v1 — vezi convențiile pentru autentificare, paginare, erori și idempotență.

Endpoint
GET/telephony/inbound-routesList inbound routing rules in priority order, paginated
POST/telephony/inbound-routesCreate an inbound routing rule matching DID, caller and source IP, and pointing at a destination
PATCH/telephony/inbound-routes/{id}Update an inbound routing rule's matching, destination, fallback or recording settings
DELETE/telephony/inbound-routes/{id}Delete an inbound routing rule
GET/telephony/outbound-routesList outbound dial-plan rules in match order, paginated
POST/telephony/outbound-routesCreate an outbound dial-plan rule selecting a trunk, digit manipulation, caller id and blocking policy
PATCH/telephony/outbound-routes/{id}Update an outbound dial-plan rule's matching, trunk selection, digit manipulation or blocking
DELETE/telephony/outbound-routes/{id}Delete an outbound dial-plan rule

Endpoint-uri ​

List inbound routing rules in priority order, paginated ​

GET/telephony/inbound-routes
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
bash
curl -X GET "$CALLAGENT_API_URL/telephony/inbound-routes" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/inbound-routes`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/inbound-routes');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/inbound-routes",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped array

Exemplu de răspuns, generat din schemă:

json
{
  "data": [
    "string"
  ],
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 1,
    "pages": 1
  }
}

Create an inbound routing rule matching DID, caller and source IP, and pointing at a destination ​

POST/telephony/inbound-routes
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Request body keys are camelCase (e.g. didPattern, destinationType, phoneNumberId), not the snake_case the rest of the wire format uses
bash
curl -X POST "$CALLAGENT_API_URL/telephony/inbound-routes" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/inbound-routes`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/inbound-routes');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/inbound-routes",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
201data-wrapped InboundRoute

Erori

StatusCând apare
422Validation failed, or a referenced number/trunk id does not exist

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "organization_id": "01JQ0000000000000000000000",
    "name": "Support Line",
    "description": "string",
    "enabled": true,
    "priority": 1,
    "phone_number_id": "01JQ0000000000000000000000",
    "sip_trunk_id": "01JQ0000000000000000000000",
    "did_pattern": "string",
    "did_match_type": "string",
    "caller_pattern": "string",
    "caller_match_type": "string",
    "source_ip_acl": {},
    "time_condition_id": "01JQ0000000000000000000000",
    "destination_type": "assistant",
    "destination_id": "01JQ0000000000000000000000",
    "destination_value": "string",
    "fallback_destination_type": "assistant",
    "fallback_destination_id": "01JQ0000000000000000000000",
    "fallback_destination_value": "string",
    "recording_mode": "disabled",
    "ring_timeout_seconds": 30,
    "screen_caller": true,
    "set_variables": {},
    "metadata": {},
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00",
    "deleted_at": "2026-01-01T12:00:00+00:00"
  }
}

Update an inbound routing rule's matching, destination, fallback or recording settings ​

PATCH/telephony/inbound-routes/{id}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Request body keys are camelCase (e.g. didPattern, destinationType), not the snake_case the rest of the wire format uses

Parametri de cale

NumeTipObligatoriuNote
idstringda
bash
curl -X PATCH "$CALLAGENT_API_URL/telephony/inbound-routes/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/inbound-routes/01JQ0000000000000000000000`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/inbound-routes/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.patch(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/inbound-routes/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped object

Erori

StatusCând apare
404No such inbound route for this tenant
422Validation failed, or a referenced number/trunk id does not exist

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "organization_id": "01JQ0000000000000000000000",
    "name": "Support Line",
    "description": "string",
    "enabled": true,
    "priority": 1,
    "phone_number_id": "01JQ0000000000000000000000",
    "sip_trunk_id": "01JQ0000000000000000000000",
    "did_pattern": "string",
    "did_match_type": "string",
    "caller_pattern": "string",
    "caller_match_type": "string",
    "source_ip_acl": {},
    "time_condition_id": "01JQ0000000000000000000000",
    "destination_type": "assistant",
    "destination_id": "01JQ0000000000000000000000",
    "destination_value": "string",
    "fallback_destination_type": "assistant",
    "fallback_destination_id": "01JQ0000000000000000000000",
    "fallback_destination_value": "string",
    "recording_mode": "disabled",
    "ring_timeout_seconds": 30,
    "screen_caller": true,
    "set_variables": {},
    "metadata": {},
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00",
    "deleted_at": "2026-01-01T12:00:00+00:00"
  }
}

Delete an inbound routing rule ​

DELETE/telephony/inbound-routes/{id}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Acest răspuns nu este împachetat în data.

Parametri de cale

NumeTipObligatoriuNote
idstringda
bash
curl -X DELETE "$CALLAGENT_API_URL/telephony/inbound-routes/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/inbound-routes/01JQ0000000000000000000000`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/inbound-routes/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.delete(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/inbound-routes/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
204No content

Erori

StatusCând apare
404No such inbound route for this tenant

List outbound dial-plan rules in match order, paginated ​

GET/telephony/outbound-routes
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
bash
curl -X GET "$CALLAGENT_API_URL/telephony/outbound-routes" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/outbound-routes`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/outbound-routes');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.get(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/outbound-routes",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped array

Exemplu de răspuns, generat din schemă:

json
{
  "data": [
    "string"
  ],
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 1,
    "pages": 1
  }
}

Create an outbound dial-plan rule selecting a trunk, digit manipulation, caller id and blocking policy ​

POST/telephony/outbound-routes
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Request body keys are camelCase (e.g. destinationPattern, sipTrunkId, callerIdNumber), not the snake_case the rest of the wire format uses
bash
curl -X POST "$CALLAGENT_API_URL/telephony/outbound-routes" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/outbound-routes`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/outbound-routes');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.post(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/outbound-routes",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
201data-wrapped OutboundRoute

Erori

StatusCând apare
422Validation failed, or a referenced trunk/number id does not exist

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "organization_id": "01JQ0000000000000000000000",
    "name": "Support Line",
    "description": "string",
    "enabled": true,
    "priority": 1,
    "destination_pattern": "string",
    "match_type": "string",
    "countries": {},
    "min_digits": 1,
    "max_digits": 1,
    "emergency": true,
    "sip_trunk_id": "01JQ0000000000000000000000",
    "phone_number_id": "01JQ0000000000000000000000",
    "failover_sip_trunk_id": "01JQ0000000000000000000000",
    "strip_digits": 1,
    "prepend_digits": "string",
    "caller_id_number": "+40712345678",
    "caller_id_name": "Support Line",
    "blocked": true,
    "block_reason": "string",
    "max_call_seconds": 30,
    "rate_per_minute": "string",
    "high_cost": true,
    "set_variables": {},
    "metadata": {},
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00",
    "deleted_at": "2026-01-01T12:00:00+00:00"
  }
}

Update an outbound dial-plan rule's matching, trunk selection, digit manipulation or blocking ​

PATCH/telephony/outbound-routes/{id}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Request body keys are camelCase (e.g. destinationPattern, sipTrunkId), not the snake_case the rest of the wire format uses

Parametri de cale

NumeTipObligatoriuNote
idstringda
bash
curl -X PATCH "$CALLAGENT_API_URL/telephony/outbound-routes/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/outbound-routes/01JQ0000000000000000000000`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/outbound-routes/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.patch(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/outbound-routes/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
200data-wrapped object

Erori

StatusCând apare
404No such outbound route for this tenant
422Validation failed, or a referenced trunk/number id does not exist

Exemplu de răspuns, generat din schemă:

json
{
  "data": {
    "id": "01JQ0000000000000000000000",
    "organization_id": "01JQ0000000000000000000000",
    "name": "Support Line",
    "description": "string",
    "enabled": true,
    "priority": 1,
    "destination_pattern": "string",
    "match_type": "string",
    "countries": {},
    "min_digits": 1,
    "max_digits": 1,
    "emergency": true,
    "sip_trunk_id": "01JQ0000000000000000000000",
    "phone_number_id": "01JQ0000000000000000000000",
    "failover_sip_trunk_id": "01JQ0000000000000000000000",
    "strip_digits": 1,
    "prepend_digits": "string",
    "caller_id_number": "+40712345678",
    "caller_id_name": "Support Line",
    "blocked": true,
    "block_reason": "string",
    "max_call_seconds": 30,
    "rate_per_minute": "string",
    "high_cost": true,
    "set_variables": {},
    "metadata": {},
    "created_at": "2026-01-01T12:00:00+00:00",
    "updated_at": "2026-01-01T12:00:00+00:00",
    "deleted_at": "2026-01-01T12:00:00+00:00"
  }
}

Delete an outbound dial-plan rule ​

DELETE/telephony/outbound-routes/{id}
  • Handler-ul nu impune niciun scope — orice cheie validă îl poate apela.
  • Acest răspuns nu este împachetat în data.

Parametri de cale

NumeTipObligatoriuNote
idstringda
bash
curl -X DELETE "$CALLAGENT_API_URL/telephony/outbound-routes/01JQ0000000000000000000000" \
  -H "Authorization: Bearer $CALLAGENT_API_KEY" \
  -H "Accept: application/json"
js
const response = await fetch(`${process.env.CALLAGENT_API_URL}/telephony/outbound-routes/01JQ0000000000000000000000`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CALLAGENT_API_KEY}`,
    Accept: 'application/json',
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.type}: ${error.message}`);
}

const { data } = await response.json();
php
<?php

$handle = curl_init(getenv('CALLAGENT_API_URL') . '/telephony/outbound-routes/01JQ0000000000000000000000');

curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('CALLAGENT_API_KEY'),
        'Accept: application/json',
    ],
]);

$body = json_decode(curl_exec($handle), true);
$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

if ($status >= 400) {
    throw new RuntimeException("{$body['error']['type']}: {$body['error']['message']}");
}

$data = $body['data'];
python
import os, requests

response = requests.delete(
    f"{os.environ['CALLAGENT_API_URL']}/telephony/outbound-routes/01JQ0000000000000000000000",
    headers={"Authorization": f"Bearer {os.environ['CALLAGENT_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()["data"]

Răspunsuri

StatusCorp
204No content

Erori

StatusCând apare
404No such outbound route for this tenant

Scrisă după cod. Ce nu este încă implementat este marcat ca atare, niciodată descris ca funcțional.