Get Agent Number Binding
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/inbound \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/inbound"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/inbound', 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/v2/agents/{agent_id}/inbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v2/agents/{agent_id}/inbound"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bland.ai/v2/agents/{agent_id}/inbound")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/inbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"agent_id": "680817f5-147a-4e7f-9d25-eac973e693a5",
"persona_id": "a308a95d-854d-435a-ae2a-b3d113b59054"
},
"errors": null
}
{
"data": {
"agent_id": "818cab80-86c9-46fc-93d8-a7f548b18d7e",
"persona_id": null
},
"errors": null
}
Phone Numbers
Get Agent Number Binding
Check whether phone numbers have been attached to an agent.
GET
/
v2
/
agents
/
{agent_id}
/
inbound
Get Agent Number Binding
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/inbound \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/inbound"
headers = {"authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {authorization: '<authorization>'}};
fetch('https://api.bland.ai/v2/agents/{agent_id}/inbound', 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/v2/agents/{agent_id}/inbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.bland.ai/v2/agents/{agent_id}/inbound"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bland.ai/v2/agents/{agent_id}/inbound")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/inbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"agent_id": "680817f5-147a-4e7f-9d25-eac973e693a5",
"persona_id": "a308a95d-854d-435a-ae2a-b3d113b59054"
},
"errors": null
}
{
"data": {
"agent_id": "818cab80-86c9-46fc-93d8-a7f548b18d7e",
"persona_id": null
},
"errors": null
}
Overview
Returns the agent’s inbound number binding.persona_id is null until the first successful Attach Numbers to Agent call. This endpoint does not list the numbers themselves; use List Numbers for that. An unknown agent ID returns persona_id: null rather than 404.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
Response
string
The agent ID from the request path, echoed back.
string | null
ID of the persona that attached numbers route through. Bland creates it on the first attach and keeps it afterwards, so it stays set even after every number is detached.
null if numbers have never been attached to this agent.null | array
null on success, or a list of error objects if the request failed.{
"data": {
"agent_id": "680817f5-147a-4e7f-9d25-eac973e693a5",
"persona_id": "a308a95d-854d-435a-ae2a-b3d113b59054"
},
"errors": null
}
{
"data": {
"agent_id": "818cab80-86c9-46fc-93d8-a7f548b18d7e",
"persona_id": null
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?