Citation Schemas
Update Citation Schema
Update an existing citation schema’s name, description, or schema configuration.
PATCH
/
v1
/
citation_schemas
/
Update Citation Schema
curl --request PATCH \
--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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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 => "PATCH",
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("PATCH", 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.patch("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::Patch.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": "3f4a2b1c-8e9d-4c7f-b2a1-5e8d9c7f6a2b",
"name": "Enhanced Customer Information Extraction",
"description": "Extracts comprehensive customer demographics, contact information, and lead qualification data from call transcripts",
"org_id": "7c8b9a2d-3e4f-5c6b-8a9d-2e3f4c5b6a7c",
"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": "Phone Number",
"description": "The customer's phone number",
"type": "string"
},
{
"name": "Lead Score",
"description": "Numeric score indicating lead quality (1-10)",
"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", "Phone Number"]
},
{
"name": "Lead Qualification",
"variables": ["Lead Score", "Interested in Demo"]
}
],
"conditions": [
{
"condition": {
"value": "5",
"operator": ">=",
"variable": "Lead Score"
},
"variables": [
{
"name": "Follow-up Priority",
"type": "string",
"description": "Priority level for follow-up (high, medium, low)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}
Headers
Query Parameters
Body Parameters
The updated JSON schema configuration for citation extraction. This completely replaces the existing schema configuration.The schema object can contain:
variables: Array of variable definitions for data extractiongroupings: Array of related variable collectionsconditions: Array of conditional logic rules
{
"variables": [
{
"name": "Customer Name",
"description": "The full name of the customer",
"type": "string"
},
{
"name": "Lead Score",
"description": "Numeric score indicating lead quality (1-10)",
"type": "number"
}
],
"groupings": [
{
"name": "Lead Information",
"variables": ["Customer Name", "Lead Score"]
}
],
"conditions": []
}
At least one field (name, description, or schema) must be provided in the request body.
Response
The updated citation schema object.
Error Responses
{
"status": 200,
"data": {
"id": "3f4a2b1c-8e9d-4c7f-b2a1-5e8d9c7f6a2b",
"name": "Enhanced Customer Information Extraction",
"description": "Extracts comprehensive customer demographics, contact information, and lead qualification data from call transcripts",
"org_id": "7c8b9a2d-3e4f-5c6b-8a9d-2e3f4c5b6a7c",
"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": "Phone Number",
"description": "The customer's phone number",
"type": "string"
},
{
"name": "Lead Score",
"description": "Numeric score indicating lead quality (1-10)",
"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", "Phone Number"]
},
{
"name": "Lead Qualification",
"variables": ["Lead Score", "Interested in Demo"]
}
],
"conditions": [
{
"condition": {
"value": "5",
"operator": ">=",
"variable": "Lead Score"
},
"variables": [
{
"name": "Follow-up Priority",
"type": "string",
"description": "Priority level for follow-up (high, medium, low)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
Update Citation Schema
curl --request PATCH \
--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.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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 => "PATCH",
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("PATCH", 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.patch("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::Patch.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": "3f4a2b1c-8e9d-4c7f-b2a1-5e8d9c7f6a2b",
"name": "Enhanced Customer Information Extraction",
"description": "Extracts comprehensive customer demographics, contact information, and lead qualification data from call transcripts",
"org_id": "7c8b9a2d-3e4f-5c6b-8a9d-2e3f4c5b6a7c",
"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": "Phone Number",
"description": "The customer's phone number",
"type": "string"
},
{
"name": "Lead Score",
"description": "Numeric score indicating lead quality (1-10)",
"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", "Phone Number"]
},
{
"name": "Lead Qualification",
"variables": ["Lead Score", "Interested in Demo"]
}
],
"conditions": [
{
"condition": {
"value": "5",
"operator": ">=",
"variable": "Lead Score"
},
"variables": [
{
"name": "Follow-up Priority",
"type": "string",
"description": "Priority level for follow-up (high, medium, low)"
}
]
}
]
},
"created_at": "2023-12-15T14:30:00.000Z"
},
"errors": null
}