Send Test Contact Card
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"to": "<string>",
"channel": "<string>"
}
'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test"
payload = {
"to": "<string>",
"channel": "<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({to: '<string>', channel: '<string>'})
};
fetch('https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test', 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}/identity/contact-card/test",
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([
'to' => '<string>',
'channel' => '<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/v2/agents/{agent_id}/identity/contact-card/test"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"channel\": \"<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/v2/agents/{agent_id}/identity/contact-card/test")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"channel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test")
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 \"to\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"channel": "sms",
"to": "+15550000000",
"from": "+18005551234",
"delivered_via": "mms",
"message_sid": "6f0d6b4d-6b0e-4a58-9a1b-6f2d7b6a2f10"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NO_BOUND_NUMBER",
"message": "This agent has no phone number attached to send from"
}
]
}
{
"data": null,
"errors": [
{
"error": "PAYMENT_REQUIRED",
"message": "Your balance does not cover sending this message"
}
]
}
{
"data": null,
"errors": [
{
"error": "BAD_REQUEST",
"message": "`channel` must be one of: sms, imessage, rcs"
}
]
}
Identity
Send Test Contact Card
Send the agent’s contact card to one number to check how it arrives.
POST
/
v2
/
agents
/
{agent_id}
/
identity
/
contact-card
/
test
Send Test Contact Card
curl --request POST \
--url https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"to": "<string>",
"channel": "<string>"
}
'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test"
payload = {
"to": "<string>",
"channel": "<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({to: '<string>', channel: '<string>'})
};
fetch('https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test', 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}/identity/contact-card/test",
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([
'to' => '<string>',
'channel' => '<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/v2/agents/{agent_id}/identity/contact-card/test"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"channel\": \"<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/v2/agents/{agent_id}/identity/contact-card/test")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"channel\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test")
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 \"to\": \"<string>\",\n \"channel\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"channel": "sms",
"to": "+15550000000",
"from": "+18005551234",
"delivered_via": "mms",
"message_sid": "6f0d6b4d-6b0e-4a58-9a1b-6f2d7b6a2f10"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NO_BOUND_NUMBER",
"message": "This agent has no phone number attached to send from"
}
]
}
{
"data": null,
"errors": [
{
"error": "PAYMENT_REQUIRED",
"message": "Your balance does not cover sending this message"
}
]
}
{
"data": null,
"errors": [
{
"error": "BAD_REQUEST",
"message": "`channel` must be one of: sms, imessage, rcs"
}
]
}
Overview
Sends the agent’s contact card to a number you choose so you can see how it looks on a real device.Each request sends a real message and is billed to your organization like any other outbound message. It is not a preview.
vcf_delivery_enabled is on, and you can repeat it.
Requires an admin, owner, operator, or prompter role.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
Body Parameters
string
required
Destination number in E.164, for example
+15550000000. Anything that does not normalize to E.164 returns 400 BAD_REQUEST.string
required
One of
sms, imessage, or rcs. Any other value returns 400 BAD_REQUEST listing the accepted values.Response
string
The channel you requested.
string
The destination number, normalized to E.164.
string
The agent number the card was sent from.
string
How it was actually delivered:
mms, imessage, or rcs. This can differ from channel when the requested channel falls back.string | null
Provider identifier for the sent message, or
null when the channel does not return one.string
Present only when there is something worth saying about how the send was handled.
null | array
null on success, or a list of error objects if the request failed. Returns 402 PAYMENT_REQUIRED when the organization’s balance will not cover a message. Returns 409 when the channel cannot carry the card, with error set to NO_BOUND_NUMBER, NO_RCS_SENDER, RCS_SENDER_NOT_READY, or IMESSAGE_NOT_CONFIGURED.{
"data": {
"channel": "sms",
"to": "+15550000000",
"from": "+18005551234",
"delivered_via": "mms",
"message_sid": "6f0d6b4d-6b0e-4a58-9a1b-6f2d7b6a2f10"
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NO_BOUND_NUMBER",
"message": "This agent has no phone number attached to send from"
}
]
}
{
"data": null,
"errors": [
{
"error": "PAYMENT_REQUIRED",
"message": "Your balance does not cover sending this message"
}
]
}
{
"data": null,
"errors": [
{
"error": "BAD_REQUEST",
"message": "`channel` must be one of: sms, imessage, rcs"
}
]
}
Docs for agents: llms.txt
Was this page helpful?