Skip to main content
POST
/
v1
/
sip
/
parse-destination
Parse SIP Destination
curl --request POST \
  --url https://api.bland.ai/v1/sip/parse-destination \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "input": "<string>"
}
'
import requests

url = "https://api.bland.ai/v1/sip/parse-destination"

payload = { "input": "<string>" }
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: '<string>'})
};

fetch('https://api.bland.ai/v1/sip/parse-destination', 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://api.bland.ai/v1/sip/parse-destination",
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([
'input' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);

$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://api.bland.ai/v1/sip/parse-destination"

payload := strings.NewReader("{\n \"input\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("authorization", "<authorization>")
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://api.bland.ai/v1/sip/parse-destination")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bland.ai/v1/sip/parse-destination")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "valid": true,
    "parsed": {
      "host": "your.provider.com",
      "port": 5061,
      "transport": "tls",
      "is_private_ip": false,
      "normalized": "sip:your.provider.com:5061;transport=tls"
    }
  },
  "errors": null
}

Headers

authorization
string
required
Your API key for authentication.

Body

input
string
required
The SIP destination to parse. Accepts flexible formats — a hostname or IP (sip.provider.com, 203.0.113.10), a full SIP URI (sip:user@host:5061;transport=tls), or shorthand (tls://host, host:5061).

Response

valid
boolean
Whether the input could be parsed into a usable SIP destination.
parsed
object
The parsed destination when valid is true, otherwise null.
Use the parsed host, port, and transport to populate the sip_endpoint and options of a trunk or a POST /v1/sip/attach request.
Example Request
curl -X POST https://api.bland.ai/v1/sip/parse-destination \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "sip:your.provider.com:5061;transport=tls"
  }'
{
  "data": {
    "valid": true,
    "parsed": {
      "host": "your.provider.com",
      "port": 5061,
      "transport": "tls",
      "is_private_ip": false,
      "normalized": "sip:your.provider.com:5061;transport=tls"
    }
  },
  "errors": null
}

Docs for agents: llms.txt