Library
List Scenario Folders
See which folder each of your agents’ scenarios is filed in.
GET
/
v2
/
agents
/
library
/
scenario-folders
List Scenario Folders
curl --request GET \
--url https://api.bland.ai/v2/agents/library/scenario-folders \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/library/scenario-folders"
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/library/scenario-folders', 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/library/scenario-folders",
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/library/scenario-folders"
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/library/scenario-folders")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/library/scenario-folders")
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": "b5154820-6f11-4886-8523-d896934528ae",
"node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
"folder_id": "6f0e2a6c-1d3b-4f6e-9a57-2c8d1e4b7a90"
}
],
"errors": null
}
Overview
Returns one entry for every scenario your organization has filed in a folder. The list is flat: each entry names one scenario and its folder. It doesn’t list folders, and it doesn’t group scenarios by folder. Scenarios you haven’t filed are left out, so the list is empty until you file one with File Scenario in Folder. Migrating a pathway into an agent doesn’t file its scenarios. Entries for deleted agents are left out, but an entry stays when its scenario is removed from an agent, so match entries against List Library Scenarios. Call it withpaginate=true and walk every page, or you’ll miss agents past the first 50. An entry for a node that isn’t in the agent’s latest saved version won’t match until that version is saved.
To list, create, rename, or delete folders, use the folder endpoints, such as Get All Folders and Create Folder. Deleting a folder takes every scenario filed in it out of the folder.
Restricted API keys can’t call this endpoint. Use a full-access key.
Headers
Response
One entry per filed scenario.
Show entry
Show entry
The scenario’s node ID: the
id of a scenario from List Library Scenarios.{
"data": [
{
"agent_id": "b5154820-6f11-4886-8523-d896934528ae",
"node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
"folder_id": "6f0e2a6c-1d3b-4f6e-9a57-2c8d1e4b7a90"
}
],
"errors": null
}
Docs for agents: llms.txt
Was this page helpful?
⌘I
List Scenario Folders
curl --request GET \
--url https://api.bland.ai/v2/agents/library/scenario-folders \
--header 'authorization: <authorization>'import requests
url = "https://api.bland.ai/v2/agents/library/scenario-folders"
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/library/scenario-folders', 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/library/scenario-folders",
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/library/scenario-folders"
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/library/scenario-folders")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bland.ai/v2/agents/library/scenario-folders")
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": "b5154820-6f11-4886-8523-d896934528ae",
"node_id": "00fa3bcf-56f5-45b9-8996-427d57b091b7",
"folder_id": "6f0e2a6c-1d3b-4f6e-9a57-2c8d1e4b7a90"
}
],
"errors": null
}