Get Agent Memory Schema
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/memory/schema \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/memory/schema"
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}/memory/schema', 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}/memory/schema",
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}/memory/schema"
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}/memory/schema")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/memory/schema")
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": {
"entity_schemas": [
{
"entity_type": "appointment",
"description": "A dental appointment the caller books, moves, or cancels.",
"identifier_field": "confirmation_number",
"fields": [
{
"name": "confirmation_number",
"description": "The booking reference given to the caller.",
"type": "string",
"required": true
},
{
"name": "starts_at",
"description": "When the appointment starts.",
"type": "string",
"type_conversion": {
"natural_language_examples": ["tomorrow at 2", "next Tuesday morning"],
"target_format": "ISO 8601 date-time"
}
}
],
"status_field": "state",
"outcomes": ["booked", "rescheduled", "cancelled"]
}
],
"source": "settings"
},
"errors": null
}
{
"data": {
"entity_schemas": [],
"source": null
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Memory
Get Agent Memory Schema
Read what the agent remembers about each contact between calls.
GET
/
v2
/
agents
/
{agent_id}
/
memory
/
schema
Get Agent Memory Schema
curl --request GET \
--url https://api.bland.ai/v2/agents/{agent_id}/memory/schema \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/{agent_id}/memory/schema"
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}/memory/schema', 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}/memory/schema",
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}/memory/schema"
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}/memory/schema")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/{agent_id}/memory/schema")
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": {
"entity_schemas": [
{
"entity_type": "appointment",
"description": "A dental appointment the caller books, moves, or cancels.",
"identifier_field": "confirmation_number",
"fields": [
{
"name": "confirmation_number",
"description": "The booking reference given to the caller.",
"type": "string",
"required": true
},
{
"name": "starts_at",
"description": "When the appointment starts.",
"type": "string",
"type_conversion": {
"natural_language_examples": ["tomorrow at 2", "next Tuesday morning"],
"target_format": "ISO 8601 date-time"
}
}
],
"status_field": "state",
"outcomes": ["booked", "rescheduled", "cancelled"]
}
],
"source": "settings"
},
"errors": null
}
{
"data": {
"entity_schemas": [],
"source": null
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Overview
Returns the memory entity schema the agent runs with today: the kinds of things it tracks per contact, such as a booking or an order, and the fields it fills in for each one. The schema comes from one of two places, andsource tells you which. When the newest dev version carries settings.memorySchema, that is returned and source is settings. Otherwise the last schema the runtime inferred and cached is returned with source set to cached_version. An agent with neither returns an empty list and source of null, which means nothing is known yet rather than that the agent remembers nothing.
To produce a schema for an agent that has none, use Infer Agent Memory Schema.
Headers
string
required
Your API key for authentication.
Path Parameters
string
required
The agent’s unique identifier.
Response
array
The entity types the agent tracks per contact. Empty when nothing is known yet.
Show entity schema object
Show entity schema object
string
Name of the entity, for example
trip, order, or quote.string
What this entity represents.
string
The field used to tell one instance from another, for example
confirmation_number.array
Field definitions. Each has
name, description, and type, plus optional enum_values, required, array_item_type, array_item_schema, type_conversion, and conversational_format.string
Which field tracks the entity’s lifecycle. Present only when one is set.
array
Possible end states for this entity. Present only when any are set.
object
Extra context about the entity type. Present only when set.
string | null
Where the schema came from:
settings when it is saved on the agent’s newest dev version, cached_version when it was inferred by the runtime, or null when entity_schemas is empty.null | array
null on success, or a list of error objects if the request failed.{
"data": {
"entity_schemas": [
{
"entity_type": "appointment",
"description": "A dental appointment the caller books, moves, or cancels.",
"identifier_field": "confirmation_number",
"fields": [
{
"name": "confirmation_number",
"description": "The booking reference given to the caller.",
"type": "string",
"required": true
},
{
"name": "starts_at",
"description": "When the appointment starts.",
"type": "string",
"type_conversion": {
"natural_language_examples": ["tomorrow at 2", "next Tuesday morning"],
"target_format": "ISO 8601 date-time"
}
}
],
"status_field": "state",
"outcomes": ["booked", "rescheduled", "cancelled"]
}
],
"source": "settings"
},
"errors": null
}
{
"data": {
"entity_schemas": [],
"source": null
},
"errors": null
}
{
"data": null,
"errors": [
{
"error": "NOT_FOUND",
"message": "Agent not found"
}
]
}
Docs for agents: llms.txt
Was this page helpful?