Skip to content
TriedDocs
Phone numbers

Test phone number connection

Send a SIP OPTIONS probe to the trunk behind one of your numbers.

POSThttps://api.tried.com.au/test-phone-number-connection/{n}

Needs keys Sends one SIP OPTIONS request to the trunk that carries a number's outbound calls and reports the first response. Any SIP response proves the trunk is reachable, and 200 means it accepts Tried. Real probes run when LiveKit (LIVEKIT_URL) is configured or SIP_OPTIONS_REAL=1 is set. Otherwise the result is a simulated 200 with no network traffic.

The probe target is chosen in this order:

  1. The termination_uri and transport of the number's SIP trunk, when sip_trunk_id is set.
  2. The number's own termination_uri and transport.
  3. sip.telnyx.com for Telnyx numbers with no termination URI.

To test a URI before you import a number, use Test SIP connection.

Request#

Path parameter Type Required Description
n string Yes The number in E.164, with + encoded as %2B.

This endpoint takes no query or body parameters.

Example request#

curl -X POST https://api.tried.com.au/test-phone-number-connection/%2B61290001234 \
  -H "Authorization: Bearer $TRIED_API_KEY"
const n = encodeURIComponent("+61290001234");
const res = await fetch(`https://api.tried.com.au/test-phone-number-connection/${n}`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.TRIED_API_KEY}` },
});
const result = await res.json();
import os, requests
from urllib.parse import quote

res = requests.post(
    f"https://api.tried.com.au/test-phone-number-connection/{quote('+61290001234')}",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
)
result = res.json()

Response#

200 OK

The probe result has the same shape as Test SIP connection.

{
  "reachable": true,
  "status_code": 200,
  "reason": "OK",
  "latency_ms": 38,
  "transport": "TCP",
  "target": "sip.example.com:5060"
}

A failed probe still returns 200 OK, with reachable false and an error such as timeout.

Errors#

Status When
400 This number has no termination URI to test.
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the numbers scope. Members get The member role is read-only.
404 Phone number ... not found in this workspace.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.