Citation Schemas
Create Citation Schema
Create a new citation schema for extracting structured data from call transcripts.
POST
/
v1
/
citation_schemas
/
Create Citation Schema
curl --request POST \
--url https://api.bland.ai/v1/citation_schemas/ \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"description": "<string>",
"schema": {}
}
'import requests
url = "https://api.bland.ai/v1/citation_schemas/"
payload = {
"name": "<string>",
"description": "<string>",
"schema": {}
}
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({name: '<string>', description: '<string>', schema: {}})
};
fetch('https://api.bland.ai/v1/citation_schemas/', 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/citation_schemas/",
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([
'name' => '<string>',
'description' => '<string>',
'schema' => [
]
]),
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/citation_schemas/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\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/citation_schemas/")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/citation_schemas/")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"data": {
"id": "6ba7b812-9dad-11d1-80b4-00c04fd430c8",
"name": "Customer Information Extraction",
"description": "Extracts customer demographics and contact information from call transcripts",
"org_id": "9b59f853-c2c7-4e3a-b5d6-8f7e9a1b2c3d",
"schema": {
"variables": [
{
"name": "Customer Name",
"description": "The full name of the customer",
"type": "string"
},
{
"name": "Customer Email",
"description": "The email address provided by the customer",
"type": "string"
},
{
"name": "Interested in Demo",
"description": "Whether the customer wants to schedule a demo",
"type": "boolean"
}
],
"groupings": [
{
"name": "Contact Information",
"variables": ["Customer Name", "Customer Email"]
}
],
"conditions": [
{
"condition": {
"value": "true",
"operator": "===",
"variable": "Interested in Demo"
},
"variables": [
{
"name": "Demo Preference",
"type": "string",
"description": "Type of demo the customer prefers (in-person, virtual, etc.)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}
Overview
Create a citation schema to define what data should be extracted from call transcripts. Citation schemas allow you to automatically capture structured information like customer details, call outcomes, or any custom variables relevant to your use case.Headers
Body Parameters
The name of the citation schema. This should be descriptive and help you identify the schema’s purpose.
The JSON schema configuration that defines variables, groupings, and conditions for citation extraction. If not provided, an empty schema will be created that can be configured later.The schema object can contain:
variables: Array of variable definitions for data extractiongroupings: Array of related variable collectionsconditions: Array of conditional logic rules that trigger additional variable extraction
{
"variables": [
{
"name": "Customer Name",
"description": "The full name of the customer",
"type": "string"
},
{
"name": "Customer Email",
"description": "The customer's email address",
"type": "string"
},
{
"name": "Customer Age",
"description": "The customer's age in years",
"type": "number"
},
{
"name": "Interested in Demo",
"description": "Whether the customer wants to schedule a demo",
"type": "boolean"
}
],
"groupings": [
{
"name": "Contact Information",
"variables": [
"Customer Name",
"Customer Email"
],
"description": "The customer's contact details"
},
{
"name": "Demographics",
"variables": [
"Customer Age"
],
"description": "The customer's demographic information"
}
],
"conditions": [
{
"condition": {
"value": "true",
"operator": "===",
"variable": "Interested in Demo"
},
"variables": [
{
"name": "Demo Preference",
"type": "string",
"description": "Type of demo preferred (in-person, virtual, etc.)"
}
]
}
]
}
Response
The created citation schema object.
Error Responses
{
"status": 200,
"data": {
"id": "6ba7b812-9dad-11d1-80b4-00c04fd430c8",
"name": "Customer Information Extraction",
"description": "Extracts customer demographics and contact information from call transcripts",
"org_id": "9b59f853-c2c7-4e3a-b5d6-8f7e9a1b2c3d",
"schema": {
"variables": [
{
"name": "Customer Name",
"description": "The full name of the customer",
"type": "string"
},
{
"name": "Customer Email",
"description": "The email address provided by the customer",
"type": "string"
},
{
"name": "Interested in Demo",
"description": "Whether the customer wants to schedule a demo",
"type": "boolean"
}
],
"groupings": [
{
"name": "Contact Information",
"variables": ["Customer Name", "Customer Email"]
}
],
"conditions": [
{
"condition": {
"value": "true",
"operator": "===",
"variable": "Interested in Demo"
},
"variables": [
{
"name": "Demo Preference",
"type": "string",
"description": "Type of demo the customer prefers (in-person, virtual, etc.)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Create Citation Schema
curl --request POST \
--url https://api.bland.ai/v1/citation_schemas/ \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"name": "<string>",
"description": "<string>",
"schema": {}
}
'import requests
url = "https://api.bland.ai/v1/citation_schemas/"
payload = {
"name": "<string>",
"description": "<string>",
"schema": {}
}
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({name: '<string>', description: '<string>', schema: {}})
};
fetch('https://api.bland.ai/v1/citation_schemas/', 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/citation_schemas/",
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([
'name' => '<string>',
'description' => '<string>',
'schema' => [
]
]),
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/citation_schemas/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\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/citation_schemas/")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v1/citation_schemas/")
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 \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"schema\": {}\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"data": {
"id": "6ba7b812-9dad-11d1-80b4-00c04fd430c8",
"name": "Customer Information Extraction",
"description": "Extracts customer demographics and contact information from call transcripts",
"org_id": "9b59f853-c2c7-4e3a-b5d6-8f7e9a1b2c3d",
"schema": {
"variables": [
{
"name": "Customer Name",
"description": "The full name of the customer",
"type": "string"
},
{
"name": "Customer Email",
"description": "The email address provided by the customer",
"type": "string"
},
{
"name": "Interested in Demo",
"description": "Whether the customer wants to schedule a demo",
"type": "boolean"
}
],
"groupings": [
{
"name": "Contact Information",
"variables": ["Customer Name", "Customer Email"]
}
],
"conditions": [
{
"condition": {
"value": "true",
"operator": "===",
"variable": "Interested in Demo"
},
"variables": [
{
"name": "Demo Preference",
"type": "string",
"description": "Type of demo the customer prefers (in-person, virtual, etc.)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}