# CLAUDE Source: https://docs.bland.ai/CLAUDE # Mintlify documentation ## Working relationship * You can push back on ideas. This can lead to better documentation. Cite sources and explain your reasoning when you do * ALWAYS ask for clarification rather than making assumptions * NEVER lie, guess, or make up anything ## Project context * Format: MDX files with YAML frontmatter * Config: docs.json for navigation, theme, settings * Components: Mintlify components * `llms.txt` at the repo root is a hand-maintained index of every page (one bullet per page) plus a curated "About Bland" intro and "Instructions for AI Agents" section. It is not auto-generated. Keep it in sync (see below) ## Content strategy * Document just enough for user success. Not too much, not too little * Prioritize accuracy and usability * Make content evergreen when possible * Search for existing content before adding anything new. Avoid duplication unless it is done for a strategic reason * Check existing patterns for consistency * Start by making the smallest reasonable changes ## docs.json * Refer to the [docs.json schema](https://mintlify.com/docs.json) when building the docs.json file and site navigation * Every new page must be added to `docs.json` navigation. A page not in navigation is unreachable ## llms.txt maintenance Update `llms.txt` whenever you make a structural change to the docs, so AI tools and crawlers stay in sync with the site: * **Add a page**: add a bullet under the matching section in the format `- [Title](https://docs.bland.ai/.md): one-line description.` Match the page's frontmatter title and description * **Remove a page**: delete its bullet * **Rename, move, or repurpose a page**: update the affected URL, title, and description * Keep the section a page lives under in `llms.txt` consistent with its group in `docs.json` * You do not need to touch `llms.txt` for copy-only edits (typos, rewording) that leave the page's title, description, and path unchanged * Changelog pages (`changelog/*`) are intentionally excluded from `llms.txt`. Do not add them ## Frontmatter requirements for pages * title: Clear, descriptive page title * description: Concise summary for SEO/navigation ## Writing standards * Second-person voice ("you") * Prerequisites at start of procedural content * Test all code examples before publishing * Match style and formatting of existing pages * Include both basic and advanced use cases * Language tags on all code blocks * Alt text on all images * Relative paths for internal links ## Punctuation and house style * NEVER use em dashes (`—`) or the `—` entity. Rewrite the sentence, or use a colon, period, comma, or parentheses instead * Avoid en dashes (`–`) in prose; use "to" for ranges (for example "5 to 10 minutes") * Use straight quotes and apostrophes, not curly ones * Prefer short, direct sentences over long ones stitched together with dashes or semicolons ## Verify before committing * Run `mint dev` locally and confirm changed pages render without errors (install with `npm i -g mint`) * Run `mint broken-links` and fix any broken internal links before opening a PR * Run `mint a11y` to catch missing alt text and contrast issues on pages you touched * Confirm new pages appear in the navigation and in `llms.txt` ## Git workflow * NEVER use --no-verify when committing * Ask how to handle uncommitted changes before starting * Create a new branch when no clear branch exists for changes * Commit frequently throughout development * NEVER skip or disable pre-commit hooks ## Do not * Skip frontmatter on any MDX file * Use absolute URLs for internal links * Use em dashes anywhere in docs content * Include untested code examples * Leave a new page out of docs.json navigation or llms.txt * Make assumptions. Always ask for clarification # Agent builder Source: https://docs.bland.ai/agents/agent-builder Build an agent end to end: prompts, variables, pathways, tools, knowledge, settings, and publishing The agent builder is where you describe what your agent does and how it behaves. An agent is a single thing to build, test, and publish: its instructions, the tools and knowledge it can reach, and the branches of behavior it needs. Most agents start as a single prompt. You add structure only where the conversation needs it, rather than starting from a graph and filling it in. The examples here build a front desk agent for Northwind Dental, a fictional practice. ## Prerequisites * A [Bland account](https://v2.app.bland.ai/signup) * An agent to work in, from **Overview** or from [Build your first agent](/build-your-first-agent) * For an existing pathway or persona, [Migrate to agents](/platform/migrate-to-agents) first ## Find your way around Open an agent and everything you need is already on screen. The sidebar switches to that agent's own sections, and to its right there are three regions. **Agent and Guardrails**, across the top. Agent is where you build. Guardrails is where you set rules that are checked on every call. **The agent itself**, filling the middle. Two tabs, **Prompt** and Settings, and almost everything in this guide happens on Prompt. It runs top to bottom as: 1. **Prompt**, what the agent should accomplish 2. **System prompt**, how it comes across 3. **Variables to extract** 4. Pathways 5. Tool references and Knowledge references **The graph**, on the right. A picture of how the agent fits together, and where you test it. ## The two prompts An agent has two prompt fields, stacked one above the other on the Prompt tab. Knowing which is which saves the most time later, and the product states the difference up front: scope. Each field's description opens with a label that says where it applies. **Prompt** is the first field. Its description reads "Applies to this node" and then "Define the goal and instructions." This is what the agent is trying to do and how it should get there: how it opens, what it asks, where it routes. **System prompt** is directly below it. Its description reads "Applies to every node" and then "Set the personality, tone, and communication style." Tone, formality, how much it says at once. The distinction that matters is **this node** against **every node**. The first applies while the conversation is here. The second applies everywhere, including inside every pathway. > [!NOTE] > > Only the first field supports `@` tagging. The system prompt is agent-wide configuration with no node to hang a tool on, so tools and knowledge are tagged in the **Prompt** field. ## Write the prompt Both prompt fields are rich text editors. The empty **Prompt** field opens with "Your goal is to help the caller accomplish...", which is a sentence to finish rather than an instruction to start one. Write in plain language. Describe the job, the order things should happen in, and what the agent should do when the caller goes sideways. You do not need to script exact wording, and agents generally sound better when you do not. ### Tag tools and knowledge with @ Type `@` in the prompt to reference a tool or a knowledge source by name. `@check-calendar` tells the agent this is the moment to check the calendar. The same works for knowledge: `@service-menu` points it at that source. Two sections below list what the agent currently has: * Tool references, with the hint "Give your agent tools by tagging them with @tool-name in the prompt", plus **View all** and **Create tool**. * Knowledge references, with the hint "Give your agent knowledge by tagging sources with @source-name in the prompt", plus **View all** and **Upload source**. The Prompt hint reads "Tools and knowledge only reach the agent when you @mention them." That is exactly right for tools. For knowledge it is stricter than the product, as the next two paragraphs explain. Creating is not attaching. Building a tool with **Create tool**, or uploading a file with **Upload source**, adds it to your library and nothing more. The agent cannot see it yet. For tools, tagging is the only way, and it is per prompt. A tool that is not tagged in the Prompt field is not available during the call. Tagging also attaches a copy rather than a link, which matters every time you edit a tool after tagging it. See [Tag a tool into a prompt](/agents/tools#tag-a-tool-into-a-prompt). For knowledge, there is a second path. A source can also be attached to the agent from the [Knowledge](/agents/knowledge) page, and an attached source is available whether or not you tag it. Tagging still helps, because it tells the agent where in the conversation you expect the source to matter. > [!WARNING] > > Building a tool without tagging it fails silently. The tool saves, Tool references stays empty, and the agent behaves as though it does not exist, with nothing on screen to say why. > > A knowledge source uploaded and never tagged is a different case. It is in your library and not yet on any agent, and the fix is to attach it on the [Knowledge](/agents/knowledge#attach-a-source-to-an-agent) page rather than to tag it. ## Extract variables **Variables to extract** holds key and value pairs the agent pulls out of the conversation and reuses later in the same call. A caller's name, a date they asked for, a member number. The section says so plainly: "Key:value pairs the agent extracts to reuse during the conversation. Adds turn latency." Take that last part seriously. Every variable is work the agent does mid-conversation, and each one costs a little response time. Extract what you will use. Skip what you will not. ## Extend the agent with pathways A single prompt handles a surprising amount. When it stops being enough, pathways carry the parts that need their own handling. The section describes them as extending your core agent's skills. > [!NOTE] > > Searching for scenarios? They are called pathways now. If you were looking for simulated testing, that is [simulations and test cases](/agents/evaluations). Add one with **New pathway**. The menu offers three kinds to create, plus **Add existing** to reuse a pathway from this agent or another one. ### Prompt A single prompt for one job, like booking an appointment or handling a cancellation. Think of it as one focused instruction the agent moves into and back out of. Prompts are also how you manage context. Splitting scheduling out of the main prompt keeps the agent from carrying scheduling instructions through every unrelated conversation. ### Pathway A flow you lay out yourself: steps you place, and the pathways you draw between them. Opening one turns the graph column into the canvas where you build it. Custom code and webhook steps are available here. Choose this when the steps have to happen in a guaranteed order: a scripted disclosure, a verification sequence, anything you need to be able to point at and prove ran the same way every time. If the canvas gets cluttered, click **Auto layout** in the canvas toolbar. It rearranges every card into a top-to-bottom layout with nothing overlapping. The new layout saves like any other edit, and **Undo** puts the cards back where they were. ### Authentication zone A gate. It has the steps a pathway has, plus identity questions. On enterprise plans it also offers an SMS code step; on other plans that step is not in the menu. In the Pathways list, drag other pathways underneath an authentication zone to protect them. A caller then has to get through authentication before the agent will move into anything beneath it. Use it for anything that exposes account details. ### Set the routing condition Creating a pathway does not make it run. Click its row in the Pathways section to open it, then set its **Routing condition**, which decides when the conversation enters it. Without one, the agent has no reason to hand off, and the pathway never fires. A Prompt opens in a panel, so you stay where you are. A Pathway or an Authentication zone opens into its own canvas, with the routing condition on a panel beside it. ## Configure settings The Settings tab holds the rest of what is true of the agent rather than of one conversation: display name, voice, language, memory, and metadata. The tab runs: name, voice and languages, channels, memory, metadata, and request data. Request data is the pair to Variables to extract: facts you hand the agent before the call rather than ones it works out during it. ### Rotate voices across calls To vary how the agent sounds from call to call, open the **Voice** dropdown and check **Select multiple voices** at the top. Then select up to 20 voices. The closed field lists your picks, such as "Allie, Maya, and Josh". On every real inbound and outbound call, Bland picks one voice from the list at random. If a voice was deleted or your organization can no longer use it, Bland skips it. If none of the voices are usable, the call uses the first voice you picked. * Test runs and previews always use the first voice you picked. Only real calls rotate. * If an outbound call request sets its own `voice`, that voice is used instead of the rotation. * Uncheck **Select multiple voices** to go back to one voice. The agent keeps your first pick. > [!WARNING] > > A new agent opens with **memory on** and **call recording on**. > > Memory writes facts about the person into their contact record. Turning it off later stops further extraction but does not delete what was already written. Recording is under **Advanced settings**, as **Disable recording (PCI compliance)**. > > Both are worth a deliberate decision before the agent takes a real call. With memory on, a memory schema section appears below the toggle, where you define what the agent should remember about a person. The contact records themselves live under **Contacts**, a tab on [Conversations](/agents/conversations). Advanced settings also cover context management, excluding responses from logs, and image sending. ### Delete an agent Open the agent, go to the Settings tab, and scroll to the bottom. The **Delete agent** box is the last thing on the tab, below every other setting. Click **Delete**, then click **Delete agent** in the **Delete this agent?** dialog. The dialog warns that this can't be undone. After the delete, Bland returns you to the dashboard home page. To delete an agent with the API, use [Delete Agent](/api-v2/delete/agents-id). That page also lists what Bland keeps after an agent is deleted. ## Guardrails **Guardrails** is the second tab at the top of the builder, beside Agent. A guardrail is a rule checked live during the call. You can attach an action for when one is tripped: end the call, transfer it, or move to a specific step. An action is optional, and with none attached the violation is recorded and the call continues. Four built-in guardrails cover the standard TCPA disclosures: AI disclosure, recording disclosure, self introduction, and opt out. Each is a switch, and a new agent starts with all four off. The first three also take a window, the number of seconds by which the agent must have said it, defaulting to 30. Built-in guardrails are available on every plan. You can also write custom guardrails, which require an enterprise plan. > [!NOTE] > > Guardrails are monitoring. They do not guarantee regulatory compliance, and they are not a substitute for your own legal review of how you use the product. ## Test as you build The right side of the builder toggles between **Graph** and Testing. At the top level the graph is a fixed picture of how the agent is put together, not an editing surface, which is why testing can take its place. Open a Pathway or an Authentication zone and that same column becomes the editable canvas where you build its nodes and edges. Testing has two tabs: * **Manual** is the build loop. Talk to the agent yourself, watch the debug logs as it works, change something, try again. To dig into one answer, open it in [Testbed](/agents/testbed) from the test-tube icon in the chat header or beside the turn. * **Simulation** runs saved test cases and scores them with judges. That is covered in [Evaluations](/agents/evaluations), where test cases and judges are built. Test manually while you are shaping behavior. Move to simulation once the behavior is roughly right and you want to know whether a change broke something that used to work. ## Publish and promote Moving an agent into service takes two steps, and they are separate on purpose. The environment selector at the top right shows which environment you are looking at, starting at Development. **Publish** moves Development to Staging. It asks for a version number: patch, minor, or major. Bland keeps every version, so you can see what changed and go back. **Promote** moves Staging to Production. Switch the environment selector to Staging and the Publish button becomes **Promote**. You can also promote from the [Environments](/agents/environments) page. > [!WARNING] > > An agent that has not been promoted to Production will not answer calls. > > This is the single most common reason a new agent does not pick up. The configuration is saved, the number is attached, and the call still fails, because Production has nothing pinned to it. Publishing alone is not enough. If evaluations are configured on Staging, publishing runs them first. Your changes are saved as a version either way, but the version is only numbered and pinned to Staging once every required evaluation passes. A blocked publish leaves the version on Development, where you can fix it and try again. Checks take minutes, so the publish dialog closes rather than waiting. The result appears on the Checks card on the [Environments](/agents/environments) page. > [!NOTE] > > Publishing moves you to Staging, which is read-only. A banner offers **Switch to Development**, and that is where you go to keep editing. A promoted agent still needs somewhere to receive conversations. See [Dispatch](/agents/dispatch) for attaching a phone number and choosing channels. ## Common failures > [accordion] The agent does not answer the phone > > Almost always an agent that was published but never promoted. Promote it to Production from [Environments](/agents/environments), then redial. > [accordion] A pathway never runs > > Check its routing condition. A pathway with no condition has nothing telling the agent to enter it. > [accordion] The caller gets stuck partway through > > Usually a node in a pathway with no exit route. Open the pathway and check that every node has somewhere to go. > [accordion] The agent never uses a tool you built > > Tag it in the prompt. Building a tool does not give it to the agent, and a tool that is not tagged is not available during the call. > [accordion] The agent answers slowly > > Check how many variables you are extracting. Each one adds latency to the turn it runs on. ## Next steps > [card] [Tools](/agents/tools) > > Build the tools your agent calls, and store the secrets they need. > [card] [Knowledge](/agents/knowledge) > > Add sources your agent answers from, and test what it retrieves. > [card] [Dispatch](/agents/dispatch) > > Attach a phone number, pick channels, and put the agent into service. > [card] [Environments](/agents/environments) > > Promote to production, and see how environments relate to agent versions. > [card] [Evaluations](/agents/evaluations) > > Run judges and test cases as a check before you promote. > [card] [Migrate to agents](/platform/migrate-to-agents) > > Move an existing pathway or persona onto an agent. Docs for agents: [llms.txt](/llms.txt) # Conversations Source: https://docs.bland.ai/agents/conversations Find, read, and export every conversation your agents have had, across phone, messaging, and web chat Conversations is the record of everything your agents have done. Every call, every message thread, every web chat, in one list you can filter, read, and export. It is where you go when something went wrong and you need to know exactly what was said. > [!NOTE] > > Searching for call logs? This is it. A call is a conversation now, and the separate lists for calls, messages and web chat are one list. ## Prerequisites * An agent that has taken at least one conversation, from [Dispatch](/agents/dispatch) ## Where conversations live Conversations appears at two scopes, under Monitor in the sidebar. The selector at the top of the sidebar decides which one you are on. It reads All agents for the whole organization, or the agent's name when you are inside one. | Scope | Tabs | | - | - | | **All agents** | Conversations, Active, Contacts | | Inside an agent | Conversations, Contacts | Active is at All agents only: the stream behind it has no per-agent view. Web chat appears only on its agent's Conversations tab, not at All agents. ## What a row is One row is one conversation. A voice row is one call. A messaging or web chat row is one thread, which already covers every message in it. The Channel column tells you which kind you are looking at, and Length follows it: `4:12` for a call, `9 msgs` for a thread. ### Chronological and Threaded The two tabs on the right of the toolbar change how the list is drawn, and it opens on **Chronological**: newest first, one flat row per conversation. Threaded groups conversations by the person on the other end, using the last ten digits of their number, so a call and an SMS to the same number sit together. Each group lands where its newest member would have been. Inside it, members run oldest to newest, joined by a connector line. Threaded ignores the Sort control: groups are always newest first. Changing the sort still changes which rows load, so the list can shift under you without reordering. It still draws one row per conversation. Threading changes the order, not the unit. ### Calls in progress A call shows up in Conversations while it is still happening. You do not have to wait for it to end. This works at All agents, inside an agent, and in the conversations on the overview page. The list refreshes every five seconds while it is on screen, so new calls appear without a reload. When a call ends, its completed record replaces the in-progress row, so the call is never listed twice. > [!NOTE] > > Threading happens in your browser, over the rows already loaded. A conversation on a page you have not scrolled to yet is not in the group. > > Scroll further, or use **Load more**, before you conclude that someone only called once. ## Find a conversation The list opens on the newest conversations and pages as you scroll, with a **Load more** button under the table. There is no date filter, so reaching something from last week means loading your way back to it. Five controls narrow the list, and a sixth changes how it is sorted and what it shows. Some search everything you have; others only look at the rows already on screen, which is called out below where it matters. ### The search box Searches the rows already loaded, across the contact's number, the contact's name, the pathway name, and the conversation ID. An agent's name on a call is not in that list. Use the Agent filter for that. It does not search transcripts. For that, open a conversation and use the search field inside it. If you know the conversation exists and search finds nothing, it is almost always still unloaded. Press **Load more** and search again. ### Agent Pick one agent or several, and the list narrows to their conversations. It only exists at All agents. Inside an agent you are already narrowed to one. ### Call source The select beside the search box reads Live calls, and that is a filter. > [!WARNING] > > Simulated calls are hidden by default. > > Change Call source to **Simulated calls** or **All calls** to see them. A simulated row carries a Simulated badge in the Contact column. That is the only place it is marked, so hiding the column hides the badge. > > Picking **Simulated calls** also empties the list of message threads and web chats, because simulations are voice only. ### Filter The **Filter** button opens a condition builder. The channel select inside it covers every conversation. The conditions under it only apply to the rows already loaded. Add conditions on Status, Direction, Escalation, QC tags, or Contact. With more than one you get an **All** and **Any** switch, and it starts on All. Direction and QC tags only carry data on calls, so a positive condition on either drops every message thread and web chat from the list. The status filter offers seven values and the list can show more than that. A status the chip does not recognize reads **No Answer**, so filter on Status to narrow, not to conclude. Name a set of conditions under **Saved filters** and it stays in this browser. ### Saved views The chips above the toolbar are one-click filter presets. Two ship with the product: **Failed & No-Answer** and **Escalated**. A view you create lives for one page load. If you want to keep it, build it under **Filter** as a saved filter instead. ### Sort and columns Sorting is behind the Sort button, not the column headers. Clicking a header does nothing. There are two fields to sort on, Started and Last activity, and a **Newest** and **Oldest** switch. The **Columns** button shows all twenty, eleven of them on to start with. Of the nine that are off: | Column | Why you would turn it on | | - | - | | **To** and **From** | The literal numbers on the record. **Contact** shows the other party, which is usually what you want, but not when you are chasing a specific line. | | **Dispositions** | What each call's dispositions produced, when you are auditing a batch without opening each one. | | **QC tags** | Your own review tags, when you are working a review queue off the list. | | **Error** | Why a failed call failed, without opening it. | | **Batch ID** | Which batch a call came from, when one batch behaved differently from the rest. | Turning on **Dispositions** adds one column per key your agent's dispositions produce, headed by the key. When two dispositions share a key, the column title starts with the disposition name. Each cell holds the value the call's latest run produced for that key, or **Pending**, **No value**, **Error**, or **Cancelled**. A single **Dispositions** column of tag badges also appears while any call in view has legacy outcomes, or while there are no key columns yet. Your choice is stored in this browser, not on your account. ## Read a conversation Click a row and a panel opens on the right. The page behind it stays live, so you can keep working the list. Drag the left edge to make it wider, and use the chevrons at the top to step to the previous or next conversation in the list you filtered. The copy icon in the panel header offers **Copy Conversation ID**, and on a call **Copy all Logs**, which is a raw JSON dump rather than a readable transcript. **Copy transcript** beside it works on message threads and web chat. On a call it stays disabled: a call's words live in the timeline, which has a search of its own. On a call there is also a **Flag**, the same one as on the row. ### A call The middle of the panel is the call itself: an event strip across the top, the timeline under it, and the recording pinned to the bottom if there is one. Click an event in the strip and both the timeline and the audio jump to it. Click an agent or caller message in the timeline and the recording jumps to where that turn starts. This works before you press play, too. The timeline has its own search, and on a call that ran a pathway it has three views: Transcript, Detail, and Logs. It opens on Transcript. Hover a turn and the actions it supports appear, up to four of them. | Action | What it does | | - | - | | Raw LLM context | Shows exactly what the agent was given to work from. | | Edit node | Takes you to the step in the [agent builder](/agents/agent-builder) that produced the turn. | | Open turn in Testbed | Opens [Testbed](/agents/testbed) pinned to that node, with that turn's input. | | Report transcription issue | For when the words on screen are not the words that were said. | ### A message thread or web chat You get the transcript, with speakers labelled Agent, User, and Rep. A web chat thread loads newest first, with **Load earlier messages** above it. On a message thread you can also step in yourself, on an enterprise plan. **Take over** hands the conversation to you and pauses the agent. The agent stays paused until you press **Return to agent**. You can also send one message as a human and leave the agent running. **End** closes the thread. A message that failed to send can be retried from its own bubble. ### The right-hand column Only Metadata starts open, and it is the one that answers how the conversation went. It holds the ID, the channel, the direction, the agent, when it started and ended, and a written summary at the end. Duration and cost are on calls; a message count is on threads. Notes, Memory, Pathway Tags and QC Tags follow it, closed, and carry what you and the agent put there. On a call, **Dispositions** lists each disposition that ran on it. Under the disposition name, a callout says what intelligence its values ran at, such as **Low**, **High**, or **Low + High** when values differ. It also says whether results arrive in realtime or within 24 hours. Below the callout, each key sits beside the value the run produced. A run still in progress reads **Running on…** and shows its keys as **Pending**. Legacy outcome tags stay listed underneath. If the section fails to load, select **Retry**. Three more sections are there and stay empty: Variables, Guardrails & Alerts and Metrics. Nothing writes to them. Three things here sound alike and are not. The Dispositions section and columns are what your dispositions produced for the call. Status is whether it connected at all. The Disposition row inside Metadata is a messaging-thread field and is not on a call. Notes are voice only. Hide the whole column with the panel toggle at the top when you want the transcript full width. ### Open in Testbed The test-tube icon in the panel's top bar opens the whole conversation in [Testbed](/agents/testbed). It is an icon rather than a labelled button, and it appears on calls only. There is also a **Testbed** button in the list toolbar, which opens it empty. ## Flag what needs looking at Every voice row has a **Flag** button at the far right, and the same button is in the panel header. Flagging either opens a new issue, which takes a name, a severity, a description and a note, or adds the call to one that already exists, which still takes a note. The note is required on both, and the submit button just stays disabled until you write one. To do several at once, tick the rows and use **Add to Issue** in the bar that appears at the bottom. That is a different, shorter form: a new issue there takes only a title. Issues hold calls, so any message threads in your selection are counted and skipped. An issue you create from a call belongs to the agent that handled that call. To see one agent's issues, open the agent and select **Issues**. The Issues page in the sidebar still shows every issue in your org. ## Export conversations The download icon in the toolbar opens **Export conversations**. > [!WARNING] > > The export is not what is on your screen. > > It runs on the server, over the date range you pick, and it keeps only the filters the server knows about: call source, agent, channel, and batch. Your search box, your conditions, and your saved view are applied in the browser, so none of them reach the export. The modal lists what it did inherit under **Filters applied to this export**, so read that before you press the button. > > Filter down to twelve failed calls, press Export, and you get every conversation in the window. Calls and message threads export as separate files. Pick one under **Data to export**. There is no web chat export. The rest of the modal is the date range, the timezone it is read in, the email address the file goes to, and **Exclude columns** for trimming the file. The range defaults to the last 30 days and cannot exceed 180. Transcripts are excluded from a call export by default, because they are enormous. You do not get a download. The job runs in the background and emails you a link when it finishes. ## Look up a contact **Contacts** is the people on the other end, built up as they interact with your agents. One row per person, with how many messages they have sent, how many of your agents they have met, and what the agent remembers about them. This tab is organization-wide even when you open it inside an agent. Click a row for the profile: their details in your organization's own schema, then Memory, Agents, Timeline, CRM, and Raw. **Profile** in the header edits the schema itself, the fields every contact record carries and the patterns they are validated against. **CRM sync** connects HubSpot or Salesforce over OAuth and keeps them fed: contact identity, summaries, memory entities, deals and opportunities, and interaction history, each switchable on its own. > [!NOTE] > > Memory belongs to the contact, not to any one conversation. A conversation's own Memory section shows only what that conversation contributed. ## Watch calls in flight Active is the calls happening right now, at All agents only. ID, status, a duration that ticks, from, to, and the objective. Click a row for a live transcript as it happens. You can also listen in, which is an organization setting: if it is off you get a padlock and a link to turn it on. Calls in progress also appear on the Conversations tab, at both scopes. Use Active when you want the live transcript or to listen in. With nothing running, the empty state offers to call your own number, which is the fastest way to watch the tab work. ## Common failures > [accordion] A conversation you know happened is not in the list > > Three things hide conversations by default. Call source is on Live calls, so simulations are out. A web chat only appears inside its agent, not at All agents. And the list pages as you scroll, so something older may not be loaded yet. Change Call source, switch the selector to the agent, or press **Load more**. > [accordion] Search does not find a phrase you remember > > The search box matches the contact and the conversation ID, on rows already loaded. It does not search transcripts. Open a conversation and use the timeline's search. > [accordion] Clicking a column header does nothing > > Use the Sort button instead. It sorts on Started or Last activity. > [accordion] A column is always blank > > Issues does not fill in yet, even on a call you have flagged. Turn it off under **Columns**. A flagged call is not marked on this list at all: to see what you have flagged, go to Issues in the sidebar. > [accordion] A saved view you made is gone > > Saved views live for one page load. Rebuild it under **Filter**, as a saved filter, which persists in this browser. > [accordion] The export has far more in it than the list showed > > Expected. The export keeps only call source, agent, channel and batch. Narrow the date range in the modal, and filter the file once it arrives. > [accordion] A row reads No Answer and you know the call connected > > The status chip falls back to **No Answer** for any status it does not recognize. Open the conversation and read Metadata for what actually happened. ## Next steps > [card] [Testbed](/agents/testbed) > > Take a conversation that went wrong and work on the step that caused it. > [card] [Evaluations](/agents/evaluations) > > Turn a conversation into a test case that runs before you promote. > [card] [Knowledge](/agents/knowledge) > > Answer the questions these conversations show your agent could not. > [card] [Dispatch](/agents/dispatch) > > Phone numbers and channels, which decide what lands here. > [card] [Agent builder](/agents/agent-builder) > > Change the prompt, the variables, or the guardrails a conversation showed you. Docs for agents: [llms.txt](/llms.txt) # Dispatch Source: https://docs.bland.ai/agents/dispatch Put a published agent into service: attach a phone number, set how it behaves on each channel, and run batches Dispatch is how work reaches an agent. A caller dials your main line and the agent picks up, or you hand it a list of four hundred numbers and it starts dialing. You get a number, attach it to an agent, and publish. ## Send an outbound call through the API To run a Bland Agent and associate the conversation with it, send `agent_id` to `POST /v1/calls`. Choosing an agent's phone number as `from` does not select the agent for the call. Before sending, [choose agent, persona, or pathway dispatch](/api-v1/post/calls#choose-what-runs-your-call) and verify the exact ID and environment or version. Keep an established choice for the same task; ask if the route is ambiguous or unavailable. After an agent call, verify it appears under that agent's Conversations view. ## Where Dispatch lives What Dispatch holds depends on the scope you are in. The selector at the top of the sidebar sets it: All agents for the whole organization, or the agent's name when you are inside one. | Scope | Dispatch holds | | - | - | | **All agents** | Phone numbers, Triggers, Batches | | Inside an agent | Channels, Triggers, Identity, Batches | Identity, and the Messages tab inside Channels, are enterprise only. On other plans they are hidden rather than locked. Phone numbers and Channels both deal with numbers, and you never see both at once: * Phone numbers, at All agents, is the inventory. Get a number, name it, and decide which agent it belongs to. * Channels, inside an agent, is the behavior. How that agent answers, what it does on messages, what its web chat looks like. Buying a number is an All agents job. From inside an agent you can only attach one that belongs to nobody. > [!NOTE] > > The sidebar remembers the scope you were last in. If you open Dispatch and find Channels instead of Phone numbers, you are inside an agent. Switch the selector to All agents. ## Prerequisites * An agent you have saved at least once in [Agent builder](/agents/agent-builder). A save made on a branch does not count * A payment method, if you are buying a number rather than claiming the free one ## Put an agent on a phone number **1. Switch to All agents** Use the selector at the top of the sidebar. Dispatch now lists Phone numbers. **2. Get a number** Three ways in, cheapest first. The free one. A new organization gets one. If the page carries a banner saying "You have a free phone number available", pick a country, optionally an area code, and press **Activate**. Its absence is not proof you used it, so check your list. Buy one. The **Buy number** button opens a drawer. Pick a country and an area code, choose from the results, and press **Confirm purchase**. United States and Canada only, \$15/month. You need a payment method on file: without one the drawer says so and the confirm button stays disabled. Anywhere else, bring your own. Bring your own. **Connect Twilio** takes an Account SID and an Auth Token. Then press **Import numbers**. **3. Attach it to the agent** Press Configure on the number's row. In the sheet, under **Assignment**, open the **Agent** dropdown. Pick from the Agents section. If your organization still has personas from the prior dashboard there is a Classic agents section too, and picking from there routes the number to one of those instead. Pick **Unassigned** to take the number off its agent. Picking does not save anything yet. The sheet reads Not saved yet until you save at the bottom. **4. Review and save** Scroll to **Review and save**. It lists what is pending, such as the agent change and any settings you edited. Tick the confirmation sentence. It names what happens, for example that assigning the number replaces its current prompt, pathway, webhook, and call behavior. If the number answers a pathway from the prior dashboard, the sentence warns that this dashboard can't put it back. Press **Save**. It stays disabled until you tick the box. Any edit after you tick clears it, so tick again before you save. **5. Publish the agent to production** Attaching a number is not the same as putting the current agent into service. Publish and promote it, from [Agent builder](/agents/agent-builder#publish-and-promote) or [Environments](/agents/environments). It is the most common reason a new number does not behave the way the builder does. You know it worked when the number's Assignment column shows the agent's name, and the agent's Channels page lists the number under Numbers. > [!NOTE] > > A number that belongs to nobody can also be attached from the agent's side. On Channels, **Add a number** lists the ones that belong to nobody, under Attach a number. > > It will not offer a number another agent has, and it cannot buy one. Both of those are jobs for All agents. ## Configure a number Each number carries its own call configuration, separate from the agent's settings. You can edit it from All agents, without opening each agent. This helps when one agent answers many numbers, such as one per location, and each number needs its own data. At All agents, open **Phone numbers** and press Configure on the number's row. The sheet has these sections: | Section | What it covers | | - | - | | **Assignment** | Which agent answers calls and messages on this number. | | **Channels** | Each channel and its status. iMessage and WhatsApp show **Set up** when the agent's Messaging settings can turn them on. Otherwise they read Not supported, with the reason. | | **Call configuration** | Language and time, call data (request data and metadata), webhook and events, dynamic data, and transfers. | | **Call screening** | **Blocked numbers**, which rejects incoming calls from listed numbers before they reach your agent. See [Blocked numbers](/tutorials/blocked-numbers). | | **Review and save** | The pending changes, the confirmation, and **Save**. | Settings changes and an agent change save together, through the same confirmation and **Save** described in [Put an agent on a phone number](#put-an-agent-on-a-phone-number). Settings you change here reach every call to the number, including calls the assigned agent answers. If the agent change saves but the settings do not, the sheet keeps your settings edits. Review them and press **Save** again. The same Call configuration sections are available inside an agent, from the number on its Channels page. ## Set how the agent behaves Switch the sidebar selector back to the agent and open Channels, under Dispatch. It has three tabs, and Messages is enterprise only. | Tab | What it covers | | - | - | | **Calls** | How the agent answers the phone: maximum call length, recording, and what to do with voicemail. | | **Messages** | SMS, RCS and iMessage behavior, set per number. | | **Web chat** | The widget you embed on a site. | The Numbers list sits above the tabs on Calls and Messages, and holds the agent's fallback number. Calls and Messages have no Save of their own. Most of what you set there is held with the rest of your unsaved work in the builder and written the next time it saves, so go back into the builder and save. Reloading the page loses it. There are two exceptions. The widget editor on Web chat has its own **Save**, and **Publish** beside it. The per-number messaging settings below save straight to the number. > [!WARNING] > > Voice settings apply to every number the agent has. Messaging settings are saved separately for each number. ### Per-number messaging settings Select a number in the Numbers list, then open Messages. These rows apply only to the number you selected: | Setting | What it does | | - | - | | **Webhook** | Receives message and status events for SMS conversations on this number. A conversation that sets its own webhook overrides it. | | **Messaging service SID** | Shown only on bring-your-own Twilio (BYOT) numbers, and required for them. Enter the Twilio Messaging Service SID the number sends through. It starts with `MG` and is followed by 32 hexadecimal characters. | | **Reply timeout** | Ends the conversation when the customer does not reply within a set window. See [Reply timeout](#reply-timeout). | Webhook and Messaging service SID save when you press Enter or leave the field. They do not save while you type. iMessage numbers do not show Messaging service SID. #### Reply timeout Turn on **Reply timeout** to end a conversation that goes quiet. Then set: * **Time out (minutes)**: how long the agent waits for a reply, from 1 to 60 minutes. * **Closing message**: sent when the window ends. Leave it blank to end the conversation without a message. * **Send a reminder first**: sends one reminder partway through the window. Set **Remind after (minutes)** to a value shorter than the time out. Then set **Reminder message**. If you leave the reminder message blank, the customer gets nothing, but your webhook still receives a `timeout_warning` event. Sliders save when you release them. Messages save when you leave the field. > [!NOTE] > > Earlier versions of this tab saved reply timeouts that never took effect, and those values were not carried over. If you set one earlier, Reply timeout now shows as off. Turn it on again to use it. #### WhatsApp The WhatsApp drawer sets the number's webhook URL, a reply timeout in seconds, and **Request data**. Request data is a set of key-value facts the agent knows during WhatsApp conversations on that number, like a facility ID or its opening hours. The agent sees both the keys and their values. Select **Save** in the drawer to apply your changes. Messaging and web chat each have a guide of their own: [Messaging](/tutorials/messaging/overview) and the [web chat widget](/tutorials/chat-widget). ## Run a batch Batches dials or texts a list of people with one agent. It is in both sidebars and they are not the same. At All agents you choose the agent and can send calls or messages. Inside an agent, that agent is filled in and locked, and the list shows only its batches. Batches inside an agent are calls only: the SMS option is not there. The wizard runs in three steps, **Recipients**, **Script**, then **Review & send**. **1. Open Batches and press Create Batch** In either sidebar. The button is in the top bar, and in the empty state if you have never run one. **2. Upload a CSV** CSV only. One column has to be called `phone_number`, in exactly that spelling, with one number per row. Numbers need a country code. `+14155550100` works, `4155550100` does not. Every other column is yours. Under **How your columns are used** on the next step, each one gets a dropdown, and **Use as ** makes the value available in the prompt as `{{column_name}}`. Watch the defaults. A column named after a call setting, like `from` or `voice`, defaults to setting that field per call rather than becoming a variable, and it cannot be ignored. Rename the column if you meant it as a variable. **3. Write the script** Pick the agent that staffs the batch and write the instructions for this run. Maximum call length is 1 to 120 minutes, and recording starts on. **4. Review and send** You see the first recipient rendered as the agent will get them. Name the batch here if you want it findable later. Then **Start calling**. > [!WARNING] > > A CSV with one bad row is rejected whole. > > The upload checks every number before the batch exists, names up to three of the bad rows, and counts the rest. > > Duplicates and numbers on your do-not-call list are different: those are dropped at dial time and the rest of the batch runs. Files go up to 125 MB and there is no row limit. Anything over 1,000 calls runs in chunks. ### Watch one run The list shows Status, **Name**, **Batch ID** and **Created**, newest first with the active ones on top. There is no search and no filter. A row carries two icon buttons with no labels. The first opens [Conversations](/agents/conversations) already filtered to that batch. The second stops the calls that have not been placed yet, and asks first. Select a row for the detail panel, which adds the event log. It carries its own **Stop Batch**, and that one fires straight away with no dialog. | Status | What it means | | - | - | | **Initializing** | The batch exists and has not started. | | **Validating** | Checking and de-duplicating your rows. | | **Dispatching** | Calls are going out. | | **In Progress** | Calls are placed and running. | | **Completed** | Finished. | | **Completed Partial** | Ended early, usually because you stopped it. | | **Failed** | Ended on an error. | | **Unknown** | A batch past its first thousand calls, still running. | ## Triggers A trigger watches for an event in Bland or in a connected app, and runs an action when it happens. One of the actions is placing a call, which is how a trigger starts a conversation without you pressing anything. It is in both sidebars. See [Triggers](/agents/triggers). ## SIP SIP is the second tab of Phone numbers, so it is at All agents only. It is not in an agent's sidebar at all. See [SIP](/agents/sip). ## Common failures > [accordion] Dispatch shows Channels, not Phone numbers > > You are inside an agent. The sidebar remembers your last scope. Switch the selector at the top to All agents. > [accordion] Attaching a number says the agent has no saved versions > > Open the agent in the builder and save it. Attaching reads the agent's latest save on the main line, so a save made on a branch does not count. > [accordion] The number is attached and the agent behaves like an old version > > Publish and promote the agent. Attaching a number does not do it for you. > [accordion] The agent you want is not in the assignment dropdown > > Check which section you are looking at. **Agents** is the list you want. **Classic agents** is your personas from the prior dashboard, and picking from there routes the number to one of them instead. > [accordion] Channels will not offer a number you own > > It only offers numbers that belong to nobody. Go to All agents, open the number, and attach it to this agent there. > [accordion] The CSV will not upload > > The column has to be named `phone_number` exactly, and every number needs a country code. The error names up to three rows and counts the rest. > [accordion] A large batch shows Unknown and its Stop button is gone > > A batch past its first thousand calls reports a state the list does not have a label for. It is still running. Select the row and use **Stop Batch** in the detail panel, which does not ask for confirmation. > [accordion] The batch wizard will not let you continue > > You are over a call limit. An alert headed **Over your call limit** appears on the Recipients step and blocks **Next**. It names which limit you hit, hourly or daily. Remove recipients or come back later. > > If the check itself cannot run you get **Rate-limit check unavailable. Sending is not blocked.** instead, and the wizard lets you through. > [accordion] The SMS option is missing from a batch > > You are inside an agent, where batches are calls only. Go to All agents to send messages. Message batches also need a number set up for SMS, and an enterprise plan. ## Next steps > [card] [Triggers](/agents/triggers) > > Start conversations from a webhook or a schedule. > [card] [SIP](/agents/sip) > > Bring your own carrier. > [card] [Conversations](/agents/conversations) > > Read what happened on the calls you just dispatched. > [card] [Environments](/agents/environments) > > Promote to production, which is what a live number answers with. Docs for agents: [llms.txt](/llms.txt) # Dispositions Source: https://docs.bland.ai/agents/dispositions Decide what you want to know about every conversation, and have the answers delivered to your webhook after each call. If you've ever wanted to know how every call went without listening to a single one, that's what dispositions are for. A disposition is a standing question you ask of every call an agent takes. Did the caller book? Which plan did they ask about? Was the agent rude? You write the question once, publish it, and from then on every call the agent handles produces an answer, delivered to the same webhook the call already reports to. [Dispositions 101](https://www.loom.com/embed/ceaff5f62fa6474bab3ad49a36cc8671) > [!NOTE] > > Dispositions are an enterprise feature, and we switch it on for enterprise organizations one at a time. The sidebar item is there either way, so the row tells you where you stand. > > A greyed row you can't click means the organization isn't on an enterprise plan. A row that works, on a page that then says "Dispositions isn't available here", means you're on enterprise but not switched on yet. Your Bland partner can ask for it. ## Prerequisites * An agent that has taken real calls, from [Agent builder](/agents/agent-builder) * A [post-call webhook](/tutorials/post-call-webhooks) already configured, since that's where results arrive * An owner, admin, operator or prompter role. Anyone else can read dispositions and nothing more ## Where dispositions live Inside an agent, under Configure. There's no organization-wide view: a disposition belongs to one agent, and you reach it from that agent. There's also no environment selector on this page. A published disposition runs in every environment, on every call the agent handles except the ones the platform skips. [Common failures](#common-failures) says which. ## What a disposition is made of A disposition is a set of values. Each value is one thing you want to know, and each one names where its answer comes from. There are four sources, and picking the right one is most of the work: | Source | Use it when | Where it comes from | | - | - | - | | Judge | The answer needs judgement. Was this call handled well? | A published judge from [Evaluations](/agents/evaluations) | | Pathway variable | Your agent already extracts this during the call | An extraction configured on this agent, rerun after the call | | Extractor | You want structured data the agent wasn't already collecting | An extractor you create from Add value, under Variables | | Custom code | The answer is a calculation, or it has to reach your systems | JavaScript you write | A pathway variable is re-extracted, not read back. Dispositions run their own extraction against the corrected post-call transcript, built from the variable's name, its configured prompt and its output schema. The answer can differ from what you saw during the call, and usually it's better. The screen calls that a frozen prompt, because the name, the prompt and the schema are copied onto the value when you add it. Editing the variable in [Agent builder](/agents/agent-builder) doesn't change what the disposition reruns, so to pick up a change, remove the value and add it again. Custom code always runs last, after every other value has finished, and it can take their results as inputs. It can't take another custom code value as an input. ## Build one **1. Create the disposition** Open Dispositions inside your agent. With none there yet, you land straight in an editor over a draft named Untitled disposition. Nothing is saved until your first real edit: renaming it, writing a description, changing a setting, or pressing **Add value**. Rename it by clicking the title. The description field asks "What is this disposition for? Who consumes it?" Whoever inherits this needs to know which downstream system reads the result. **2. Add your first value** Click **Add value** at the bottom of the Values table. A drawer opens with five cards: | Group | Card | What it does | | - | - | - | | Judges | **Bring in an existing judge** | Picks a published judge. Stays in the drawer | | Judges | **Create a new judge** | Leaves for Evaluations, and doesn't bring you back | | Variables | **Rerun a pathway variable** | Picks extractions this agent already runs. Stays in the drawer | | Variables | **Create a new variable extraction** | Authors an extractor. Opens the Extractors drawer and leaves this one | | Custom code | **Run custom code** | Pins JavaScript that runs last. Stays in the drawer | Two of these cards take you out of the drawer. Creating a judge lands you in Evaluations with no route back, so finish the judge there and open your agent again to pick it up. Creating a variable extraction opens the Extractors drawer. That drawer is the only door to extractors anywhere in the product, and an extractor has to be published before a value can use it. When you're picking pathway variables you can add several in one pass, and the button counts them. **3. Set how much reasoning it gets** Every value except custom code gets an **Intelligence** setting in the drawer's Logic section: Automatic, Low, Medium or High. It decides how much reasoning the model does before it answers. Low is unavailable on an extractor that reads call audio. We recommend High only for ambiguous or high-stakes questions. On a simple one, more reasoning is not a better answer. **4. Check what the answer will look like** The Output section of the value drawer shows the value's type and how its result lands in the payload. It's a readout, not a control. The type comes from the source. A judge's type comes from its scoring levels: two levels, or none at all, is a boolean, and anything else is an enum. A pathway variable brings its configured schema. Neither the levels nor the schema can be changed from here. You set an extractor's type in the Extractors drawer, under Structured output schema, and custom code declares its own schema further down the value drawer. ## Decide when and how the answer arrives Three settings on the disposition, not on individual values. ### Delivery Timing **Immediately on conversation end** delivers within 30 minutes. Use it when something downstream acts on the answer while the call is still fresh: a CRM update, a transfer decision, an alert to someone. **Queued** delivers within 24 hours. Use it for reporting, QA and analytics, where nothing is waiting on the result. ### Webhook behavior The choice is whether your destination would rather have the call and the disposition in one delivery, or each as soon as it is ready. **Follow-up event** leaves the call webhook alone. It fires as usual, and a second event carrying the disposition result follows once the disposition finishes. **Hold original webhook** waits for the disposition, then sends one combined webhook. It adds up to 30 minutes of latency, and it needs Immediately on conversation end, so choosing it rules Queued out. Hold only works when nothing else is already holding that webhook. On an agent still running V1 citations, the call's webhook is waiting for those, so the disposition quietly falls back to Follow-up event. Nothing on screen tells you. ### Shape By default the payload carries every value, keyed by that value's key. Shape is a JSON editor where you write a transformation tree instead, so the payload matches what your destination already expects. **See example** shows a worked one. Shape does not save as you go. The editor waits for **Save transformation**. That button stays greyed out until you've changed something, and until the tree is valid JSON pointing only at values this disposition has. If your destination is happy reading the default, skip this. No action is required of you. ## Test it before you publish **Test** runs the disposition against real calls the agent has already taken, so you can see the answers before anything ships. > [!WARNING] > > A test run bills exactly like a production run. It uses the same models on the same calls and it is metered the same way. > > What it doesn't do is deliver. No webhook is sent for a test run, so nothing downstream sees the results. The run page shows each call, what each value produced, and the evidence behind it. When an answer is wrong you can correct it, and corrections are kept with the run. **Align with AI** reads your corrections and proposes changes to the disposition that would have produced them. Applying a proposal to a judge edits that judge and publishes a new version of it. The judges you can pin belong to this agent, so no other agent is affected, but the edit is not scoped to this one disposition. ## Publish it Publishing is what turns a disposition on. There's no separate enable step. Publishing freezes the current draft as an immutable version, and that version is what runs. Later edits become a new draft, and the header shows Unpublished changes until you publish again. Finished runs keep the exact definition they ran under, so editing a disposition can never rewrite history. The publish drawer estimates the cost per call before you commit, and you can't publish a disposition with no values. To stop one, open **Advanced**, find Pause runs and press **Disable disposition**. The disposition stops running on new calls, and calls in progress finish as they are. Your draft, values and history all stay. Publishing turns it back on. ## Read the results Results arrive on your post-call webhook under `agent_dispositions`. With Follow-up event, the results arrive as their own event once the disposition finishes, on the deadline you set under Delivery Timing: ```json theme={null} { "event_type": "dispositions", "timestamp": "2026-09-30T14:22:14.000Z", "call_id": "c1a9f3d2-64be-4f07-9c5a-2b81e6d0a7f4", "agent_dispositions": [ { "disposition_id": "3f2b9c14-8d7e-4a51-b0c6-9e2a7d4f1b83", "disposition_version_id": "8c5e1a76-2f40-4db9-a318-6d9b0c4e5721", "disposition_key": "booking_outcome", "name": "Booking outcome", "status": "complete", "payload": { "booked": true, "plan": "annual" }, "values": [ { "key": "booked", "state": "produced", "value": true }, { "key": "plan", "state": "produced", "value": "annual" } ], "executed_at": "2026-09-30T14:22:10.000Z", "evidence": [ { "source": "transcript", "speaker": "customer", "start_ms": 44120, "end_ms": 47890, "text": "Yeah, let's go with the annual plan." } ] } ] } ``` `payload` is what your destination reads. Skip Shape and it carries every value, keyed by that value's key. Write a transformation and it's that transformation's output. `values` is the raw list alongside it, and every value carries its own `state`: `produced`, `no_value`, or `error`. That's how you tell a real `null` from a question that could not be answered. `evidence` is the quotes the values cited, taken from the transcript. It appears only when a value cited something, so a strict schema on your side has to allow for it. The quotes arrive as one flat list, with nothing tying a quote back to the value that cited it. With Hold original webhook, there's no second event. The results ride the call's own webhook instead, under the same `agent_dispositions` field. If the disposition misses the hold deadline, its entry arrives with `status` set to `failed` and an `error`, carrying no `payload` and no `values`. Results also appear on the conversation itself, in [Conversations](/agents/conversations). ## Coming from citations and outcomes Dispositions replace three V1 surfaces: citations, outcomes and reports. The mapping: an outcome was deterministic code, so it's now a custom code value. A citation was an LLM answering a question, so it's now a judge value. Both now live in one place. Reports have no single successor. Disposition results show up as columns in [Conversations](/agents/conversations), one per value, hidden until you turn them on. Anything past that you build from the webhook feed. ### Bring your citations across On an agent that already exists, open the caret beside New disposition and choose **Migrate from citations**. Pick the citation schemas and outcomes you want, then choose how to move them. **Migrate as is** copies them into dispositions exactly as they work today. Nothing is tested or changed. **Migrate and upgrade** starts from that copy, then reruns your real calls through the new dispositions and compares every value against what V1 produced, fixing mismatches until the two agree. You choose how many recent calls to check against. It needs an agent with a recorded source pathway, and each pass runs inference on those calls and is metered like a test run. If the whole agent still has to move, that is a different job. Start from New agent, then Migrate, and [Migrate to agents](/platform/migrate-to-agents) walks through it. > [!WARNING] > > Dispositioning built on node tags does not migrate. If you tagged nodes and read those tags to classify calls, there's no equivalent to move. > > The route forward is a custom code value that reads tool names out of the call's execution trace. It's more work than a migration, and it's worth scoping before you commit to a date. ## Common failures > [accordion] The sidebar item works but the page says it isn't available > > Two separate things gate this feature. An enterprise plan decides whether the sidebar row is usable at all. A separate per-organization rollout decides whether the page loads. You're past the plan gate and not yet through the rollout, and there's nothing to retry. Your Bland partner can ask for the organization to be switched on. > [accordion] Some calls produce no disposition at all > > Three things skip a call, and none of them leaves you an error. > > The first is billing. If your organization's billing is blocked or its balance has run out, nothing runs and nothing is recorded. If that check itself errors, the call is skipped as well. > > The other two are compliance and retention. The call is marked for redaction, or it aged past your retention window. > [accordion] I published, but nothing arrives on my webhook > > Check which webhook behavior you chose. Follow-up event sends a second, separate event after the call's own webhook, so a listener that only reads the first one never sees it. > > Also check the field name. Results arrive under `agent_dispositions`, not `dispositions`. > > If the call itself reported to no webhook, there's nowhere to deliver and nothing is sent. No error is raised. > [accordion] Queued is greyed out > > You have Hold original webhook selected, which requires immediate timing. Switch the webhook behavior to Follow-up event first. > [accordion] I can't find extractors > > They have one door: Add value, then Variables, then **Create a new variable extraction**. There's no sidebar item and no direct link. Inside that drawer each extractor has an Add to disposition button, and an unpublished one reads Publish first instead. > [accordion] My value returned nothing and I don't know why > > Open the run and read the evidence for that value. A judge with no inputs enabled can't answer, and the drawer warns about it at the time. > > Check the value's own `state` rather than the disposition's `status`. A disposition reports `complete` when it finished, which it can do with a value that errored inside it. The exception is an entry that failed outright, where the `error` is the whole answer. ## Next steps > [card] [Evaluations](/agents/evaluations) > > Write the judges a disposition reads. > [card] [Conversations](/agents/conversations) > > See disposition results against the calls that produced them. > [card] [Agent builder](/agents/agent-builder) > > The variables a disposition can rerun. > [card] [Migrate to agents](/platform/migrate-to-agents) > > Where the rest of your V1 setup went. Docs for agents: [llms.txt](/llms.txt) # Environments Source: https://docs.bland.ai/agents/environments Ship an agent safely: what development, staging and production hold, how to publish and promote, and why a call needs a production version Every agent has three environments: development, staging and production. Development is the agent you are working on, saved work and unsaved alike. It is the only one you edit. Staging and production are snapshots. Each holds one version of the agent and keeps serving it until you point it at another. A new agent has nothing in either. ## Prerequisites * An agent you have built, from [Agent builder](/agents/agent-builder) * An owner, admin, operator or prompter role. A viewer can see the Environments tab but cannot publish, promote, roll back or save a variable * Optional: evaluations configured on staging, if you want them to gate the publish into staging and the promotion out of it. See [Evaluations](/agents/evaluations) ## Where environments live Inside an agent, Environments is under Configure. It has two tabs, Environments and Variables. There is no organization-wide view. Environments belong to one agent, and you reach them from that agent. The Environments tab lists the release as rows that read from the bottom up: Development, Staging, Evaluations, Experiment and Production. Production sits at the top because it is where the other rows lead. Expand a row to see its details. Staging and production each show the **Version** they are pinned to, and usually when it arrived, **Deployed** on production and **Created** on staging. Development shows neither, because it is the live head rather than a pin. Production holding nothing shows no version. The controls that act on what is live, **Rollback**, **Staged rollout** and **Promote**, sit in the page header above the rows. [Staged releases walkthrough](https://www.loom.com/embed/7e7c48f0d9484c3e9348de72db5d61ce) > [!WARNING] > > A call runs the **production** version by default. An agent with nothing pinned to production has nothing to serve, and an API call is refused with a 400 and the code `AGENT_ENV_UNPINNED`. > > Building and saving is not shipping. ## Publish **Publish** sits in two places and does the same thing in both: the button at the top right of the builder, and the Development row on the Environments tab. It saves your current work as a new version, then ships that exact version somewhere. Where it ships depends on one thing: whether this agent has ever been in production. ### The first publish goes straight to production An agent that has never been live skips staging. There is no menu, just one button. The confirmation asks for a phone number, and tells you that publishing changes what the agent answers but not which numbers or pathways reach it. You can publish without attaching one. Staging gets the same version on the way through, so it does not start out behind. > [!NOTE] > > Configuring a required evaluation puts the agent back on the normal staging path, since a one-press release would have nothing to evaluate against. ### After that, Publish offers a choice Once production holds a version, Publish opens a menu of destinations: * **Publish to staging** saves a new version and pins it to staging. Production does not move, so callers keep the version it already holds. * **Force promote** sends development straight to production in one step, skipping staging. Staging is repointed to that version on the way, which the confirmation says outright. * **Staged release to Production** releases the new version to production gradually. See [Staged release](#staged-release). Picking from the menu is not agreeing to ship. Each destination opens its own confirmation. > [!WARNING] > > What **Force promote** skips is the evaluation gate. That is its purpose, and the bypass is recorded in the audit log rather than on the deployment, so deployment history will not show you which releases were forced. > > It is the control that puts unevaluated work in front of live callers. ## Promote to production **Promote** in the Environments page header points production at the version staging is holding. Nothing is copied and nothing is rebuilt. Its confirmation carries the same phone number section and the same reassurance as the first publish: promoting does not change which numbers or pathways reach the agent. ## Staged release A staged release is the middle path between publishing to staging and promoting everything at once. It splits production traffic between the new version and the version live now. You choose how much traffic goes to the new version and raise its share step by step. Staged release is available when all of these are true: * Your organization is on an enterprise plan. * Production already holds a version to split traffic away from. * No rollout is live for this agent. You can start a staged release from three places: * **Publish menu**: select **Staged release to Production**, then **Set up staged release**. Bland saves your work, runs your evaluations, and publishes the version to staging. It then opens Experiment settings on a new draft. * **Promote confirmation**: select **Staged release** beside **Promote to Production**. The version is already on staging, so the draft opens without publishing anything. * **Staged rollout** in the Environments page header. The draft splits traffic between the version in production and the new version. Review the plan, then select **Start experiment**. No production traffic moves until you start it. ### Plan the steps The plan is a list of steps. Each step sends a share of production traffic to the new version and holds it there until a date. Select a step's **Hold until** date to pick a new one from the calendar. A step can hold for up to 14 days. The **Standard** plan starts with these steps: | Traffic | Hold until | | - | - | | 5% | 4 days after the start | | 25% | 4 days after the previous step | | 50% | 7 days after the previous step | | 100% | 7 days after the previous step | Dates count from **Start on** when you set it, otherwise from when you opened the plan. Changing **Start on** moves the dates of a preset plan to match. Dates the plan fills in for you never land on a weekend. A Saturday or Sunday moves to the following Monday. This applies to preset steps, steps added with **Add step**, and later steps pushed out by an earlier edit. A date you pick yourself stays as you picked it, weekends included. When you move a step's date, later steps keep their dates. A later step that would no longer end after the step before it moves out by its own hold length. > [!NOTE] > > The dates are a plan. A step that needs approval waits for it, and every step after it slides by that wait. > [!NOTE] > > A staged release never skips the evaluation gate. Starting the experiment checks the same required evaluations as a promotion, so a version that can't be promoted can't be released in stages either. ## Attach a number to staging On enterprise plans, you can point a phone number at staging instead of production. Calls to that number run the version pinned to staging, so you can dial the staging version before you promote it. 1. Publish to staging first. With nothing on staging, the Staging option is disabled and reads **Not deployed**. 2. Inside the agent, open Channels, then the Calls tab, and select **Add a number**. 3. In Attach a number, pick the number, then set **Environment** to **Staging**. Each option shows the version deployed to that environment. Every number on the Channels page shows which environment it answers on, **Production** or **Staging**. > [!WARNING] > > Only calls follow staging. Texts to a staging number still run the production version. A staging number runs staging's variable values, so every variable the agent references needs a staging value before you can attach. Numbers can't be attached to staging on dedicated infrastructure. To move a number back to production, detach it and attach it again with **Production** selected. ## Roll back To go back, **Rollback** in the Environments page header lists the versions production held before and repins to one you choose. It is a repoint, not a rebuild. ## Activity and version compare The **Activity** section below the rows is a change log for the agent. Each row records one event, such as **Version saved**, **Published to staging**, **Promoted to production** or **Rolled back production**. Each row shows: * **Prior version**: what that environment was pinned to before the event. For **Version saved**, it is the previous save. A first publish shows a dash. * **New version**: the version the event put in place. * **By** and **When**: who made the change and when it happened. * **Compare**: opens the two versions side by side. To see what changed between two versions, select **Compare** or either version on a row. The compare window opens on that row's pair. Use the **Before** and **After** pickers to compare any two published versions instead. Switch between two views: * **Simple** steps through each field that changed. * **JSON** shows the whole configuration of both versions side by side, with changed words highlighted. Unchanged lines fold away behind **Show N unchanged lines**. When two versions differ too much to line up in the JSON view, the window points you to **Simple** instead. Rows have no **Compare** when both sides are the same version, or when either side has no published version number. ## The evaluation gate Evaluations on staging can gate both moves, and the two directions fail differently. You attach them from the Evaluations row above Staging, covered in [Evaluations](/agents/evaluations#make-it-a-required-check). With no evaluations configured at all, neither move is gated and both happen immediately. Configuring any evaluation changes that, even one you have not marked **Req'd**. The run still executes and the publish waits for it, which takes as long as the conversations take. What the required flag decides is whether a verdict can stop you: a judge, the evaluation that scores a run, reports its result and blocks nothing when it is not required. > [!NOTE] > > One evaluation configuration does both jobs. The one saved on **staging** gates the publish into staging and the promotion out of it. There is no separate production gate to configure. Publishing to staging saves your changes as a new version, runs the evaluations against that exact version, and only assigns it a version number and pins it to staging once every required evaluation passes. When a required evaluation fails, a toast reads **Publish blocked** with the number that failed. A run that times out or errors stops the publish too, with its own message. > [!WARNING] > > A blocked publish is not a rollback. The version is already saved on development, without a number and without a pin, and it stays there. > > Nothing is undone and nothing is lost. Fix what failed and publish again. A blocked promotion is stopped twice. The dashboard dims **Promote**, explains why on hover, and does nothing if you press it. The server enforces the same rule again on the wire, which is what catches an API caller. Either way production keeps serving the version it already had. A judge scores a rate, not a verdict per conversation. It passes when half or more of the scored conversations match the target, so a single bad conversation does not necessarily fail the run. Test cases default to an odd number of conversations, which keeps ties rare. ## Variables The Variables tab holds keys and values that belong to an environment rather than to the agent. Pick Development, Staging or Production to choose which set you are editing. The same key can carry a different value in development, staging and production. Reference one anywhere in the agent's configuration as `{"{{env.KEY}}"}`, and it resolves to the running environment's value when a call starts, which is how an agent points at a test system while it is on staging and a real one once it is promoted. A variable nothing references does nothing. Marking a value **Secret** stores it in your secret vault and keeps only a reference here. It cannot be read back afterwards. > [!WARNING] > > A key with no value in the environment the call is running in does not fall back to another environment. It fails the call before it starts, with `AGENT_VARIABLE_UNRESOLVED`. > > So a variable added on development and never set on production breaks production the moment something references it. ## Common failures > [accordion] The agent answers with old behavior > > Production is pinned to an older version. Publishing to staging does not move production; check what production says it is pinned to, then **Promote**. > [accordion] Calls fail and the agent looks fine in the builder > > The agent has never reached production. The builder shows development, which is not what a call runs by default. On an API call the error is a 400 with `AGENT_ENV_UNPINNED`, which also names the alternative: pass `agent_version` to run a specific version deliberately. > [accordion] Publish finished but staging did not move > > A required evaluation failed, and the toast said so. The version is saved on development with no number and no pin, which is why nothing appears to have happened on staging. > [accordion] Promotion is blocked although the evaluations passed > > The configuration changed after that run. Promotion compares the run against the whole configuration saved now, which covers the required evaluations and the shared test inputs, so changing the test cases or the conversation count invalidates a pass just as editing an evaluation does. Publish to staging again to run them against the current configuration. > [accordion] A button does nothing and the error says nothing > > Publishing, promoting, rolling back and saving a variable all need an owner, admin, operator or prompter role. The buttons are not disabled for a viewer, so the press fails with a generic message rather than telling you the cause. > [accordion] A variable is right in one place and wrong in another > > Variables are per environment. Setting one on development leaves staging and production untouched, and promoting an agent does not carry values across. ## Next steps > [card] [Agent builder](/agents/agent-builder) > > Build the version you are going to publish. > [card] [Dispatch](/agents/dispatch) > > Give the promoted agent a number to answer on. > [card] [Conversations](/agents/conversations) > > Read what the production version actually did. > [card] [Tools](/agents/tools) > > The tools a version carries with it. Docs for agents: [llms.txt](/llms.txt) # Evaluations Source: https://docs.bland.ai/agents/evaluations Score an agent before it ships: write a judge, build a test case, read a run, and make a passing run a condition of promotion An evaluation is a judge reading a conversation and saying whether the agent did the thing you wanted. Three objects do the work. A judge scores a conversation. A test case is a simulated caller that produces conversations to score. A run pairs them and gives you a result. A test case carries no judges of its own; you pick both when you start a run. ## Prerequisites * An agent you have built, from [Agent builder](/agents/agent-builder) * An owner, admin, operator or prompter role to make an evaluation a required check ## Where evaluations live Inside an agent, Evaluations is under Validate, with three tabs: Judges, Test cases and Runs. > [!NOTE] > > Searching for evals? That is this page. The word is still in the URL, which reads `/judges` rather than `/evaluations`. At All agents there is a shorter version of the same page: Judges only. Test cases and runs belong to an agent, so those two tabs do not exist at organization scope. ## Write a judge The Judges tab lists every judge in one table. The last row of the table is **Create judge**, and under the table is a **Create a new judge** panel with three tiles: | Tile | What opens below it | | - | - | | **Blank** | The judge editor, empty | | **Templates** | A list of templates to start from | | **Generate** | A draft built from a **Prompt**, **Conversation comments** or a **Triage issue** | Pick a tile and what it needs opens right below. The new judge opens in the editor on the same page, not a separate one. Back out of a judge you never created and it is removed. The judge's name and description sit at the top of the editor, and you edit them in place. A new judge starts as **Untitled Judge**. Below the name, the editor has these sections. Only **Task** is required, and it is the one that does the work: it is the question you are asking about the conversation. | Section | What it sets | | - | - | | **Inputs** | **Mode** and **Context**, side by side. Mode is **Transcript** or **Audio**: transcript reads what was said, audio hears how. Context is the evidence the judge can see when it grades a call | | **Task** | The question. Required | | **Verdicts** | The answers it may give, and which one you are hoping for. **Pass** and **Fail** sit side by side, with an optional **Inconclusive** | | **References** | A table of where this judge is used, with its name and type | | **Advanced** | Model and retry behaviour | Each mode has its own context sources. Choosing a mode swaps the list under **Context**, so pick the mode first. The button reads **Create judge** the first time and **Update** afterwards. There is no Save. > [!NOTE] > > **Save as draft** keeps your work without making the judge live. A draft is not used by any run, so a judge you drafted and forgot will not quietly start scoring things. ## Tune a judge Testing a judge is a loop: pick calls, run the judge, correct the verdicts it got wrong, and turn those corrections into the next version. Open it with **Test** in the judge editor, and use **← Back to setup** to return. **Create new test** opens the population picker: | Option | What the judge grades | | - | - | | **Recent production calls** | The N most recent production calls for the agent | | **Specific production calls** | Calls you filter in a side panel, or a pasted list of conversation IDs | | **Simulated** | A number of simulated conversations from a caller description of at least 40 characters. The judge runs at its current draft | Rows fill in as the judge grades each call. To correct a verdict, select it, pick the level you believe is right, and add a short rationale. Corrections are saved with the test run, so teammates see them too. Each edit adds a revision rather than replacing the last one. When you have corrected the verdicts you disagree with, select **Align with AI**. Bland reads your corrections and the transcripts of those calls, then proposes changes to the judge's prompt and verdict descriptions as a diff. It only uses the verdicts the judge already has. An **Advanced** box takes optional instructions to steer the proposal. * **Apply** writes the proposal into the judge's draft so you can review it in the editor. * **Apply and retest** writes it into the draft and re-runs the same calls, so you can see whether the verdicts you corrected changed. Alignment always lands in the draft. Nothing changes for live runs until you publish the judge. ## Write a test case **New test case** starts either from scratch or from your own traffic. **Generate based on production calls** reads up to 50 real calls and writes one test case per call, which is the faster way to get a suite that resembles what actually happens to you. Select calls in a picker that has the same filters as Conversations, then **Generate test cases**. Bland writes the cases one call at a time, so larger batches take longer, and opens the editor on the first one when it finishes. Read each generated caller prompt and correct it before you use it. If some calls fail, the cases that succeeded are kept and each failed call is listed with its error. Retrying does not duplicate the cases already created. Then set a **Title**, a **Prompt** describing who the simulated caller is and what they want, and optionally **Labels**, **Max turns** (20 by default), a **Start node** and **Request data**. **Save** finishes it. ## Run them A run pairs judges with test cases. Pick both, choose how many conversations each test case should produce, and start it. > [!WARNING] > > A run you start here is stored in your browser, not on Bland. > > Your teammates cannot see it, and neither can you from another machine or another browser. Only the runs that happen as part of a publish are kept on the server. > [!WARNING] > > The version picker in the new run dialog does not change which version runs. > > Every conversation runs the agent's current version. The picker records your choice on the run for reference, and the tooltip says so. ## Read a run A conversation passes only if **every** judge passed it. A judge that could not tell counts against it here. This is worth holding onto, because the promotion gate scores the same run differently: there, each judge is scored on its own, across conversations. So a run can show failed conversations in the results and still clear the gate. ## Make it a required check An evaluation becomes a gate from the agent's Environments tab rather than from this page. The Evaluations card sits between Development and Staging, and **Add evaluations** opens the picker. Attach the judges you want, up to five test cases, and choose **1**, **3** or **5** conversations per test case. > [!WARNING] > > Attaching a judge makes it required by default. Clear **Req'd** on the row to make it advisory instead. > > An advisory judge reports its verdict and blocks nothing. Only staging has a configuration, and it gates both hops: the publish into staging and the promotion out of it. See [Environments](/agents/environments) for what each of those does when it is blocked. ## How a judge passes A judge does not pass or fail per conversation. It takes the share of conversations that matched the verdict you were hoping for, and passes when that share is **half or more**. Conversations where the judge could not reach a verdict are left out of the share entirely, rather than counted against it. > [!NOTE] > > You cannot change the half. It is fixed, so there is no target-rate setting to look for. > > What you choose is how many conversations each test case produces, and the options are odd numbers for a reason: with 3 or 5, a tie cannot happen. ## Simulation **Simulation**, in the builder under Testing, runs one conversation against a test case so you can watch the agent handle it. It is the same machinery, used for looking rather than scoring. Those conversations are not kept and never appear in Runs. ## Score calls after they end You can also have judges score real calls automatically. First save the judges you want, with their weights and a pass threshold, as a **workbench setup** through the [Evals API](/api-v1/post/evals-workbench-setups). Then pass `post_call_evals` with the setup's ID when you place a call with [`POST /v1/calls`](/api-v1/post/calls-agent): ```json theme={null} { "phone_number": "+15551234567", "agent_id": "YOUR_AGENT_ID", "post_call_evals": { "workbench_setup_id": "b7c2e1d4-8f3a-4c9e-9a2b-1e5f6d7c8a9b" } } ``` * **Recording is required.** Calls with `post_call_evals` are recorded automatically. A request that sets `record: false` is rejected. * **The setup version is pinned when the call is created.** Pass `workbench_setup_version_id` to pin an exact version. Editing the setup mid-call does not change what gets scored. * **Scores arrive on their own webhook.** The post-call webhook includes `post_call_evals` with `status: "pending"`. The scores follow on a separate `evals` webhook event when the run finishes. Add `post_call_evals` to your organization's `webhook_excluded_fields` preference to strip it from webhooks. * **Auto runs are listed with manual runs.** Filter for them with `triggered_by=auto` on [`GET /v1/evals/runs`](/api-v1/get/evals-runs). ## Use the API The Evals API is rooted at `/v1/evals`. In the API, a judge is an **eval agent** and a run is an **eval run**. 1. Confirm Evals is enabled for your organization with [`GET /v1/evals/status`](/api-v1/get/evals-status). 2. Create a judge with [`POST /v1/evals/agents`](/api-v1/post/evals-agents), optionally from a template. Edit its draft with [`PATCH /v1/evals/agents/{id}/versions/{version_id}`](/api-v1/patch/evals-agents-id-versions-id) and publish it with [`POST /v1/evals/agents/{id}/publications`](/api-v1/post/evals-agents-id-publish). 3. Preview the cost with [`POST /v1/evals/runs/estimates`](/api-v1/post/evals-runs-estimates), then start a run with [`POST /v1/evals/runs`](/api-v1/post/evals-runs). A run takes up to 5,000 call IDs and up to 50 judges. 4. Poll [`GET /v1/evals/runs/{run_id}`](/api-v1/get/evals-runs-id), then read the [call results](/api-v1/get/evals-runs-id-call-results) and [judge results](/api-v1/get/evals-runs-id-agent-results). To re-run the same set of judges over time, save it as a [workbench setup](/api-v1/post/evals-workbench-setups) and pass `workbench_setup_id` and `workbench_setup_version_id` when you create a run. ## Common failures > [accordion] A run I started yesterday is gone > > Manual runs are stored in the browser that started them. A different machine, a different browser, or cleared site data all lose them. Runs attached to a publish are on the server and survive. > [accordion] The results show failures but promotion went through > > The two screens score differently. Results fail a conversation if any judge failed it; the gate scores each judge across conversations and passes at half or more. Both numbers are right, and they answer different questions. > [accordion] A judge I wrote is not scoring anything > > It is still a draft, or it is not attached. **Save as draft** keeps a judge out of every run, and attaching happens on the Environments tab rather than when you write it. > [accordion] An evaluation failed and nothing was blocked > > **Req'd** is cleared on that row, so the judge is advisory. Advisory judges report and never block. > [accordion] Promote looks enabled but does nothing > > A required evaluation failed. The button dims rather than disabling, and the reason is on hover. > [accordion] I chose a version in the run dialog and it ran a different one > > It ran the current one. The picker records a version on the run and does not select what executes. ## Next steps > [card] [Environments](/agents/environments) > > Where an evaluation becomes a condition of shipping. > [card] [Agent builder](/agents/agent-builder) > > Change the agent the judges keep failing. > [card] [Conversations](/agents/conversations) > > Read the real calls a test case was generated from. > [card] [Testbed](/agents/testbed) > > Try an agent by hand before you score it. Docs for agents: [llms.txt](/llms.txt) # Knowledge Source: https://docs.bland.ai/agents/knowledge Add the sources your agent answers from, attach them to an agent, and test what it retrieves Knowledge is how an agent answers from your content rather than from its prompt. A caller asks which plans you take, or what a cleaning costs, and the agent reads the answer out of the documents you gave it. You add a source, attach it to an agent, and the agent searches it during the call. A source is one thing you added: a file, a site, a block of text, a synced document. The URL still says knowledge base, and so does the tester. They mean the same thing. The examples here build knowledge for a front desk agent at Northwind Dental, a fictional practice. ## Prerequisites * An agent to attach sources to, from [Agent builder](/agents/agent-builder) * The content you want the agent to answer from * For a synced document, an account already linked under [Connections](/agents/tools#integration) ## Where knowledge lives Knowledge appears at two scopes, and the difference is what is attached rather than what exists. The selector at the top of the sidebar decides which one you are on. At All agents it sits under Resources. Inside an agent it sits under Build. Both scopes show the same five tabs. | Tab | What it holds | | - | - | | **Sources** | Everything you have added. Inside an agent, also where you attach. | | **Questions** | Questions callers asked that the agent could not answer. | | **Query logs** | Every retrieval: what it searched, and what came back. | | **Knowledge map** | Your sources plotted against the questions asked of them. | | **Source testing** | Ask a question and see what the agent would retrieve. | Sources belong to the organization, never to one agent. What changes inside an agent is that each row gains a checkbox, and Questions, Knowledge map and Source testing narrow to the sources that agent has attached. Query logs narrows differently, to the retrievals that agent's own calls made. Most of the table is a rolling 30-day window. | Column | What it tells you | | - | - | | **Queries** and **Share** | How much retrieval traffic the source took, and its slice of the total. | | **Hits / misses** | How many of those queries came back with an answer, and how many did not. | | **Coverage** | The share of queries against that source that came back with an answer. | | **Resolved coverage** | The same figure counting the gaps you have since answered, so the distance between the two is your backlog. | | **Contexts** | Not a 30-day number. Who is using this source: agents, pathway nodes, the API and testing, each with its own mark. | The list opens sorted by least coverage, so your weakest sources are on top. ## Add a source On the **Sources** tab, **Add sources** opens a dialog with four kinds along the top: Upload, Website, Text and Integration. The first three carry a **Description** field. Integration takes only a name. ### Upload Drag files in, or click to pick them. PDF, TXT, CSV, JSON and DOCX, up to 10 MB each and 10 files at a time. Each file becomes its own source. Drop five files and you get five sources, not one with five parts. They share the description you typed, so a mixed drop is worth doing in batches. A file over the limit is skipped and the rest still upload, with a message naming the one that did not make it. ### Website Two ways to get URLs in. **Discover from a site** takes a domain, reads its sitemap, and comes back with everything it found, all selected. Turn off what you do not want and add the rest. Or paste URLs into the field below it, one or many at once, separated by spaces or commas. The whole list becomes one source, so name it for the site rather than for a page. ### Text Paste content directly, up to one million characters. This one needs a name. Use it for the things that live nowhere else yet: a policy someone wrote in a message, a price list, the answers your team keeps retyping. ### Integration Pick a document from an app you have connected, currently Notion or Google Docs. Bland reads it and keeps reading it. An integration source is read-only in Bland. Open it and you get a link out to the app instead of an editor, and that is where you make changes. Whichever kind you pick, the source starts processing in the background. It is not searchable until it finishes, and the Status column tells you where it is. ## Attach a source to an agent Adding a source does not give it to an agent. Attach it. There are two ways. Check it on the agent's Sources tab, or type `@` in the agent's prompt and pick it from the list. Either way the row ends up checked, and the source is available on every call, everywhere in the agent, including inside every [pathway](/agents/agent-builder#extend-the-agent-with-pathways), a branch of the agent's behavior with instructions of its own. Pick the source from the list rather than typing the tag yourself. Picking writes it for you, as `@service-menu`. Typing that text attaches nothing and says nothing. **1. Open the agent's Knowledge page** Switch the sidebar selector to the agent, then open Knowledge. You get the same source list with a checkbox on every row. Check the environment selector in the top bar reads Development. These tabs carry it, and on a [published](/agents/agent-builder#publish-and-promote) environment the checkboxes still look editable and the save will fail. **2. Check the sources it should use** The header counts them as you go. **3. Save** The save control is the floppy disk icon beside **Add sources**. It is dimmed until you have changed something, and it stays dimmed if the agent cannot be saved for some other reason. Hover it and it tells you which. Nothing is attached until you press it. The checkboxes are an edit to the agent, so they reach a live call the same way any other edit does, when you [publish and promote](/agents/agent-builder#publish-and-promote). ### Tag a source in the prompt Tagging is worth doing on top of attaching, because it tells the agent where in the conversation you expect the source to matter. It is not what makes the source reachable, and it does not confine the source to that one prompt. It does change how the source can be detached, which is the rule at the end of this section. The Knowledge references section below the prompt lists what you tagged. Unlike Tool references, it is not the full list of what the agent can reach. > [!NOTE] > > [Tools](/agents/tools) work the other way. A tool belongs to the one prompt you attached it to. A source belongs to the whole agent. Deleting the last `@` mention of a source detaches it, whatever attached it in the first place. Only a source that has never been tagged in any prompt is safe from a prompt edit. One surface does not follow the agent-wide rule: a Knowledge step inside a pathway retrieves from its own list, not the agent's. ## Test what it retrieves **Source testing** answers a question the way the agent would, before a caller asks it. Pick your sources in the bar at the bottom, type a question, and press Enter. Inside an agent the picker starts with whatever is checked on the Sources tab, including checks you have not saved yet. Save first, or a passing test proves nothing about the agent you will ship. The answer comes back with **Show diagnostics** underneath it, and the diagnostics are the point. | Diagnostic | What it tells you | | - | - | | **Generated query** | What it actually searched for, which is rarely word for word what you typed. | | **Gap evaluation** | `answerable` or `gap`, plus the reason. | | **Retrieved chunks** | The passages it found, in the order retrieval ranked them, usually with a score. | A low score on the top chunk means the wording in your source and the wording of the question are too far apart. A good chunk that produced a bad answer is a different problem, usually a source that says two things at once. Split it: add the second topic as its own source and cut it from this one. > [!NOTE] > > The diagnostics show which passages came back, not which source they came from. To test one source on its own, open it from the list and use **Test**, which floats a chat in the corner. It gives you the answer and none of the diagnostics. When the tester decides a question is a gap, a banner offers to answer it on the spot. You write the answer and pick a source to keep it in, so the next caller who asks gets it. ## Edit a source Open a source from the list. The editor changes with the kind: | Source | Editor | | - | - | | Text and Markdown | One editor, full width | | PDF | The original on the left, with zoom and page controls. The text Bland extracted, as Markdown, on the right | | DOCX | A preview of the original on the left, the extracted Markdown on the right | | JSON | The original file on the left, the converted Markdown on the right | | CSV | A grid | | Website | The URL list, plus **Sync now** and a daily auto-sync switch | | Integration | Read-only, with a link out to the app it syncs from | In the split view the left panel is a read-only preview, and the right panel is the text your agent searches. Drag the divider to resize them. If the preview fails to load, reload it from its panel. You can keep editing the text either way. A JSON source that opens as raw JSON instead of a split was added before the conversion step existed. Saving is two steps. **Save**, or **Cmd/Ctrl+S** in the editor, shows you a diff of each edit. Press **Save** in the preview header to commit. Bland then re-embeds the source, so the agent uses the new text. Content has to stay under 10 MB. > [!WARNING] > > On a PDF, DOCX or JSON source you are editing extracted text, not the file. > > Bland asks you to confirm, because after you save, the text your agent searches no longer matches the document a person would open. That is often what you want, for fixing a bad table or a garbled heading. On a file source, **Replace file** swaps the underlying document for a new one of the same type, rather than editing the text Bland pulled out of the old one. Every content save creates a version. Open a past one from the version selector on the source page. Past versions are read-only, side-by-side editors included, and restoring one writes it forward as a new version rather than rewinding, so nothing is lost either way. Renaming a source and changing its retrieval settings do not create versions. The menu at the end of a source's row deletes it. Read its **Contexts** cell first, and read all of it: a row with no agents and no nodes can still be carrying API traffic. A source belongs to the organization, so deleting it takes it off every agent that has it attached, and there is no undo. ### Retrieval settings CSV, JSON and website sources can carry a **Retrieval settings** button that does one job: mark which parts of the source carry the meaning. Leave it alone unless retrieval is missing things it obviously should find. It is a fix for a specific problem, not a setup step. The button is gone on a past version, and on some workspaces it is not there at all. If it is missing on a source you are editing now, nothing below applies to you. Where it does appear depends on the source: | Source | Where the button is | While the source is processing | | - | - | - | | CSV and JSON | The editing bar. Gone in **Viewing** mode. | Greyed out | | Website | Beside **Sync now**, spelled **Retrieval Settings** | Pressable, but the modal will not save until it finishes | On a CSV you boost up to three columns and exclude the ones that are noise, like IDs and URLs. On JSON it is the same idea with paths. On a website source it is one switch, for using each page's title and description. Everything here starts off. **Suggest** fills it in for you on CSV and JSON, and explains its reasoning. Saving reindexes a file source, and re-scrapes a website one, so it is not a free change. ## Manage at scale Three tabs matter once you have real traffic. **Questions** collects what callers asked and the agent could not answer, with a count of how often each came up. Answer one and it is written into a source you choose. Dismiss the ones that are not your job. The list opens on **Open**, newest first. Sort by **Most asked** to turn it into a work queue. **Query logs** is every retrieval: the query, whether it was answered, where it came from, and the chunks that came back. Open a row when you need to know what really happened on a specific call rather than what happens when you test now. The default window is the last 7 days. **Knowledge map** shows which sources are carrying the questions over a 30-day window, colored by how often each one answered. Red is a source that is being asked and failing. Grey is a source nothing has asked in a month. > [!NOTE] > > Inside an agent, **Query logs** starts empty on an agent whose traffic predates per-agent attribution. Those retrievals are still recorded on the same tab at All agents. ## Common failures > [accordion] The agent answers as though the source does not exist > > Check the agent's Sources tab. If the row is unchecked, it is not attached. If it is checked and you never pressed **Save**, it is still not attached. > [accordion] It is attached and still never gets used > > The agent decides whether to search a source from its name and its description. Both are set when you add it, and only the name can be changed afterwards. > > Rename it first, because renaming is free: say what is in it, in the words a caller would use. If the description itself is the problem, re-add the source, attach the new one everywhere the old one was, and delete the old one only after reading its **Contexts** cell. > [accordion] Save fails and says the agent was updated somewhere else > > Check the environment selector. On a published environment the checkboxes look editable and the save is rejected, and the message names the wrong cause. Switch to Development, check the sources there, and save again. > [accordion] A source came off an agent on its own > > Deleting the last `@` mention of a source detaches it, whatever attached it first. Someone edited a prompt. Re-check the row on the agent's Sources tab and press **Save**. > [accordion] It retrieves the wrong passage > > Test the question in **Source testing** and read the top chunk's score. A low score means your source does not use the caller's words, so rewrite that passage in the words a caller would use. A good score on the wrong passage means the source covers two things at once, so split the second one out into its own source. > [accordion] A caller got a bad answer and you cannot reproduce it > > Find the call in **Query logs** and open it. It records the query the agent actually generated and the chunks that came back at the time, which is what testing now cannot tell you. > [accordion] A source sits on Processing > > Large files take a while. Check the row for its percentage and estimate before you assume it is stuck. A source that failed reads **Failed** instead, and hovering shows why. > [accordion] The site source is out of date > > Open it and use **Sync now**, or turn on the daily auto-sync. A source marked **Stale** is one with auto-sync on that has not synced in more than 7 days. > [accordion] The answer was right last week and is wrong now > > Open the source and check its version history. Every content save made a version, so you can read what changed and restore the one that was right. ## Next steps > [card] [Agent builder](/agents/agent-builder) > > Tag sources into a prompt, and the rest of building an agent. > [card] [Tools](/agents/tools) > > Call an API instead of answering from a document. > [card] [Conversations](/agents/conversations) > > Read the calls the Questions tab is pointing you at. > [card] [Evaluations](/agents/evaluations) > > Turn a retrieval you care about into a test that runs before you promote. Docs for agents: [llms.txt](/llms.txt) # Updating programmatic call use with your new Agent Source: https://docs.bland.ai/agents/programmatic-calls Update your outbound call requests to use your new Agent, keep existing call settings, and read post-call results. ## One simple change to start calling with your new Agent **Before you begin:** Your agent owner should have built, tested, and published your new Agent to production. For most outbound integrations, the request change is small: replace your existing pathway or persona ID with your new agent ID. If your integration reads outcomes or citations, update its result parser too. ### What changes | Area | What to do | | - | - | | Endpoint and authentication | Keep `POST /v1/calls` and the organization API key. | | Agent selection | Replace `pathway_id` or `persona_id` with `agent_id`; remove `pathway_version`. | | Call settings | Keep existing per-call overrides, or omit them to use saved agent settings. | | Call data | Keep the fields the conversation needs in `request_data` and tracking fields in `metadata`. | | Post-call outcomes | Update the parser if it reads dispositions or migrated citations. | | Cutover | Validate one complete request, call, and webhook flow with your agent owner. | Your agent owner provides the agent ID, confirms the production release, and validates any required dispositions. Update your integration's call requests and, if needed, its result processing. ## Update the call request Replace `pathway_id` or `persona_id` with `agent_id`. Remove the old selector and any `pathway_version`. Keep the same endpoint, `POST https://api.bland.ai/v1/calls`, and the existing organization API key for that account. Keep the existing dialing pool, timezone, scheduling, `request_data`, `metadata`, webhook URL, and webhook event settings. Send the complete data objects the call needs; request objects replace the agent's defaults. ### Before and after Illustrative requests with placeholder IDs. The example keeps the existing per-call settings. #### Before ```json theme={null} { "phone_number": "+14155550100", "pathway_id": "", "pathway_version": 74, "voice": "", "record": true, "max_duration": 30, "request_data": { "order_id": "123" }, "webhook": "https://customer.example/post-call" } ``` #### After ```json theme={null} { "phone_number": "+14155550100", "agent_id": "", "voice": "", "record": true, "max_duration": 30, "request_data": { "order_id": "123" }, "webhook": "https://customer.example/post-call" } ``` **Request settings take priority.** Keeping `voice`, `record`, or `max_duration` overrides the agent's saved settings for that call. Omit those fields to use the agent's settings. For example, the request above uses the specified voice, records the call, and sets a 30-minute limit, even if the agent's saved settings differ. ### Minimal production request Use this when the agent already has the right call settings and your organization has a default webhook configured. Otherwise, include your existing `webhook` URL in the request. An omitted webhook uses the organization's default, not the agent's saved settings. Replace the placeholders with the organization key and agent ID. The destination number is illustrative. ```bash theme={null} curl --request POST 'https://api.bland.ai/v1/calls' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "phone_number": "+14155550100", "agent_id": "" }' ``` Add per-call data when needed. A `webhook` sent in the request overrides your organization's default. Save the returned `call_id` so the request can be matched to its later webhook. ### Updating requests that use a persona or call preset Make the same selector change for a request using `persona_id`. #### Before with a persona ```json theme={null} { "phone_number": "+14155550100", "persona_id": "", "request_data": { "customer_name": "Alex" }, "metadata": { "customer_id": "cust_123" } } ``` #### After with an agent ```json theme={null} { "phone_number": "+14155550100", "agent_id": "", "request_data": { "customer_name": "Alex" }, "metadata": { "customer_id": "cust_123" } } ``` Send only one selector. Combining `agent_id` with `pathway_id` or `persona_id` produces `AGENT_PARAM_CONFLICT`. ### Production and staging versions Omit `agent_version` for normal production traffic. Calls follow the production release and remain eligible for experiments. Any explicit selector, including `"production"`, bypasses experiment assignment. | Request | Version used | | - | - | | Omit `agent_version` | Production, with experiment assignment where configured. | | `"agent_version": "production"` | Production, with experiments bypassed. | | `"agent_version": "staging"` | The release pinned to staging. | | `"agent_version": "1.2.0"` | That exact saved version, using dev environment values. | For staging, use a test number and test webhook: ```json theme={null} { "phone_number": "+14155550100", "agent_id": "", "agent_version": "staging", "request_data": { "order_id": "test_123" }, "metadata": { "test_run": true }, "webhook": "https://customer.example/test-post-call" } ``` Your agent owner must publish a release to the selected environment first. An environment with no pinned release returns `AGENT_ENV_UNPINNED`. A version selector is a string; the old numeric `pathway_version` does not carry over. If present, remove call-level `tools` and omit `task`; the ready agent supplies both its tools and conversation instructions. ### Send complete data objects `request_data` and `metadata` replace the corresponding saved objects in full. Their individual keys do not merge. For example, suppose the agent's saved `request_data` contains: ```json theme={null} { "company_name": "Acme", "support_number": "+14155550199" } ``` If the call also needs an order ID, send all three required fields: ```json theme={null} { "phone_number": "+14155550100", "agent_id": "", "request_data": { "company_name": "Acme", "support_number": "+14155550199", "order_id": "123" }, "metadata": { "customer_id": "cust_123", "campaign_id": "renewals" } } ``` Sending only `{"order_id": "123"}` replaces the saved object with that single key. Confirm the conversation receives every variable it expects. ## Update result parsing if used If your integration uses post-call outcomes, update where it reads the result: | Before | After | | - | - | | `dispositions[].result` | `agent_dispositions[].payload` | ### Before and after outcome examples These are shortened, illustrative webhook fragments. Your agent owner must configure and publish your Agent's disposition to produce the field names and types your integration expects. #### Before with an existing disposition ```json theme={null} { "call_id": "", "dispositions": [ { "result": { "appointment_booked": true, "order_id": "123" } } ] } ``` #### After with an agent disposition ```json theme={null} { "call_id": "", "agent_dispositions": [ { "disposition_id": "", "disposition_key": "booking_outcome", "status": "complete", "payload": { "appointment_booked": true, "order_id": "123" } } ] } ``` The business fields can stay the same when the disposition is configured to preserve them. Match `disposition_key` or `disposition_id`, then read `payload`. Array position can change. Confirm the expected fields with your agent owner. Select the entry by its disposition key or ID, check `status`, and route failed or missing outcomes to review before taking an automated action. If reading migrated citations, use `values[]` by key and check `state`: `produced`, `no_value`, or `error`. ### Webhook delivery and retries Confirm the delivery behavior with your agent owner: * **Follow-up event:** the normal call webhook arrives first. A later event with `event_type: "dispositions"` carries `call_id` and `agent_dispositions`. The receiver must process both events. * **Hold original webhook:** results travel in one combined call webhook, adding up to 30 minutes. This requires **Immediately on conversation end**. * **Existing citations:** an existing citation hold can cause disposition delivery to fall back to a follow-up event. * **Queued results:** delivery can take up to 24 hours. Correlate events by `call_id` and make updates safe to retry. If a held disposition misses its deadline, expect `status: "failed"` and an `error`, with no `payload` or `values`. Send failed or missing results to review. If downstream code needs the agent's identity, validate the actual webhook fields during testing. The stable `agent_id` and the executed `agent_version_id` identify different things. You can also retain the requested `agent_id` alongside the returned `call_id` in your own system. ## Confirm before cutover * Get the new `agent_id` and confirm the production release is ready. * Confirm required outcomes are published and obtain a representative webhook sample. * Update the selector, remove `pathway_version`, and decide which per-call settings to keep. * Place a representative test call. Check the conversation, caller ID, voice, and variables. * Confirm webhook delivery, field names, types, and the downstream action. * Test missing or failed outcomes and repeated webhook delivery. * Switch the production request to the new `agent_id`, then monitor the first calls and their results. The selector change starts calls with the ready agent. Outcome configuration and downstream parsing must also be validated for integrations that act on post-call results. ## References [Send Call with an Agent](/api-v1/post/calls-agent) · [Dispositions and webhook delivery](/agents/dispositions) # SIP Source: https://docs.bland.ai/agents/sip Connect your own carrier, PBX, or contact center to Bland over SIP for inbound calls, outbound calls, and transfers SIP lets you bring your own carrier. Calls from your carrier, PBX, or contact center reach a Bland agent, and the agent places calls out through your SIP provider. You create a trunk, attach your numbers to it, and assign each number an agent. > [!NOTE] > > **SIP is organization scope only.** Inside a single agent there is no Phone numbers item. Switch the selector at the top of the sidebar to **All agents** first. ## Where SIP lives At **All agents**, go to **Dispatch**, then **Phone numbers**, then the **SIP** tab. It lists your trunks, and **Create trunk** and **Port a number** sit at the top right. Each trunk has its own page with three tabs: * **Overview**: call volume, answer rate, and the call log with each call's SIP trace * **Numbers**: the numbers and DIDs attached to the trunk * **Configure**: the trunk's endpoint, authentication, headers, and firewall details ## How it works * A **trunk** holds the connection to your SIP infrastructure: the endpoint, transport, and authentication. You set it up once. * **Numbers and DIDs** attach to a trunk and inherit its settings. Each one can route inbound, outbound, or both. E.164 numbers, DIDs, and extensions are all supported. * **SIP headers become variables.** Every `X-` header your PBX sends reaches the agent as `{{sip_header_}}`, and Bland can send call data back in headers. See [SIP headers](/agents/sip-headers). * **Signaling runs over TLS on port 5061, and audio over SRTP.** Bland does not accept plain UDP or port 5060. ## Prerequisites * A carrier, PBX, or SBC that supports TLS signaling and SRTP media * The numbers you will route, on your own carrier. Numbers bought from Bland can't be attached to a trunk * Access to your firewall, to allow-list Bland's [signaling and media IPs](/agents/sip-network#connection-endpoints) ## Connect your carrier **1. Create a trunk** On the **SIP** tab, press **Create trunk** and follow the [setup wizard](/agents/sip-setup). For Bandwidth, Twilio, Telnyx, 3CX, Five9, or NICE CXone, follow that provider's guide under **SIP integrations** in the sidebar instead. **2. Attach your numbers** Add the numbers or DIDs that route through the trunk, on the wizard's last step or the trunk's **Numbers** tab. **3. Assign an agent** Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. **4. Place a test call** Call the number from a phone to test inbound. For outbound, use the number as `from`: ```bash theme={null} curl -X POST https://api.bland.ai/v1/calls \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14155550123", "from": "+12341234123", "task": "Say hi to the nice person!" }' ``` You know it worked when the call shows up on the trunk's **Overview** tab. ## API Every SIP endpoint is under `/v1/sip` and authenticates with your API key. Parameters for each endpoint are in the [API reference](/api-v1/post/sip-attach). > [accordion] Trunks > > | Method | Endpoint | Description | > | - | - | - | > | `POST` | `/v1/sip/trunks` | Create a trunk | > | `GET` | `/v1/sip/trunks` | List trunks | > | `GET` | `/v1/sip/trunks/:id` | Get a trunk and its attached numbers | > | `PATCH` | `/v1/sip/trunks/:id` | Update a trunk | > | `DELETE` | `/v1/sip/trunks/:id` | Delete a trunk | > | `POST` | `/v1/sip/trunks/:id/test-connection` | Send a SIP OPTIONS reachability ping | > [accordion] Numbers and configuration > > | Method | Endpoint | Description | > | - | - | - | > | `GET` | [`/v1/sip`](/api-v1/get/sip-config) | Get SIP config for a phone number | > | `POST` | [`/v1/sip/attach`](/api-v1/post/sip-attach) | Attach numbers and DIDs to a trunk | > | `POST` | [`/v1/sip/update`](/api-v1/post/sip-update) | Update one direction's settings | > | `POST` | [`/v1/sip/detach`](/api-v1/post/sip-detach) | Remove SIP configuration | > | `GET` | [`/v1/sip/numbers`](/api-v1/get/sip-numbers) | List SIP-configured numbers | > | `GET` | [`/v1/sip/generate-password`](/api-v1/get/sip-generate-password) | Generate a strong SIP password | > | `PATCH` | [`/v1/sip/config`](/api-v1/patch/sip-config) | Save advanced settings (not yet applied to calls) | > [accordion] Discovery and testing > > | Method | Endpoint | Description | > | - | - | - | > | `POST` | [`/v1/sip/parse-destination`](/api-v1/post/sip-parse-destination) | Parse and validate a SIP destination | > | `POST` | [`/v1/sip/discover`](/api-v1/post/sip-discover) | Auto-discover endpoint settings | > | `GET` | [`/v1/sip/discover/status`](/api-v1/get/sip-discover-status) | Poll discovery progress | > | `POST` | [`/v1/sip/test-call`](/api-v1/post/sip-test-call) | Send a test call to your endpoint | > | `GET` | [`/v1/sip/test-call/status`](/api-v1/get/sip-test-call-status) | Get test call status and trace | > [accordion] Monitoring > > | Method | Endpoint | Description | > | - | - | - | > | `GET` | [`/v1/sip/firewall-ips`](/api-v1/get/sip-firewall-ips) | Get Bland's IPs and ports | > | `GET` | [`/v1/sip/outbound-setup`](/api-v1/get/sip-outbound-setup) | Get outbound server details for PBX config | > | `GET` | [`/v1/sip/status`](/api-v1/get/sip-status) | Get trunk health | > | `GET` | [`/v1/sip/calls`](/api-v1/get/sip-calls) | Get SIP call logs | > [accordion] Number porting > > | Method | Endpoint | Description | > | - | - | - | > | `GET` | [`/v1/sip/port/check`](/api-v1/get/sip-port-check) | Check portability | > | `POST` | [`/v1/sip/port/document`](/api-v1/post/sip-port-document) | Upload proof of ownership | > | `POST` | [`/v1/sip/port/initiate`](/api-v1/post/sip-port-initiate) | Submit a port request | > | `GET` | [`/v1/sip/port`](/api-v1/get/sip-port-requests) | List port requests | > | `DELETE` | [`/v1/sip/port/:id`](/api-v1/delete/sip-port-cancel) | Cancel a port request | ## Next steps > [card] [Set up a trunk](/agents/sip-setup) > > Walk through the setup wizard step by step. > [card] [Transfers](/agents/sip-transfers) > > Send callers to a DID, extension, or SIP URI. > [card] [SIP headers](/agents/sip-headers) > > Use your PBX's headers as agent variables. > [card] [Network and security](/agents/sip-network) > > Regions, IPs to allow-list, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # SIP headers Source: https://docs.bland.ai/agents/sip-headers Use SIP headers from your carrier or PBX as variables in your agent, and send call data back out in SIP headers SIP headers carry data with a call. Your PBX can tag a call with an account number, a queue, or the reason for calling, and the agent can use it like any other variable. Going the other way, Bland can put call data into the headers it sends your PBX. > [!NOTE] > > Bland receives every inbound `X-` header as a variable with no setup. Map a header only when you want a different variable name, or want to use it as the call's external ID. ## Read inbound headers in your agent Every `X-` header on an inbound call becomes a variable named `sip_header_` plus the header name in lowercase: | Header your PBX sends | Variable in your agent | | - | - | | `X-Account-Id: 4417` | `{{sip_header_x-account-id}}` | | `X-Queue: billing` | `{{sip_header_x-queue}}` | Use them anywhere variables work: the prompt, pathway nodes, tools, and webhooks. ### The original caller Bland copies the identity headers from the original `INVITE` into `X-Original-` headers, so they arrive as variables too: | Original header | Variable | | - | - | | `P-Asserted-Identity` | `{{sip_header_x-original-pai}}` | | `Remote-Party-ID` | `{{sip_header_x-original-rpid}}` | | `Diversion` | `{{sip_header_x-original-diversion}}` | | `From` | `{{sip_header_x-original-from}}` | | `To` | `{{sip_header_x-original-to}}` | | `P-Charge-Info` | `{{sip_header_x-original-p-charge-info}}` | Use these when a PBX forwards the call to Bland and the original caller isn't in `From`. A value of `anonymous` means the caller withheld their number. ### Map a header to your own variable name To give a header a cleaner name, map it on the number's **inbound** configuration with [`POST /v1/sip/update`](/api-v1/post/sip-update). Each entry's `key` is the header name and `value` is the variable name: ```bash theme={null} curl -X POST https://api.bland.ai/v1/sip/update \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14155550100", "updates": { "type": "inbound", "headers": { "direction": "inbound", "headers": [ { "type": "custom", "key": "X-Account-Id", "value": "account_id", "external_id": true }, { "type": "custom", "key": "X-Queue", "value": "queue" } ] } } }' ``` The agent now reads `{{account_id}}` and `{{queue}}`. * **Header names match exactly**, including case. * **Up to 15 mappings** per number. Sending the list replaces it, and an empty list clears it. * **Built-in variable names are reserved.** A mapping into a name such as `call_id`, `phone_number`, or `from_number` is ignored. * **`external_id: true`** records the header's value as the call's external ID, so you can find the call later with [`GET /v1/calls?external_id=`](/api-v1/get/calls). ### User-to-User (UUI) Contact centers often send data in a `User-to-User` header instead of an `X-` header. Bland decodes it when the header is hex encoded with `purpose=bland` and the content is `key=value` text: ```text theme={null} User-to-User: 6163636f756e743d34343137;encoding=hex;purpose=bland ``` That example decodes to `account=4417`. Map the key, `account`, to a variable the same way as a header: `{ "type": "custom", "key": "account", "value": "account_id" }`. A value can't itself contain `=`. ### Pass variables without headers If your PBX can only send one header, create an inbound session first. [`POST /v1/inbound/session`](/api-v1/post/inbound-session) takes the number and the variables, and returns a token. Send the token in an `x-bland-session-id` header, and the agent receives every variable from the session. ## Send headers from Bland Bland can send call data to your PBX in SIP headers, on outbound calls and transfers. Set the mapping in the **Headers** section of the trunk's **Configure** tab: each entry maps a call variable to a SIP header name. * Header names get an `X-` prefix. A name that doesn't start with `X-` is sent as `X-`, and a leading `x_` becomes `X-`. `User-to-User`, `Remote-Party-ID`, `P-Preferred-Identity`, and `P-Called-Party-ID` are sent as written. * Up to 15 headers. * Saving the trunk's headers updates every number on the trunk. How headers travel on each transfer method is in [Transfers](/agents/sip-transfers#custom-headers). ## Common failures > [accordion] A header variable is empty > > Check the header is an `X-` header, and that the variable is all lowercase: `{{sip_header_x-account-id}}`, not `{{sip_header_X-Account-Id}}`. Open the call's SIP trace on the trunk's **Overview** tab to see exactly what your PBX sent. > [accordion] A mapped variable is empty but the sip\_header\_ variable works > > The mapping's `key` doesn't match the header name exactly, including case. Copy the name from the SIP trace. > [accordion] A mapped variable never changes > > The number's own request data sets the same variable, and it wins over SIP headers. Remove it from the number's settings, or map the header to a different name. > [accordion] P-Asserted-Identity isn't a variable > > Only `X-` headers become variables. Use the copy in `{{sip_header_x-original-pai}}`. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > Send headers to your PBX on a transfer. > [card] [Set up a trunk](/agents/sip-setup) > > Create the trunk your numbers use. Docs for agents: [llms.txt](/llms.txt) # 3CX Source: https://docs.bland.ai/agents/sip-integrations/3cx Connect a 3CX phone system to a Bland agent over SIP, and transfer callers back to 3CX extensions with SIP REFER Send calls from your 3CX phone system to a Bland agent, and let the agent transfer callers back to your 3CX extensions, queues, and ring groups. 3CX connects to Bland as a SIP trunk over TLS, with SRTP media. ## What works * Calls from 3CX to your agent * Outbound calls from your agent through 3CX * Transfers back to 3CX extensions, with SIP REFER * The original caller ID, passed to the agent in SIP headers ## Prerequisites * 3CX version 20, reachable from the internet on a fully qualified domain name (FQDN), for example `yourcompany.3cx.com` * Admin access to the 3CX Management Console * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support ## Configure 3CX **1. Add a SIP trunk for Bland** In the 3CX Management Console, go to **Voice & Chat** and add a SIP trunk. Set the server to your Bland region, for example `us2.sip.bland.ai`, port `5061`, transport TLS. The other regions are under [Connection endpoints](/agents/sip-network#connection-endpoints). Use IP-based authentication, with no registration. If 3CX asks for a main trunk number, enter one of the numbers you will route to Bland. **2. Set encryption and codecs** Set call encryption (SRTP) to **Mandatory**. Bland rejects calls offered with plain RTP. Put G.711 first in the codec list: PCMA (A-law) outside North America, PCMU (μ-law) in North America. Leave direct media off, so audio flows through 3CX. **3. Check the public IP** In 3CX's network settings, make sure 3CX advertises its real public IP. If automatic detection picks the wrong one, set it by hand. A wrong public IP is the most common cause of one-way or silent calls. **4. Allow Bland on your firewall** Allow TLS on port 5061 and SRTP on UDP 16384 to 32768 from all six of Bland's IPs for your region. **5. Route calls to Bland** Send the calls the agent should answer to the Bland trunk. For example, forward a DID, an IVR option, or a queue overflow to a number on the Bland trunk, with an outbound rule that picks the Bland trunk for that number. ## Configure Bland **1. Open the setup wizard** At **All agents**, go to **Dispatch**, then **Phone numbers**, then the **SIP** tab, and press **Create trunk**. **2. Provider** Pick **3CX** and enter your 3CX FQDN, for example `yourcompany.3cx.com`. Add a port only if 3CX listens for TLS on a port other than 5061. **3. Firewall** Confirm you allow-listed Bland's IPs, and continue. **4. Authentication** Pick **IP-based** and press **Create trunk**. **5. Numbers** Add the numbers 3CX sends to Bland, in E.164 format, for example `+61370000000`. **6. Assign an agent** Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. You know it worked when a call forwarded from 3CX reaches the agent and shows up on the trunk's **Overview** tab. ## Transfer callers back to 3CX Use SIP REFER. 3CX resolves the extension, rings it, and Bland leaves the call. In the agent's **Transfer Call** node, turn on **Allow SIP/DID targets** and **Hand off via SIP REFER**. Enter the target as a SIP URI with the extension number: ```text theme={null} sip:1018@yourcompany.3cx.com ``` Use the extension, queue, or ring group number 3CX knows internally, not a phone number. 3CX's dial plan doesn't map an E.164 target back to an extension. > [!NOTE] > > Use REFER rather than a new INVITE with 3CX. 3CX identifies a trunk by the IP a call comes from, and silently drops a new INVITE from an address it doesn't map to the Bland trunk. A REFER travels inside the call 3CX already accepted. See [Transfers](/agents/sip-transfers) for every transfer method. ## Caller ID When 3CX forwards a call to Bland, it sends the original caller in the `P-Asserted-Identity`, `Remote-Party-ID`, and `Diversion` headers. Your agent reads them as `{{sip_header_x-original-pai}}`, `{{sip_header_x-original-rpid}}`, and `{{sip_header_x-original-diversion}}`. See [SIP headers](/agents/sip-headers). A value of `anonymous` means the caller withheld their number. To keep the original caller in the `From` header too, set these outbound parameters on the Bland trunk in 3CX: * **From: User Part**: `OriginatorCallerID` * **From: Display Name**: `OriginatorCallerDisplayName` This doesn't apply to calls forwarded through a ring group, because the ring group places a new call. ## Common failures > [accordion] Calls connect with one-way or no audio > > 3CX advertises the wrong public IP, or the RTP range is blocked. Set the public IP by hand, and allow UDP 16384 to 32768 to and from Bland's media IPs. > [accordion] Calls are rejected with 488 Not Acceptable Here > > SRTP isn't on. Set call encryption to **Mandatory** on the Bland trunk in 3CX. > [accordion] Calls are challenged with 407 Proxy Authentication Required > > Bland doesn't recognize your 3CX's IP. Check the trunk in Bland uses **IP-based** authentication, and contact Bland support if your public IP changed. > [accordion] The TLS connection to Bland fails > > Use port 5061 with TLS, and make sure 3CX trusts the Let's Encrypt ISRG Root X1 CA. > [accordion] A transfer rings nothing, and 3CX never responds > > The transfer used a new INVITE from an IP 3CX doesn't map to the trunk. Turn on **Hand off via SIP REFER**. > [accordion] A REFER to a phone number fails > > 3CX can't route an E.164 target to an internal extension. Use the extension in the SIP URI, for example `sip:1018@yourcompany.3cx.com`. > [accordion] The call ended on the phone but stays live in Bland > > The `BYE` didn't reach Bland. Check nothing between 3CX and Bland closes the TLS connection early, and share the call's SIP trace with Bland support. 3CX's own packet capture helps compare both sides. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > REFER, new INVITE, and warm transfers. > [card] [Network and security](/agents/sip-network) > > Bland's regions, IPs, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # Bandwidth Source: https://docs.bland.ai/agents/sip-integrations/bandwidth Connect your Bandwidth numbers to a Bland agent over SIP for inbound calls, outbound calls, and transfers Use your Bandwidth phone numbers with a Bland agent. A SIP trunk connects Bandwidth and Bland, so the agent answers inbound calls and places outbound calls on your Bandwidth numbers and network. Setup is configuration only, on both sides. No code. > [!NOTE] > > **Verified integration.** Bandwidth built and tested this integration against the configuration on this page, on the Bandwidth Universal Platform. Integrations on Bandwidth's legacy platform are supported best effort. Bandwidth publishes the same steps in its [Bland integration guide](https://dev.bandwidth.com/docs/voice/integrations/bland). ## What works * Inbound calls to your agent * Outbound calls from your agent * Transfers from your agent ## Prerequisites * A Bandwidth Universal Platform account with Bland interconnect enabled. Open a ticket with your Bandwidth account representative, name the admin user who will configure it, and ask for a Bland integration * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support ## Configure Bandwidth Bland needs a Bandwidth SIP endpoint for both directions, so create it even if you only plan to use one. **1. Create a SIP realm** In the Bandwidth App, go to **Account**, then **SIP Credentials**, then **Manage Realms**, and press **Add**. Name the realm, for example `bland1`. Bandwidth generates the realm's FQDN, for example `bland1-decce2.auth.bandwidth.com`. Copy it exactly as shown. **2. Note your trunk group port** Go to **Trunk Group Configurations** and note the port assigned to your trunk group. It varies by account. Your SIP endpoint is the FQDN plus that port, for example `bland1-decce2.auth.bandwidth.com:5239`. **3. Route inbound calls to Bland** Go to **Service Management**, then **Voice Configuration**, and press **Add Package**. Name it, for example `Bland`. Under **Routing**, create the primary route, press **Add endpoint**, and set the type to **Route to domain name**. Enter Bland's endpoint for your region, for example `us2.sip.bland.ai:5061`. The other regions are under [Connection endpoints](/agents/sip-network#connection-endpoints). Press **Create Package**. Open each number your agent should answer, select the package under **Voice configuration package**, and save. Many numbers can share one package. **4. Create outbound credentials** Skip this if you only need inbound calls. Go to **Account**, then **SIP Credentials**, and press **Add**. Enter a username and password, select the realm you created, and save. ## Configure Bland Every trunk the Bland wizard builds carries both directions, so create one even for inbound only. **1. Open the setup wizard** At **All agents**, go to **Dispatch**, then **Phone numbers**, then the **SIP** tab, and press **Create trunk**. **2. Provider** Pick **Other** and enter your Bandwidth SIP endpoint, for example `bland1-decce2.auth.bandwidth.com:5239`. **3. Firewall** Bandwidth has already allow-listed Bland on its side. Tick the box and continue. **4. Authentication** Pick **IP-based**, and leave **Outbound routing** on **Via Bland's carrier**. Under **Outbound call credentials**, enter the username and password from your Bandwidth realm. Press **Create trunk**. **5. Numbers** Add each Bandwidth number in E.164 format, for example `+19195551234`. **6. Assign an agent** Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. You know it worked when a call to the number reaches the agent and shows up on the trunk's **Overview** tab. For outbound, use the number as `from` in [`POST /v1/calls`](/api-v1/post/calls). > [!TIP] > > The wizard's connection checks can report errors against a working Bandwidth endpoint. If they do, continue and confirm with a test call. ## Common failures > [accordion] Outbound calls are rejected with 403 or 407 > > The endpoint or credentials don't match. The endpoint in Bland must match the realm FQDN exactly, and the username and password must match the credential assigned to that realm. > [accordion] Calls fail before reaching Bandwidth > > The endpoint or port is wrong. Copy the FQDN verbatim, and use the port from your own trunk group configuration. > [accordion] Inbound calls don't reach the agent > > The number isn't on the Bland voice configuration package, or has no agent assigned in Bland. Check both. > [accordion] The call connects with no audio > > Transport or media encryption doesn't match. Bland requires TLS signaling and SRTP media. > [accordion] The number won't save in Bland > > Enter it in E.164 format, with the `+`. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > Send callers onward from the agent. > [card] [Network and security](/agents/sip-network) > > Bland's regions, IPs, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # Five9 Source: https://docs.bland.ai/agents/sip-integrations/five9 Send Five9 calls to a Bland agent over SIP and transfer callers back to your Five9 agents Put a Bland agent in front of, or alongside, your Five9 contact center. Five9 routes calls to Bland over a SIP trunk, the agent handles the conversation, and when a person is needed it transfers the caller back into Five9. > [!NOTE] > > **Five9 AI Agent Connect partner.** Bland is an accredited Five9 AI Agent Connect partner. The SIP connection between Five9 and Bland is built and tested once in Five9's partner environment, and reused for each customer. ## What works * Calls from Five9 to your agent * Transfers from your agent back to Five9 * Call data passed to Five9 in SIP headers * DTMF (RFC 2833) ## Prerequisites * A Five9 contact center (VCC) account, and your Five9 account team * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support * A Bland agent ready to answer, so the interop test exercises the real conversation ## How the call flows ```text theme={null} Caller ──> Five9 ──SIP/TLS──> Bland agent ──transfer──> Five9 skill or agent ``` Your Five9 IVR script sends the call to a number that routes over the SIP trunk to Bland, and the agent assigned to that number answers. To hand back, a **Transfer Call** node sends the caller to a Five9 number: Bland places a new `INVITE` to Five9 over the same trunk and bridges the audio. Signaling uses TLS on port 5061 and audio uses SRTP. Five9 recommends TLS, and Bland accepts TLS only. ## Order and configure Five9 **1. Order AI Agent Connect** Ask your Five9 account team for a quote for **AI Agent Connect**, with Bland as the AI agent partner. If you are not a Five9 customer yet, your Bland account team can register the opportunity with Five9. Five9 then opens a project, and Five9 Professional Services works with you on the IVR script. **2. Give Five9 the Bland connection details** Five9 Professional Services and your Five9 administrator need: * **Endpoint**: your Bland region, for example `us2.sip.bland.ai`. The other regions are under [Connection endpoints](/agents/sip-network#connection-endpoints) * **Transport**: TLS 1.2 or higher, port 5061 * **Media**: SRTP (`AES_CM_128_HMAC_SHA1_80`), UDP 16384 to 32768 * **Trusted peers**: all six Bland IPs for your region, signaling and media * **Certificate**: Let's Encrypt. The ISRG Root X1 CA must be trusted * **Number format**: E.164 or 10-digit. Bland accepts both **3. Route calls to Bland in Five9** Label the numbers that should reach Bland so they route over the Bland SIP trunk, not the PSTN. In your IVR script, send calls to those numbers where the agent should take over. **4. Tell Bland which numbers to use** Send your Bland account team the numbers Five9 will route to Bland, and the Bland organization they belong to. Bland attaches them to your organization and allow-lists Five9's SIP addresses. Also note the Five9 numbers or skills your agent should transfer callers back to. > [!NOTE] > > Some existing deployments use a dedicated SIP trunk ordered through Five9 Professional Services and configured with the Five9 SIP Workbook. That still works, but Five9 has noted it doesn't include a transfer module. Start new deployments with AI Agent Connect. ## Configure Bland **1. Assign an agent** Once Bland attaches your numbers, go to **All agents**, then **Dispatch**, then **Phone numbers**. Press **Configure** on each number and pick the agent under **Assignment**. **2. Add the transfer back to Five9** In the agent, add a **Transfer Call** node that sends the caller to the Five9 number for the right skill. See [Transfers](/agents/sip-transfers) for how transfers behave on SIP calls. **3. Pass call data to the Five9 agent** To hand over details such as an account number or the reason for the call, map call variables to SIP headers in the **Headers** section of the trunk's **Configure** tab. See [Custom headers](/agents/sip-transfers#custom-headers). ## Test before go-live Five9 requires a successful interop test before it allows go-live. Plan for: * **Real test numbers**, labeled for the Bland trunk on your Five9 domain. Five9 doesn't accept Twilio numbers or Five9-owned numbers as test numbers * **Every call path**. When Five9 assigns a primary and a secondary SBC, test through both * **The whole call**: two-way audio, DTMF, hold, and a transfer back to a live Five9 agent * **A Five9 user logged in as an agent**, so transfers back to Five9 have someone to land on Compare each test call's SIP trace on the trunk's **Overview** tab with Five9's logs. ## Common failures > [accordion] Five9's SIP OPTIONS ping to Bland times out > > Bland doesn't have Five9's current SBC IPs, or Five9 is pinging over UDP or port 5060. Send Bland the current SBC IPs, and check Five9 sends TLS to port 5061. > [accordion] Calls are rejected with 603 Decline > > The number isn't attached to your Bland organization. Send it to your Bland account team. > [accordion] Calls go to Five9 voicemail or stay inside Five9 > > The number is still an internal Five9 inbound number. Re-label it in Five9 so it routes out the Bland trunk. > [accordion] Test calls go over the phone network instead of the trunk > > The test number isn't routed over the trunk on both sides. Label it for the Bland trunk in Five9, and confirm Bland attached it. > [accordion] Calls drop mid-call with 481 Call/Transaction Does Not Exist > > Five9 has Bland's IPs on more than one trunk. Ask Five9 to keep them on a single trunk. > [accordion] The call connects with no audio > > SRTP isn't on, or Bland's media IPs aren't trusted. Enable SRTP toward Bland, and trust all six Bland IPs for your region. > [accordion] The transfer back to Five9 fails or lands in the wrong queue > > The transfer number isn't routed to a skill in the Five9 script. Check the script, and that a Five9 agent with that skill is logged in. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > Transfer methods and custom headers. > [card] [Network and security](/agents/sip-network) > > Bland's regions, IPs, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # NICE CXone Source: https://docs.bland.ai/agents/sip-integrations/nice-cxone Connect your NICE CXone Business Unit to Bland through the NICE DEVone partner SIP trunk Route calls from your NICE CXone contact center to a Bland agent. NICE and Bland already run a partner SIP trunk between CXone and Bland. You connect your CXone Business Unit (BU) to that trunk, then point numbers in your CXone routing at Bland. > [!NOTE] > > **NICE DEVone partner.** Bland is a NICE DEVone technology partner. NICE built and tested the Bland trunk once, over TLS with SRTP, and adds each customer Business Unit to it. A new customer doesn't need a new trunk or a repeat of the trunk testing. ## What works * Calls from CXone to your agent * US and EU connections, through `us2.sip.bland.ai` and `eu2.sip.bland.ai` * Returning the caller to CXone, arranged per deployment. See [Return calls to CXone](#return-calls-to-cxone) ## Prerequisites * A NICE CXone account, your **Business Unit number**, and your **NICE Account Manager** * Access to CXone Studio, or a NICE technical account manager who has it * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support ## How the call flows ```text theme={null} Caller ──> CXone (your BU) ──> NICE DEVone trunk ──SIP/TLS──> Bland agent ``` The DEVone trunk is multi-tenant. Bland's partner connection is the parent, and your Business Unit is added as a child. NICE assigns your BU a block of routing numbers, and calls your Studio script sends to those numbers arrive at Bland. Billing for the SIP sessions stays between you and NICE. NICE bills your Business Unit for the sessions configured for it. ## Connect your Business Unit **1. Order SIP sessions from NICE** Ask your NICE Account Manager for a contract or addendum that adds SIP sessions for the **Bland DEVone partner connection** to your Business Unit. Include your BU number, how many concurrent calls you want to send to Bland, and the region: US, EU, or both. This is usually the longest step, so start it first. **2. NICE adds your Business Unit to the trunk** Once the addendum is signed, the NICE Connectivity team adds your BU to Bland's partner trunk with the sessions you ordered. It assigns your BU a block of routing numbers for Bland, usually virtual numbers in the `999` range such as `+1999xxxxxxx`. Ask NICE to send the number range to you and to your Bland account team. **3. Bland attaches the numbers** Send your Bland account team the routing numbers and the Bland organization they belong to. Bland attaches them to your organization. Then assign an agent to each one. Go to **All agents**, then **Dispatch**, then **Phone numbers**, press **Configure** on the number, and pick the agent under **Assignment**. **4. Route calls in CXone** In CXone Studio, update the script for the point of contact that should reach Bland, so it sends the call to one of your Bland routing numbers. NICE has no template for this. Your CXone administrator or NICE technical account manager edits the script in your BU. **5. Test** From CXone MAX, dial a Bland routing number as a test user with the right skill, or call a point of contact linked to the updated script. The agent should answer. You know it worked when the call shows up on the trunk's **Overview** tab in Bland. NICE estimates one to two weeks from a signed addendum to working calls. ## Return calls to CXone The DEVone trunk only carries calls from CXone to Bland. If the caller needs to come back to a CXone agent, the return path is set up for your deployment, for example through the CXone APIs and your Studio script. Talk to your Bland account team before you build the script, so both sides agree on the hand-back. ## Connection details These are already configured on the partner trunk. They are listed for your network and security teams. * **Endpoints**: `us2.sip.bland.ai` (US) and `eu2.sip.bland.ai` (EU) * **Transport**: TLS 1.2 or higher, port 5061 * **Media**: SRTP, UDP 16384 to 32768 * **Certificate**: Let's Encrypt. The ISRG Root X1 CA must be trusted * **Number format**: E.164 Bland's IPs for each region are under [Connection endpoints](/agents/sip-network#connection-endpoints). ## Common failures > [accordion] MAX shows No Routes Found or a bad-number error > > The call never left your Business Unit. Ask NICE to confirm routing from your BU to the Bland trunk is set up on the cluster your BU runs on. > [accordion] Calls time out with 504 > > NICE is sending to port 5060 or without TLS. Bland accepts TLS on port 5061 only. Ask NICE to check the trunk profile is still TLS. > [accordion] Calls are rejected with 603 Decline > > The routing number isn't attached to your Bland organization. Send the number range to your Bland account team. > [accordion] Calls are rejected with 407 > > The number points at a Bland hostname other than the production endpoints. Ask NICE to route to `us2.sip.bland.ai` or `eu2.sip.bland.ai`. > [accordion] The call connects with no audio > > Media is blocked or not encrypted. Confirm SRTP is on and Bland's media IPs are allowed. > [accordion] The order seems stuck > > The addendum isn't signed yet. NICE can't provision sessions until it is, so follow up with your NICE Account Manager. ## Next steps > [card] [Network and security](/agents/sip-network) > > Bland's regions, IPs, and TLS and SRTP. > [card] [Dispatch](/agents/dispatch) > > Assign agents to your routing numbers. Docs for agents: [llms.txt](/llms.txt) # Telnyx Source: https://docs.bland.ai/agents/sip-integrations/telnyx Connect your Telnyx numbers to a Bland agent over SIP with an FQDN connection, TLS, and SRTP Use your Telnyx phone numbers with a Bland agent. Telnyx sends inbound calls to Bland over an FQDN connection, and Bland places outbound calls through Telnyx with your SIP credentials. Both directions use TLS and SRTP. > [!NOTE] > > These steps use the Mission Control Portal settings Telnyx documents. Portal labels can change, so match by field name if one differs. ## What works * Inbound calls to your agent * Outbound calls from your agent * Transfers from your agent, as a new call through Telnyx ## Prerequisites * A Telnyx account with the numbers you want to use, and an outbound voice profile for outbound calls * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support ## Configure Telnyx **1. Create an FQDN connection** In the Mission Control Portal, go to **Voice**, then **SIP Trunking**, and add a SIP connection of type **FQDN**. Telnyx only sends inbound calls over TLS on FQDN, IP, and Microsoft Teams connections. **2. Add Bland as the destination** Under **Authentication and routing**, press **Add FQDN**. Set the DNS record type to `A`, the FQDN to your Bland region, for example `us2.sip.bland.ai`, and the port to `5061`. The other regions are under [Connection endpoints](/agents/sip-network#connection-endpoints). Under **Inbound calls routing**, select the Bland FQDN. **3. Set the inbound options** On the connection's **Inbound** tab: * **SIP transport protocol**: TLS * **Encrypted media**: SRTP. Telnyx turns encryption off by default, and Bland requires it * **Number format** for DNIS and ANI: +E.164, so Bland receives full numbers with the `+` * **SIP region**: the one nearest your Bland endpoint, for example Europe for `eu2.sip.bland.ai` * **SIP subdomain**: leave empty. Telnyx doesn't allow TLS on subdomain calls **4. Create outbound credentials** Skip this if you only need inbound calls. Under **Authentication and routing**, then **Outbound calls authentication**, set the method to **Credentials** and enter a username and password. On the **Outbound** tab, pick an **Outbound Voice Profile** that allows the destinations you will call. Set **Localization country** if you dial outside the US. **5. Assign your numbers** Go to **Numbers**, then **My Numbers**, and set each number's connection to the FQDN connection. ## Configure Bland **1. Open the setup wizard** At **All agents**, go to **Dispatch**, then **Phone numbers**, then the **SIP** tab, and press **Create trunk**. **2. Provider** Pick **Other** and enter the Telnyx SIP host for your region, with port 5061: | Region | Telnyx host | | - | - | | US | `sip.telnyx.com:5061` | | Canada | `sip.telnyx.ca:5061` | | Europe | `sip.telnyx.eu:5061` | | Australia | `sip.telnyx.com.au:5061` | **3. Firewall** Telnyx reaches Bland over the public internet, with no firewall of yours in between. Tick the box and continue. **4. Authentication** Pick **IP-based**, and leave **Outbound routing** on **Via Bland's carrier**. Under **Outbound call credentials**, enter the Telnyx username and password. Press **Create trunk**. **5. Numbers** Add each Telnyx number in E.164 format, for example `+13125550100`. **6. Assign an agent** Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. You know it worked when a call to the number reaches the agent and shows up on the trunk's **Overview** tab. For outbound, use the number as `from` in [`POST /v1/calls`](/api-v1/post/calls). ## Caller ID Telnyx validates the caller ID on every outbound call, and requires E.164 for calls that cross borders. Call from a number on your Telnyx account, in E.164 format. ## Common failures > [accordion] Inbound calls never reach Bland > > The transport is UDP, or the number isn't on the connection. Set **SIP transport protocol** to TLS on port 5061, and assign the number to the FQDN connection. > [accordion] Inbound calls are challenged with 407 > > Telnyx sent the call from an IP Bland doesn't trust for your trunk. Check the trunk endpoint in Bland matches your Telnyx region, then contact Bland support with the call's SIP trace. > [accordion] Inbound calls are rejected with 603 Decline > > The number isn't attached in Bland, or arrives without the `+`. Attach it, and set the DNIS number format to +E.164. > [accordion] Calls fail right after answer, or are rejected with 488 > > SRTP isn't on. Set **Encrypted media** to SRTP on the connection. > [accordion] Outbound calls are rejected with 401 or 403 > > The credentials in Bland don't match Telnyx, or your outbound voice profile doesn't allow the destination. > [accordion] Outbound calls fail with 403 Caller Origination Number is Invalid > > The caller ID failed Telnyx's validation. Call from a Telnyx number in E.164 format. > [accordion] Outbound calls outside the US fail with 404 > > **Localization country** isn't set on the connection's **Outbound** tab. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > Send callers onward from the agent. > [card] [Network and security](/agents/sip-network) > > Bland's regions, IPs, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # Twilio Source: https://docs.bland.ai/agents/sip-integrations/twilio Connect numbers on a Twilio Elastic SIP Trunk to a Bland agent over SIP with Secure Trunking Keep your numbers on a Twilio Elastic SIP Trunk and have a Bland agent answer them. Twilio sends inbound calls to Bland over TLS with SRTP, and Bland places outbound calls through your trunk's termination URI. Your numbers stay on your trunk, and Bland never gets your Twilio API credentials. You can split numbers between Bland and your own PBX. > [!NOTE] > > Want Bland to run calls on your Twilio numbers without any SIP setup? Use [Custom Twilio](/tutorials/custom-twilio) instead. It connects your Twilio account to Bland by API. ## What works * Inbound calls to your agent * Outbound calls from your agent * Transfers from your agent, with SIP REFER ## Prerequisites * A Twilio account with Elastic SIP Trunking, and the numbers you want to use * A Bland account with SIP trunking enabled. If there is no **SIP** tab under **Phone numbers**, contact Bland support ## Configure Twilio **1. Create the trunk** In the Twilio Console, go to **Elastic SIP Trunking**, then **Trunks**, and create a trunk. Name it, for example `Bland`. **2. Turn on Secure Trunking and Call Transfer** Under **General**, turn on **Secure Trunking**. Twilio then rejects any unencrypted call, which matches Bland: TLS signaling and SRTP media. On the same page, turn on **Call Transfer (SIP REFER)**, and transfers to the PSTN if your agent transfers to phone numbers. Leave **Caller ID for Transfer Target** on **Transferee** so the target sees the original caller. **3. Point origination at Bland** Under **Origination**, add an origination SIP URI for your Bland region, with TLS on port 5061: ```text theme={null} sip:us2.sip.bland.ai:5061;transport=tls ``` Use `sip:` with `;transport=tls`, not `sips:`. Use port 5061 exactly: Bland reserves its other SIP ports for its own carrier connections. The other regions are under [Connection endpoints](/agents/sip-network#connection-endpoints). Bland already trusts Twilio's published signaling IPs, so there is nothing to allow-list. **4. Add your numbers** Under **Numbers**, associate the numbers your agent should answer with the trunk. **5. Create termination credentials** Skip this if you only need inbound calls. Under **Termination**, note your termination SIP URI, for example `yourcompany.pstn.twilio.com`. Under **Authentication**, create a **Credential List** with a username and password, and attach it to the trunk. Use a credential list, not an IP access control list. Bland's outbound calls don't come from a fixed set of IPs you can list. ## Configure Bland **1. Open the setup wizard** At **All agents**, go to **Dispatch**, then **Phone numbers**, then the **SIP** tab, and press **Create trunk**. **2. Provider** Pick **Twilio** and enter your termination SIP URI, for example `yourcompany.pstn.twilio.com`. No port needed. The wizard skips the firewall step for Twilio. **3. Authentication** Pick **IP-based**, and leave **Outbound routing** on **Via Bland's carrier**. Under **Outbound call credentials**, enter the username and password from your Twilio credential list. Press **Create trunk**. **4. Numbers** Add each number in E.164 format, for example `+14155550100`. **5. Assign an agent** Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. You know it worked when a call to the number reaches the agent and shows up on the trunk's **Overview** tab. For outbound, use the number as `from` in [`POST /v1/calls`](/api-v1/post/calls). ## Caller ID and transfers Twilio only accepts outbound calls whose caller ID is a number on your Twilio account or a verified caller ID, in E.164 format. Place outbound calls from a number on the trunk. The same rule shapes transfers. When Bland bridges a transfer, the target can't see the original caller, because that number isn't on your account. With SIP REFER, Twilio places the transfer itself and shows the original caller. To transfer with REFER, turn on **Hand off via SIP REFER** in the agent's **Transfer Call** node and enter the target in E.164 format. Bland leaves the call once Twilio takes it. Twilio can't transfer to emergency numbers, and plays no early media during a REFER. See [Transfers](/agents/sip-transfers) for every transfer method. ## Common failures > [accordion] Inbound calls don't reach Bland > > Check the origination URI is `sip:.sip.bland.ai:5061;transport=tls`, and that **Secure Trunking** is on. > [accordion] Inbound calls are rejected with 603 Decline > > The number isn't attached in Bland. Attach it on the trunk in E.164 format. > [accordion] Outbound calls are rejected with 401 or 403 > > The username and password in Bland don't match the credential list attached to the trunk. > [accordion] Outbound calls fail with 400 or a caller ID error > > The caller ID isn't a number on your Twilio account, or isn't in E.164 format. Call from a number on the trunk, with the `+`. > [accordion] Transfers fail > > **Call Transfer (SIP REFER)** is off on the trunk, or transfers to the PSTN aren't allowed. Turn both on. > [accordion] The call connects with no audio > > **Secure Trunking** is off. Twilio and Bland both need SRTP with `AES_CM_128_HMAC_SHA1_80`. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > REFER, new INVITE, and warm transfers. > [card] [Custom Twilio](/tutorials/custom-twilio) > > Connect your Twilio account by API instead. Docs for agents: [llms.txt](/llms.txt) # Network and security Source: https://docs.bland.ai/agents/sip-network Bland's regional SIP endpoints and IPs, what to allow-list on your firewall, and the TLS, SRTP, and codec requirements Bland runs a SIP edge in four regions. Each region has one endpoint, two signaling IPs, and four media IPs, and all of them are static. This page lists them, what to allow on your firewall, and the security requirements every connection must meet. ## Connection endpoints Connect to the endpoint closest to your infrastructure. Signaling and media use different IP addresses: * **Signaling (calls you send to Bland):** TLS on TCP port 5061 only. Each region has two signaling IPs, one per availability zone, behind its endpoint. Send SIP to the endpoint and it balances across both. * **Media:** SRTP on a separate set of four media IPs per region, over UDP ports 16384 to 32768. * **Calls Bland places to you:** when Bland sends an `INVITE` to your SBC, for example for a [transfer](/agents/sip-transfers) or a warm transfer consult call, the TLS connection comes from one of the region's media IPs. | Region | Endpoint (TLS 5061) | Signaling IPs (SIP you send to Bland) | Media IPs (RTP, and SIP over TLS that Bland sends to you) | | - | - | - | - | | United States | `us2.sip.bland.ai` | `35.82.60.77`, `52.27.163.2` | `52.13.231.129`, `35.160.144.213`, `44.234.13.26`, `54.218.96.252` | | Canada | `ca2.sip.bland.ai` | `15.156.129.66`, `15.157.196.128` | `3.96.68.79`, `35.183.80.246`, `52.60.169.171`, `16.54.43.127` | | Asia-Pacific | `asia2.sip.bland.ai` | `32.236.162.210`, `3.104.20.26` | `3.104.151.70`, `15.134.58.75`, `52.62.109.3`, `54.79.10.189` | | Europe | `eu2.sip.bland.ai` | `52.17.235.44`, `34.250.51.24` | `3.248.61.228`, `54.194.194.135`, `52.215.80.226`, `108.132.103.51` | Use the full SIP URI for your region, for example `us2.sip.bland.ai:5061;transport=tls`. ## Firewall allow-list For your region: * Allow outbound TLS on port 5061 from your SBC to the signaling IPs. * Allow UDP 16384 to 32768 to and from the media IPs, or audio will not flow. * Allow inbound SIP over TLS from all six IPs, signaling and media, and configure all six as trusted SIP peers on your SBC. A firewall rule alone is not enough: an SBC that doesn't recognize the source as a peer rejects the `INVITE` with `403 Forbidden`. You can also copy the list from the **Firewall** section of the trunk's **Configure** tab, or fetch it with [`GET /v1/sip/firewall-ips`](/api-v1/get/sip-firewall-ips). > [!NOTE] > > Allow-listing is mutual. Bland allow-lists your source IPs, and you allow-list Bland's. > [!WARNING] > > Match Bland by source IP, not by the `Via` or `Contact` header. On an `INVITE` that Bland sends, those headers carry a signaling IP while the connection itself comes from a media IP. ## Requirements and security | | Requirement | | - | - | | Transport | TLS 1.2 or higher, TCP port 5061 only. UDP and port 5060 are not accepted | | Certificate | Let's Encrypt. Your SBC must trust the [ISRG Root X1](https://letsencrypt.org/certs/isrgrootx1.pem) CA | | Media | SRTP with `AES_CM_128_HMAC_SHA1_80`, over UDP 16384 to 32768. RTCP uses the RTP port plus 1 | | Codecs | Opus, G.722, PCMU (G.711 μ-law), PCMA (G.711 A-law). G.729 is not supported | | Methods | `INVITE`, `ACK`, `BYE`, `CANCEL`, `OPTIONS`, `REFER` | | DTMF | RFC 2833 (RTP telephone-event) | | Number format | E.164 for phone numbers. DIDs and extensions on numbers attached to a trunk | | Authentication | IP-based (default) or SIP REGISTER. Bland answers a `401` or `407` challenge on calls it places with the trunk's outbound call credentials | ## Limits * Up to 100 numbers per attach request. * Each number has one inbound and one outbound configuration. * Test calls are limited to 10 per 15 minutes per organization. * One endpoint discovery runs per organization at a time. * Health checks probe outbound endpoints with SIP OPTIONS. An inbound-only configuration shows as "unchecked" because there is no outbound endpoint to probe. ## Next steps > [card] [Set up a trunk](/agents/sip-setup) > > Create a trunk with the setup wizard. > [card] [Static IPs](/platform/static-ips) > > Every IP Bland uses, beyond SIP. Docs for agents: [llms.txt](/llms.txt) # Number porting Source: https://docs.bland.ai/agents/sip-porting Port numbers you own from another carrier to Bland with the porting wizard or API, and track each request Move phone numbers you own from another carrier to Bland. This lets you use your existing business numbers directly with Bland's SIP infrastructure without maintaining a separate SIP provider. ## How porting works Number porting is a regulated process coordinated between carriers. It typically takes **7 to 14 business days** depending on the losing carrier and number type. The process follows these stages: | Status | Description | | - | - | | `waiting_for_signature` | Port request created. A Letter of Authorization (LOA) needs to be signed. | | `submitted` | LOA signed and submitted to the losing carrier. | | `in_progress` | The losing carrier is processing the port. | | `completed` | Numbers have been ported successfully and are active on Bland. | | `canceled` | The port request was canceled. | | `failed` | The port request failed (for example, incorrect account information). | You can track port requests from the **Port a number** wizard, whose first step lists the ones currently in flight, or via the [API](/api-v1/get/sip-port-requests). > [!NOTE] > > There is no completed or historical view in the dashboard. The list inside the wizard shows active requests only, so a port that has finished, failed or been canceled disappears from it. The API returns the full set. ## Port numbers from the dashboard Press **Port a number** on the SIP tab to open the porting wizard. ### Step 1: Enter numbers Enter the phone numbers you want to port and click **"Check portability"** to verify they can be transferred. The portability check verifies each number against the carrier database and returns whether the number is portable, the number type (mobile, landline, toll-free), and whether a PIN is required from the losing carrier. > [accordion] API > > Check portability with [`GET /v1/sip/port/check`](/api-v1/get/sip-port-check): > > ```bash theme={null} > curl -X GET 'https://api.bland.ai/v1/sip/port/check?phone_numbers[]=%2B14150000000' \ > -H "Authorization: Bearer " > ``` > > Returns `portable` (boolean), `number_type`, and `pin_required` for each number. ### Step 2: LOA information Provide the details needed for the Letter of Authorization: * **Authorized representative**: Name and email of the person authorized to port the numbers * **Service address**: The address on file with the losing carrier (must match their records) * **Target port date**: Earliest date for the port. The picker will not accept anything sooner than 4 days out. * **Proof of ownership**: Upload a utility bill or carrier invoice (PDF or image, max 10MB) showing the account name and service address > [accordion] API > > Upload your proof of ownership document with [`POST /v1/sip/port/document`](/api-v1/post/sip-port-document): > > ```bash theme={null} > curl -X POST https://api.bland.ai/v1/sip/port/document \ > -H "Authorization: Bearer " \ > -F "file=@/path/to/utility-bill.pdf" > ``` > > Returns a `document_sid` to reference when initiating the port. ### Step 3: Confirm and submit Review all details and submit. You'll receive an email with the LOA for electronic signature. Once signed, the port request is submitted to the losing carrier. The signing link is good for 30 days. A request whose LOA goes unsigned past that has to be started again. After the port completes, your numbers are automatically registered as inbound numbers on Bland and ready to use. > [accordion] API > > Submit the port request with [`POST /v1/sip/port/initiate`](/api-v1/post/sip-port-initiate): > > ```bash theme={null} > curl -X POST https://api.bland.ai/v1/sip/port/initiate \ > -H "Authorization: Bearer " \ > -H "Content-Type: application/json" \ > -d '{ > "phone_numbers": ["+14150000000"], > "losing_carrier_information": { > "customer_type": "Business", > "customer_name": "Acme Corp", > "account_number": "ACC-12345", > "account_telephone_number": "+14150000000", > "authorized_representative": "Jane Doe", > "authorized_representative_email": "jane@acme.com", > "address": { > "street": "123 Main St", > "city": "San Francisco", > "state": "CA", > "zip": "94105", > "country": "US" > } > }, > "target_port_in_date": "2026-03-20", > "documents": ["doc_abc123"] > }' > ``` > > Track progress with [`GET /v1/sip/port`](/api-v1/get/sip-port-requests) or cancel with [`DELETE /v1/sip/port/:id`](/api-v1/delete/sip-port-cancel). ## Next steps > [card] [Set up a trunk](/agents/sip-setup) > > Connect a carrier you are keeping. > [card] [Dispatch](/agents/dispatch) > > Assign the ported numbers to agents. Docs for agents: [llms.txt](/llms.txt) # Set up a trunk Source: https://docs.bland.ai/agents/sip-setup Create a SIP trunk with the setup wizard or API, attach numbers and DIDs, and inspect calls with the SIP trace A trunk is a reusable connection to your SIP infrastructure. It holds your provider's endpoint, the transport, and authentication. You create it once and attach numbers and DIDs to it. > [!NOTE] > > Using 3CX, Bandwidth, Five9, NICE CXone, Telnyx, or Twilio? Follow that provider's guide under **SIP integrations** in the sidebar. It covers the provider side and the exact values to enter here. ## Prerequisites * An endpoint on your carrier, PBX, or SBC that Bland can reach over TLS on port 5061, with SRTP enabled * Firewall access to allow-list Bland's [signaling and media IPs](/agents/sip-network#connection-endpoints) * The numbers you will route, on your own carrier. Numbers bought from Bland can't be attached to a trunk ## Create a trunk On the **SIP** tab, press **Create trunk**. The wizard names the trunk from the provider and endpoint, and every trunk it builds carries both directions. Rename it later on the trunk's **Configure** tab. > [!WARNING] > > The trunk is created at the **Authentication** step, not at the end. Pressing **Create trunk** there writes the trunk before you pick a single number. Leaving after that point leaves a real trunk behind with nothing attached. **1. Provider** Pick your provider and enter its SIP endpoint. The field accepts a hostname, an IP, a full SIP URI such as `sip:user@host:5061;transport=tls`, or shorthand such as `tls://host`. The wizard parses the host, port, and transport. The catalog has instructions for Twilio, Vonage, Asterisk / FreePBX, 3CX, Cisco UCM / CUBE, and RingCentral. For anything else, including Bandwidth and Telnyx, pick **Other**. Microsoft Teams can't connect directly. Put a certified SBC between Teams and Bland, and enter the SBC's address. **2. Discovery** Bland probes your endpoint. It resolves DNS (A, AAAA, and SRV records), sends SIP OPTIONS to common ports over UDP, TCP, and TLS, and detects your system, codecs, and methods. It then shows the recommended port and transport. You can skip discovery and enter settings yourself. **3. Firewall** The wizard lists the Bland IPs and ports to allow-list. The full reference is in [Connection endpoints](/agents/sip-network#connection-endpoints). Tick the confirmation box to continue. Cloud providers such as Twilio, Vonage, and RingCentral skip this step, because there is no firewall of yours to change. **4. Authentication** Choose how Bland and your server trust each other: * **IP-based** (recommended): your server trusts Bland's IPs as SIP peers, and Bland trusts your endpoint by its source IP. No credentials to manage. * **Registration-based**: Bland registers with your server using a username and password. **Generate password** creates a strong one. Then choose how outbound calls leave Bland: * **Via Bland's carrier** (default): Bland's carrier places the call to your SIP endpoint. Nothing else to set up. * **Direct to your carrier (BYOC)**: Bland sends the call straight to your carrier, so termination runs on your own carrier contract. Your carrier must support TLS, and the caller IDs you dial from must be authorized on that account. Under **Outbound call credentials**, enter the SIP username and password your carrier gave you. Bland uses them to answer a `401` or `407` challenge. They are optional with Bland's carrier and required with direct routing. Press **Create trunk**. **5. Numbers** Add the numbers to route through the trunk, or skip and add them later from the trunk's **Numbers** tab. **6. Complete** The trunk is live. **Test connection** at the top of the trunk page sends a SIP OPTIONS ping to your endpoint over TLS. ## Attach numbers and DIDs Numbers inherit the trunk's endpoint, transport, and authentication, so you don't repeat them per number. * **Phone numbers** are stored in E.164, for example `+14155550100`. * **DIDs and extensions**, such as `2001`, are stored as written when the number is attached to a trunk. * Each number has its own **inbound** and **outbound** configuration. Attach numbers from the trunk's **Numbers** tab, or up to 100 at a time with [`POST /v1/sip/attach`](/api-v1/post/sip-attach): ```bash theme={null} curl -X POST https://api.bland.ai/v1/sip/attach \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+14155550100", "2001"], "directions": [{ "type": "inbound" }, { "type": "outbound" }], "service": "sip", "trunk_id": "" }' ``` The response lists `configured` numbers, and `failed` numbers with a reason for each. Then assign an agent to each number. Under **Phone numbers**, press **Configure** on the number and pick the agent under **Assignment**. ## Inspect a call Open a trunk's **Overview** tab and select a call to see its SIP trace: every message on every leg, as a sortable table or a ladder diagram, with full headers and SDP. Copy or export it to share with your carrier. The call log beside it shows each call's direction, status, SIP response code, and duration. ## Advanced configuration [`PATCH /v1/sip/config`](/api-v1/patch/sip-config) saves failover servers, codec preferences, and alert thresholds for a number. Bland stores these settings but does not apply them to calls yet, and there is no dashboard control for them: * Calls use the single endpoint on the trunk. There is no automatic failover. * Calls use Bland's standard [codec list](/agents/sip-network#requirements-and-security), whatever order you save. * No SIP-specific alerts are sent. ## Do it with the API > [accordion] Validate an endpoint > > [`POST /v1/sip/parse-destination`](/api-v1/post/sip-parse-destination) parses a destination into its host, port, user, and transport: > > ```bash theme={null} > curl -X POST https://api.bland.ai/v1/sip/parse-destination \ > -H "Authorization: Bearer " \ > -H "Content-Type: application/json" \ > -d '{ "input": "sip:your.provider.com:5061;transport=tls" }' > ``` > [accordion] Run discovery > > [`POST /v1/sip/discover`](/api-v1/post/sip-discover) runs the full probe. The `recommended` object in the response has the `port`, `transport`, and `detected_system`. One discovery runs per organization at a time. Poll a long one with [`GET /v1/sip/discover/status`](/api-v1/get/sip-discover-status). > > ```bash theme={null} > curl -X POST https://api.bland.ai/v1/sip/discover \ > -H "Authorization: Bearer " \ > -H "Content-Type: application/json" \ > -d '{ "host": "sip.example.com" }' > ``` > [accordion] Get the IPs to allow-list > > [`GET /v1/sip/firewall-ips`](/api-v1/get/sip-firewall-ips) returns your region's IPs and ports. > > ```bash theme={null} > curl https://api.bland.ai/v1/sip/firewall-ips \ > -H "Authorization: Bearer " > ``` > [accordion] Use registration authentication > > Set `auth_mode` in the inbound direction of [`POST /v1/sip/attach`](/api-v1/post/sip-attach): > > ```json theme={null} > { > "type": "inbound", > "auth_mode": "register", > "register_auth": { > "username": "my-trunk", > "password": "a-strong-password" > } > } > ``` > > The response includes `register_password_for_pbx`, a one-time derived password to configure in your PBX. [`GET /v1/sip/generate-password`](/api-v1/get/sip-generate-password) returns a strong, PBX-safe password between 8 and 256 characters. > [accordion] Create a named or one-direction trunk > > The wizard always builds a two-way trunk with a generated name. `POST /v1/sip/trunks` takes a name and a single direction. > [accordion] Check a number's health > > [`GET /v1/sip/status`](/api-v1/get/sip-status) returns the health of a number's SIP configuration. > > ```bash theme={null} > curl 'https://api.bland.ai/v1/sip/status?phone_number=%2B14155550100' \ > -H "Authorization: Bearer " > ``` ## Common failures > [accordion] Attaching a number fails > > Numbers bought from Bland can't be attached to a trunk. Attach numbers that live on your own carrier. > [accordion] Test connection fails but calls work > > Test connection sends SIP OPTIONS over TLS. Some carriers don't answer OPTIONS from Bland. Place a test call to be sure. > [accordion] Inbound calls are rejected with 603 Decline > > The number your carrier sends isn't attached to a trunk in your organization. Attach it in E.164 format, with the `+`. > [accordion] Inbound calls are challenged with 407 > > Bland doesn't trust the IP the call came from. Check that the trunk endpoint matches the server that sends your calls. If your server's public IP changed, contact Bland support. ## Next steps > [card] [Transfers](/agents/sip-transfers) > > Send callers to a DID, extension, or SIP URI. > [card] [Network and security](/agents/sip-network) > > Regions, IPs to allow-list, and TLS and SRTP. Docs for agents: [llms.txt](/llms.txt) # Transfers Source: https://docs.bland.ai/agents/sip-transfers Transfer SIP calls to a DID, extension, or SIP URI with SIP REFER, a new INVITE, or a warm transfer, and pass call data in SIP headers A **Transfer Call** node can send the caller to a DID, an extension, or a SIP URI on your trunk instead of a phone number. On the node, turn on **Allow SIP/DID targets** and enter the target, for example `2001` or `sip:2001@pbx.example.com`. Bland resolves the target over the trunk the call arrived on. For a call that did not arrive over SIP, Bland uses your organization's outbound trunk. You choose how the transfer is delivered: | | SIP REFER hand-off | New INVITE (REFER off) | Warm transfer | | - | - | - | - | | Node setting | **Hand off via SIP REFER** on | **Hand off via SIP REFER** off | **Warm transfer** on | | What your SBC receives | A `REFER` inside the call your SBC already opened to Bland | A new `INVITE` from Bland to your trunk endpoint | A new `INVITE` from Bland for the consult call | | Who places the call to the target | Your PBX | Bland | Bland | | Bland after the transfer | Leaves the call | Stays in the call path and bridges the audio | Joins the caller once the briefing ends | | Requires | A call that arrived over SIP, and a PBX that supports `REFER` | Your SBC trusting Bland's media IPs as SIP peers | Your SBC trusting Bland's media IPs as SIP peers | **SIP REFER hand-off.** Bland sends the `REFER` on the existing dialog, so no new connection reaches your SBC and no firewall change is needed. Custom headers travel as header parameters on the `Refer-To` URI (`sip:2001@pbx.example.com?X-Account=42`). Your PBX must copy them onto the `INVITE` it sends to the target. If your PBX cannot do that, use a new INVITE instead. **New INVITE.** Bland's SIP infrastructure sends the `INVITE` to your trunk endpoint over TLS with SRTP, and your custom headers arrive as SIP headers on that `INVITE`. If your SBC answers with a `401` or `407` challenge, Bland responds with the outbound call credentials saved on the trunk. **Warm transfer.** Bland places the consult call to your trunk the same way as a new INVITE, briefs whoever answers, then joins the caller. With **Attended transfer via SIP REFER + Replaces** on, Bland completes the merge by sending your PBX a `REFER` with `Replaces`, which requires a call that arrived over SIP. > [!NOTE] > > Bland sends your trunk's credentials and custom headers only to the trunk's own host. A full SIP URI that points at a different host is dialed as written, without them. ## Custom headers To read headers from inbound calls as variables, see [SIP headers](/agents/sip-headers). Headers on a transfer come from the trunk's **outbound** header mapping, set in the **Headers** section of the trunk's **Configure** tab or with the `headers` object in [`POST /v1/sip/attach`](/api-v1/post/sip-attach). Each entry maps a call variable to a SIP header name. If the trunk has no outbound header mapping, no custom headers are sent on any transfer method. * **Header names get an `X-` prefix.** A name that does not start with `X-` is sent as `X-`, and a leading `x_` becomes `X-`. `User-to-User`, `Remote-Party-ID`, `P-Preferred-Identity`, and `P-Called-Party-ID` are sent as written. * **Up to 15 headers** per direction. * **Numbers inherit the trunk's headers.** Saving the trunk's header mapping updates every number bound to it. ## Common failures > [accordion] Your SBC answers the transfer with 403 Forbidden, with no 401 or 407 first > > The `INVITE` came from an IP your SBC doesn't trust as a SIP peer. Trust every IP under [Connection endpoints](/agents/sip-network#connection-endpoints) as a SIP peer, signaling and media. > [accordion] No INVITE reaches your SBC, and the transfer fails after a few seconds > > A firewall is dropping TLS from Bland. Allow all of Bland's IPs for your region to reach your SBC's SIP TLS port. > [accordion] The transfer is rejected with 488 Not Acceptable Here > > Your SBC offered or required plain RTP. Enable SRTP on the trunk toward Bland. > [accordion] Headers are missing after a SIP REFER hand-off > > Your PBX doesn't copy `Refer-To` header parameters onto the new `INVITE`. Turn **Hand off via SIP REFER** off so Bland sends the `INVITE` with the headers. ## Next steps > [card] [Set up a trunk](/agents/sip-setup) > > Map call variables to headers on the trunk. > [card] [Warm transfer](/tutorials/warm-transfer) > > Brief the person before the caller joins. Docs for agents: [llms.txt](/llms.txt) # Enterprise Support Portal Source: https://docs.bland.ai/agents/support-portal Open, track and reply to support tickets from the Bland dashboard. ## Overview The Enterprise Support Portal is where your team opens support tickets, follows every reply, and sees your organization's ticket history. It's built into the Bland dashboard, so there's no separate login and nothing to install. > [!NOTE] > > The portal is only in the new dashboard at [v2.app.bland.ai](https://v2.app.bland.ai), and it's turned on per organization. If you don't see a Tickets tab next to Contact support, your organization doesn't have the portal yet. Use the Contact support form to request access. ## Get started 1. Sign in at [v2.app.bland.ai](https://v2.app.bland.ai), click your organization's name at the bottom of the sidebar, then click **Contact support**. Check that you see the Tickets tab. 2. Give the admin role to anyone on your team who needs to follow every ticket. 3. Agree as a team on how you'll use each severity. 4. Bookmark [status.bland.ai](https://status.bland.ai), and check it before you open a ticket. ### Who can see tickets Anyone in your organization can open a ticket. What they can see depends on their role: | Role | Can see | | - | - | | Owner and admins | Every ticket in the organization, with a filter for who opened it | | Everyone else | Only the tickets they opened | ## What to expect * Every ticket is reviewed by Bland's support team, and tickets are worked in order of severity. * Each severity has a first-response time, from 1 hour for Critical to 8 business hours for Low. See [Choose a severity](#choose-a-severity). * Bland support confirms the severity of every ticket and may reclassify it. See [Choose a severity](#choose-a-severity). * We communicate through the ticket. Every reply appears in the portal and goes to you by email. * A ticket stays open until it's resolved, including while our engineering team works on a fix. See [How tickets are resolved](#how-tickets-are-resolved). * A ticket that's waiting on your reply is closed after 7 days. See [Ticket status](#ticket-status). ## Open a ticket **1. Go to Contact support** Make sure you're signed in to the organization that has the problem. Tickets are filed under the organization you're working in. Then click your organization's name at the bottom of the sidebar, and click **Contact support**. **2. Add a title and severity** Write a one-line title that says what's wrong, then choose a severity. See [Choose a severity](#choose-a-severity). **3. Pick a topic** A topic is optional, but it helps. Most topics ask a question or two, such as which pathway, which phone number, or which call IDs are affected. **4. Describe the problem** Under "What's happening?", describe the problem. See [What to include](#what-to-include) for the details we need. **5. Attach screenshots** Add up to five screenshots if they help. In the portal, you can attach files only when you open a ticket. **6. Open the ticket** Click **Open ticket**. You'll land on your new ticket, and we'll reply there and by email. ## Choose a severity Severity sets the order in which we work tickets. Choose the level that matches the impact on your business right now. | Severity | Use it when | Examples | First response | | - | - | - | - | | Critical | Production is down or calls are failing for everyone. | All outbound calls fail. Your inbound numbers stop answering. | 1 hour, 24/7 | | High | An agent can't do a core part of its job, and there's no workaround. | Transfers fail on every call. Webhooks stop arriving. | 4 business hours | | Medium | Something is wrong but you can work around it. | One phone number fails, and you can route calls through another. | 6 business hours | | Low | A question, a request, or a minor issue. | How a feature works, a billing question, or a feature request. | 8 business hours | Response times are for our first reply, not for resolution. Business hours are 8 a.m. to 6 p.m. Pacific Time, Monday to Friday. Critical tickets are covered 24 hours a day, 7 days a week. Requests that depend on carriers or regulators, such as number porting or SMS registration, follow those parties' timelines. Bland reserves the right to reclassify a ticket's severity when it doesn't match the business impact, and to raise it when a situation becomes more urgent. * Critical and High apply to agents running in [production](/agents/environments). Issues in development or staging are Medium or Low. * For a Critical ticket, keep someone available to work with us until it's resolved. ## What to include A complete first message is the fastest way to a fix. Include: * One issue per ticket. Open a separate ticket for each unrelated problem. * What you expected to happen, and what happened instead. * When it started, with the date, time and time zone. * Two or three example call IDs for a call problem. * The agent, pathway or phone number involved. * For an API problem, the endpoint, the request ID or timestamp, and the full error response. * Steps to reproduce the problem. * What you've already tried. * How many calls or customers are affected. > [!WARNING] > > Never put API keys, passwords or other secrets in a ticket. Bland support will never ask for your password or API key. ## Track your tickets The Tickets tab lists every ticket you can see, with its title, severity, status, who opened it and when it was last updated. * Switch between Open and Closed. * Filter by severity, and sort by Last updated or Newest first. * Your filters stay in the page URL, so you can bookmark a view or share it with a colleague in your organization. Click a ticket to read the whole conversation, oldest first. Attachments appear as buttons you can click to download. ### How tickets are resolved A ticket is resolved when we've fixed the issue, given you a workaround, or answered your question. If a fix needs a product change, we'll tell you, and the ticket stays open while our engineering team works on it. We pass feature requests to our product team. Opening a ticket doesn't commit Bland to building or scheduling a request. ### Ticket status | Status | What it means | | - | - | | Open | The ticket is active. We're working on it, tracking a product fix, or waiting on information from you. | | Closed | The issue is resolved, or the ticket waited 7 days for your reply. | Only Bland support closes tickets. When a ticket is waiting on you, we send reminders, and we close it after 7 days without a reply. To pick a closed ticket back up, reply to it from the portal and it reopens. ## Reply to a ticket Our replies appear on the ticket and go by email to whoever opened it, at the email address on their Bland account. You can reply either way, and your answer lands on the same ticket: * In the portal, type in the box at the bottom of the ticket and click **Send reply**. * By email, reply to our message. Keep all follow-ups on the same ticket so the full history stays together. On a closed ticket, the button reads **Reply and reopen**. ## Escalate a ticket To escalate, reply on the ticket and say what changed, such as more customers affected, a new deadline, or a production outage. Bland support reviews every escalation and raises the severity when the impact calls for it. ## Limits | Item | Limit | | - | - | | Title | 200 characters | | Message | 10,000 characters | | Screenshots | 5 per ticket (PNG, JPG, GIF or WebP), 10 MB each | | New tickets | 20 per person per hour | | Replies | 60 per person per hour | ## FAQ > [accordion] Can I close a ticket myself? > > No. Bland support closes tickets once the issue is resolved. If your issue is resolved, reply on the ticket to let us know. > [accordion] Can I add a colleague to a ticket? > > The portal doesn't have CCs. Owners and admins already see every ticket in the organization, so give the admin role to anyone who needs to follow along. # Testbed Source: https://docs.bland.ai/agents/testbed Take one turn from a real conversation, change what the agent was told, and run it again to see whether the answer changes Testbed takes a single moment from a real conversation and runs it again. When your agent said something wrong, that answer came from one request: a set of messages, sent to a model, which produced a reply. Testbed pulls that exact request back up, lets you edit it, and re-runs it as many times as you like. > [!WARNING] > > Testbed does not replay the call. > > It re-runs **one turn**. The conversation after that point is not re-derived, so you are not seeing how the call would have gone. You are seeing what that one answer becomes when you change what led to it. ## Prerequisites * A conversation to work from, either a real one in [Conversations](/agents/conversations) or a manual test chat in the [agent builder](/agents/agent-builder#test-as-you-build) ## Open it Five ways in, and the labelled one is not the one you will use most. | From | What to press | | - | - | | A conversation | The test-tube icon in the toolbar | | A turn in the transcript | Hover the turn, then the icon that appears, then pick what to test | | An event row | Hover the row, then the chip that appears. This pins the exact request | | The Conversations list | The test-tube icon in the toolbar, which opens Testbed empty | | A manual test chat in the agent builder | The test-tube icon in the chat header for the whole conversation, or the icon beside a turn for that turn | > [!NOTE] > > Most of these are icons with no words next to them. Hovering names them, and the transcript one opens a short menu: **Dialogue**, **Route**, **Loop condition**, **Variable extraction**, which is choosing which decision from that turn you want to re-run. > > Opening Testbed from the list rather than from a conversation gives you an empty **Open Testbed** picker instead. > > In a test chat that continues an earlier session, the turns carried over from that session have no Testbed icon. Only turns from the current session can be opened. ## What you can change The middle pane holds the messages exactly as they were sent. Edit any of them: the instructions, the context, what the caller supposedly said. You also set how many times to run it. Running once tells you what happens; running several times tells you whether it happens reliably, which is usually the more useful answer. ## Read the result Identical answers are grouped together, and each group is badged with how many of your runs produced it, as **`count` / `total`**. Each group is also marked **Matches original** or **Different from original**, against the answer the real call produced. So the result is a stability reading rather than a pass or a fail. Five identical answers mean the agent is behaving consistently, whether or not it is behaving correctly. Five different answers mean the turn is a coin flip, which is worth knowing before you change anything. ## Push a change back **Push change** writes your edited version back to the agent. > [!WARNING] > > **Push change** is disabled whenever the agent has changed since the conversation you are looking at. > > That is often exactly your situation: something went wrong, you edited the agent, and now you are investigating the old call. In that case copy your change and make it in [Agent builder](/agents/agent-builder) instead. > > **Push change** is also disabled when you opened Testbed from a test chat in the agent builder. You can still edit and re-run the turn there. Make the change itself in the builder. ## Common failures > [accordion] I cannot find a button that says Open in Testbed > > On a conversation it is a test-tube icon with no label. That wording appears on other surfaces, not on the conversation itself. > [accordion] The re-run answer is different and I changed nothing > > That is a real result. The same request can produce different answers, which is why the run count exists. Run it several times to see how wide the spread is before you treat one answer as the agent's behavior. > [accordion] Push change is greyed out > > The agent has changed since that conversation, or you opened Testbed from a builder test chat. Testbed will not write an old turn over a newer agent, and it cannot push from a test chat. Make the change in the builder. > [accordion] I fixed the turn but the call still goes wrong later > > Testbed re-runs one turn and stops. Everything after it is unchanged, so a fix that works here still has to be tried against a whole conversation, in [Evaluations](/agents/evaluations). ## Next steps > [card] [Conversations](/agents/conversations) > > Find the call that went wrong. > [card] [Agent builder](/agents/agent-builder) > > Make the change for real. > [card] [Evaluations](/agents/evaluations) > > Check the fix across whole conversations, not one turn. > [card] [Environments](/agents/environments) > > Ship it once you believe it. Docs for agents: [llms.txt](/llms.txt) # Tools Source: https://docs.bland.ai/agents/tools Build the tools an agent calls during a conversation, and store the credentials they need A tool is something your agent can do mid-conversation that it could not do with words alone: check a calendar, look up an account, write a record back to your CRM. You build a tool, then tag it into every prompt that should call it. The examples here build tools for a front desk agent at Northwind Dental, a fictional practice. ## Prerequisites * An agent to tag tools into, from [Agent builder](/agents/agent-builder) * The API you want to call, and a key for it if it needs one ## Where tools live Tools appears at two scopes, and they are not the same view. The selector at the top of the sidebar decides which one you are on. It reads All agents for the whole organization, or the agent's name when you are inside one. Switching it leaves you on Tools. **At All agents**, under Resources, you get four tabs: | Tab | What it holds | | - | - | | **Tools** | Every tool in the organization. | | **Analytics** | How often each tool is called, and how often it fails. | | **Secrets** | Credentials your tools use, stored once and referenced by name. | | **Connections** | Accounts you have linked, like a CRM. | **Inside an agent**, under Build, you get only that agent's tools, and no tabs: the other three live at All agents. Which scope you create from decides which list the tool appears in. Create from inside an agent and the tool shows on that agent's Tools page. Create from All agents and it shows only there, on no agent's page, though any agent can still tag it in a prompt. On an agent's Tools page, the **Library** toggle beside the search lists tools from your other agents, each with a **+** that copies it onto this one. It appears once the organization has more than one agent. ## Three kinds of tool Which one you want depends on what is on the other end. ### Webhook Calls an HTTP endpoint you already have. You supply the request, and you describe what comes back. This is the common case. Start here unless you know you need one of the other two. > [!NOTE] > > Searching for custom APIs? That is a webhook tool. ### Custom code Runs code you write, for the cases a single HTTP call cannot cover: reshaping a response, calling two services and combining them, or a calculation the agent should not be doing in its head. This is not the custom code node you place inside a pathway. Same name, different thing: a tool is called from a prompt, a node is a step inside a pathway. ### Integration Talks to a service you have connected, like a CRM. Pick the connection and the action, and the fields come from the service rather than from you. You connect an account once with **Add connection**, under Connections, and then build as many tools on it as you need. One CRM connection can power a tool that creates a contact, another that looks one up, and a third that logs a call. The integration builder also offers **New connection** at the top of its connection list, which opens the same flow without leaving the tool. Bland's own actions need no connection. Ending a call, transferring one, pressing a button and sending an SMS are integration tools like any other, but they act on the call the agent is already in, so there is no account to connect. That is why **End Call** sits in your tool list carrying an icon of its own. ## Build a webhook tool From inside your agent, open Tools, then **Create tool**, and choose **Webhook**. If you already have a working `curl`, choose **Import from cURL** instead, in the same list. Paste the command and it opens the builder with the request filled in. **1. Name it** The name is what you type after `@` in a prompt, so make it the thing it does. `Check calendar` reads better in a prompt than `GET /availability`. **2. Describe when to use it** The description is not documentation. The agent reads it to decide whether this is the moment to call the tool. Write the trigger, not the mechanism: > Look up open appointment slots for a given day. Use this when the caller asks what times are available, before offering any specific time. A vague description is the most common cause of a tool firing at the wrong moment. **Agent speech**, directly below it, is what the agent says out loud while the tool runs. "One moment while I look that up" costs nothing and is the difference between a pause and dead air. **3. Point it at your endpoint** URL, method, headers, body. Anywhere a value should change per call, write a variable: `{{date}}`, `{{phone}}`. The tabs under the URL are **Query**, **Authorization**, **Headers** and **Body**. Query mirrors whatever is already in the URL, and Body is not there at all until you pick a method that has one. The method list offers five verbs. Webhook tools run **GET** and **POST**. Pick one of the other three and the tool tests fine and then refuses to save, with a message that says only `Failed to create tool`. The reason is the method. For an API key, do not type it here. Reference a [secret](#store-credentials-as-secrets), and create it before you reach the test step. **4. Say which variables the agent fills in** The variables you wrote into the request are collected under **Detected variables**, below the request tabs. Each one gets a row, and each row is a decision about where its value comes from. **Add input variable** means the agent fills it from the conversation. It moves into the **Variables** table, where you give it instructions, a type, and whether it is required. The instructions are what the agent reads, so write them for a person: "The day to check, as YYYY-MM-DD." The **Audio** column on that table pulls the value from what the caller said rather than from the transcript. It costs latency and it is worth it for the things transcription gets wrong: spoken numbers, dates, spellings. Leave a variable alone, or dismiss it with the **X**, and it resolves from [variables already on the call](/agents/agent-builder#extract-variables) instead. The agent never fills it. **5. Declare what comes back** **Output fields**, sometimes called request variables, name the parts of the response the agent can use. Each row is a name, a type, and a path into the response. Only the fields you check are available to the agent. Everything else is ignored. The table opens on three rows, `ok`, `message` and `data`. The `data` row has a chevron: expand it for the three below. | Path | What it holds | | - | - | | `$.ok` | Whether the call succeeded | | `$.message` | A short result message | | `$.data.rest_api_get_status` | The HTTP status | | `$.data.rest_api_get_status_text` | The status text | | `$.data.rest_api_get_data` | The response body from your endpoint | `ok` and `message` come pre-checked. The rest is yours to choose, and the rows below the table are yours to write: give one a name and a JSONPath and you can pull a single field straight out of the response body. The builder lists these `rest_api_get_*` paths whatever method you pick. A POST tool returns the same three fields named `rest_api_post_*`. So on a POST tool, take `ok` and `message` now. Save it, reopen, and check the `rest_api_post_*` rows then. Keep `ok` checked. A failed call returns `ok` and `message` and nothing else, so every path under `data` comes back empty. `ok` is the only signal that the call did not work. Each row shows its name wrapped as `{{output.name}}`. That is the table's label, not the reference. What you write in a prompt is the bare name, `{{name}}`. > [!WARNING] > > Checking at least one output field is what makes the tool wait for a response. > > Check nothing and the tool fires and moves on, which is right for logging and wrong for anything the agent needs an answer from. **6. Test it** Run the tool with sample values and check the response before you attach it to anything. Three settings sit below the output fields. **Timeout** is how long to wait before giving up, in milliseconds, from 1,000 to 60,000. **Cooldown** is the minimum gap between calls, in seconds, from 1 to 30, and a tool with the field left empty still gets 4 seconds. **Cache responses** is the third, and it does nothing on a tool. The switch saves, and nothing at call time reads it. Leave it alone and assume every call reaches your endpoint. ## Store credentials as secrets Do not paste an API key into a tool. Put it in Secrets and reference it. Secrets live at All agents, under Tools, on the Secrets tab. **Add Secret** creates one, and the value is never shown again after you save it. Creating a secret needs the owner, admin or operator role. Without one, **Add Secret** is visible but disabled. The same secrets under Settings, in Developer, sit behind a page only an owner or admin can open. There are two kinds, and each row on the tab is labelled with which it is. Static is a value you paste in, like an API key. It changes only when you change it. Refresh is a value Bland fetches on a schedule, so the agent never holds an expired token mid-call. You give it a URL, a method, headers or body, how often to refresh, and the path to the value in the response. The interval runs from 10 minutes to 24 hours. Three ways to reference one. The Authorization tab starts on No Auth, and the secret picker only appears once you choose **Bearer Token** or **API Key**. Choose a secret there and the builder stores a reference to it. **API Key** adds a **Header name** field, which falls back to `X-API-Key` if you leave it blank. The picker also has a **Create New Secret** link, which opens the same dialog without leaving the tool. It stays clickable without the role, and the server refuses the save. In a header, paste the reference. Every row on the Secrets tab shows its own reference beside the name, with a button that copies it. Copy it rather than typing it: the copied reference points at the secret by id, so a rename leaves every header working. In a body field, the copied reference does not work. Write `{{secret.NAME}}` instead, using the secret's name. Headers resolve both forms. Bodies resolve the name form only: an id reference reaches your endpoint as the literal text `{{secret.id.…}}`. Nothing flags it, and the builder's test passes, because the test takes a different path from a real call. The name form is the one a rename breaks, so a secret referenced from a body is worth renaming carefully. Secrets are organization-wide. Store one and every agent can use it. Rotate the value and every tool that references it follows. ## Tag a tool into a prompt Building a tool does not give it to an agent. Tag it. In the agent's **Prompt**, type `@` and pick the tool by name. The Tool references section below the prompt then lists it. Tools attach per prompt, not per agent. A tool tagged in the agent's prompt is available while the conversation is on the agent, and it does not follow the agent into a [pathway](/agents/agent-builder#extend-the-agent-with-pathways), a branch of the agent's behavior with instructions of its own. If booking lives in its own pathway, tag the calendar tool there too. > [!WARNING] > > Tagging gives the agent its own copy of the tool. > > To change a tool an agent already uses, open it from that agent's Tool references row. That saves both. > > Editing the same tool from the Tools page changes only the original. The agent keeps running its copy, and opening the tool from the agent afterwards shows you the original, so the change looks like it applied when it has not. The check is Tool references itself. Only tagged tools appear there, so the list is the attachment. A tool you built that is missing from it is tagged in no prompt and will never be called. Knowledge references, directly below it, is not that kind of list. A source can be attached without being tagged, so what it shows is not the whole set. See [Knowledge](/agents/knowledge#attach-a-source-to-an-agent). ## Watch how tools perform Analytics shows call volume and failure rate per tool. The number worth watching is the failure rate. A tool that fails quietly leaves the agent improvising in the middle of a call, and the caller hears an agent that has lost the thread rather than an error. ## Common failures > [accordion] The agent never calls the tool > > Look at Tool references under the prompt. If the tool is not listed, it is not tagged, and it will never be called. Tag it in the prompt where it should run. > [accordion] It works on the agent but not inside a pathway > > Tools do not follow the agent into pathways. Tag it again inside that pathway. > [accordion] You edited a tool and the agent still uses the old version > > Tagging attached a copy. An edit made on the Tools page changes the library only, and nothing on the agent pulls it in. Open the tool from Tool references and make the same change there. That saves the agent's copy and the library together. Keep editing it there from then on: an edit made from the agent writes its copy over the library row. > [accordion] The tool fires at the wrong moment > > The agent chooses from the description. Rewrite it to say when to use the tool and when not to, rather than what the endpoint does. > [accordion] The agent calls it but ignores the answer > > Check **Output fields**. Only the fields you checked are available to the agent, so a path you left unticked is not there to be read. Check the paths too: a path that does not match the response resolves to nothing, and the agent gets an empty value rather than an error. > [accordion] The endpoint returns 401 or 403 > > The tool is reaching your API and your API is refusing it. If the credential is in a body, check whether the secret has been renamed, because a body reference names the secret and a rename breaks it. If it is in a header, check the secret still exists at all. On a **Refresh** secret, check that the interval is shorter than the token's lifetime. > [accordion] The call times out > > Raise **Timeout**, or make the endpoint faster. Then fill in **Agent speech**, because a caller with nothing to listen to hears dead air rather than a wait. ## Next steps > [card] [Agent builder](/agents/agent-builder) > > Tag tools into a prompt, and the rest of building an agent. > [card] [Knowledge](/agents/knowledge) > > Answer from documents rather than by calling an API. Docs for agents: [llms.txt](/llms.txt) # Triggers Source: https://docs.bland.ai/agents/triggers Start conversations automatically from an event: pick what fires it, filter on the payload, and choose what happens A trigger watches for something to happen and acts on it. A support case is created and an agent calls the customer. A call ends and a webhook posts the outcome to your system. An inbound SMS arrives and a Slack channel hears about it. Three parts, always: the event that starts it, the conditions that narrow it, and the action. > [!NOTE] > > Searching for automations? That is this page. Automations are Triggers now, and the word is still in the URL inside an agent. ## Prerequisites * An agent, from [Agent builder](/agents/agent-builder), if the trigger will place a call * A connected Salesforce or HubSpot account, if the trigger starts from a CRM event * A connected Slack workspace, if the trigger posts a Slack message ## Where triggers live Triggers is under Dispatch, in both sidebars. At All agents it lists every trigger in the organization; inside an agent it lists that agent's. Nothing here is gated by plan, role or permission. ## The list A grid of cards rather than a table. Each card carries the trigger's name, its event, its action and its status. Clicking a card opens that trigger's run history, not its settings. To change it, use the **Trigger actions** menu in the card's corner and pick **Edit**. The same menu pauses and activates it without opening anything, and **Edit trigger** in the top bar of Runs gets you there too. Search runs on the server and covers everything you have. Sort does not. It orders the page you are looking at, so past 50 triggers **Most runs** and **Name A-Z** are sorting a slice. ## Build one **New trigger** opens a two-pane screen. The canvas on the left, the panel on the right. > [!NOTE] > > The canvas is a picture, not an editor. Three cards, stacked and joined by two lines: Trigger, Conditions, Action. The panel's step tabs carry the same three names. > > There is nothing to drag, connect or add. Clicking a card opens that step in the panel, which is where all the work happens. The panel's header carries those three steps and a **Test** button. They unlock in order: Conditions and Action stay disabled until the event is chosen. Each card also reports its own state. The Trigger card names its connection, the Conditions card counts what you have set, and the Action card shows where it is pointed, or **Not configured** until it has somewhere to go. That last one is a destination check, not a completeness check: a call with a number but no agent still shows the number. The **Ready** and **Setup required** badges are the completeness signal, and a step counts as visited only once you have left it, so the card you are working in is the last to flag. **1. Pick the event** Search, or filter by integration. Bland's own events sort to the top. | Event | Fires when | | - | - | | **Post-call webhook** | A call finishes and its summary is ready | | **Call started**, **Inbound call received** | A call begins, outbound or in | | **Voicemail detected** | A call reaches voicemail instead of a person | | **Warm transfer started**, **Cold transfer started** | A call is handed to a human, announced or not | | **Pathway node reached** | A conversation arrives at a node you name | | **SMS received**, **Post-SMS webhook** | A message arrives, or a thread closes | | **Batch completed** | A batch finishes dialing | | **Eval completed** | An evaluation run finishes | | **Knowledge gap detected** | An agent is asked something its knowledge did not cover | | **Tool success**, **Tool failure** | A tool call returns, or does not | Salesforce adds created and updated for cases, leads and opportunities. HubSpot adds the same pair for companies, contacts, deals, meetings, tasks and tickets. Picking an event clears any conditions and action settings you had already set, because the fields available depend on the event. Your agent choice survives. A non-Bland event then asks which connection to use. If you have none, **Connect** opens a panel whose one action takes you to Tools in a new tab, which is where connections are actually made. Create it there, come back, and reopen the step. **2. Narrow it with conditions** **Trigger must meet** is set to **All conditions** and can be **Any condition**. **Add condition** gives you a row with three controls: **Field**, **Condition**, and **Value**, which disappears for operators that do not take one. A new row starts with no field selected on purpose, so nothing meaningless is filtering for you. The field list comes from the event, and you can type a path that is not in it. Every CRM **updated** event needs at least one condition using a change operator, because otherwise it fires on every sync of every record. **Save** will not go through without one. On a call action, **Timing** is in this step too: **Immediately**, **Business hours**, or **Custom** days and hours with a timezone. A Bland event only offers Immediately. **3. Choose the action** Five kinds: Call, SMS, **Webhook**, **Slack message**, and **Custom code**. The list shows only the ones your event supports, and if you change the event to one that does not support the action you had picked, it quietly reselects one that fits. Every CRM event offers Call and SMS and nothing else, because the record it carries is a person to reach. Bland's own events vary. Seven of the fourteen drop at least one action: | Event | What it cannot do | | - | - | | **Warm transfer started**, **Cold transfer started**, **Eval completed** | Call | | **Batch completed**, **Knowledge gap detected** | Call, SMS | | **Tool success**, **Tool failure** | Call, SMS, Custom code | On a Call, the agent picker sits above the action type, because it is the first thing to decide. Below it, **Send from** picks the number the call goes out on, from the numbers in [Dispatch](/agents/dispatch), and **Send to** is the number it dials. Picking the agent fills **Send from** in with that agent's own number, if you have not picked one yourself. If you own no numbers at all the field is replaced by a note saying calls go out from a shared Bland number, which is not an error. A **Slack message** picks its own workspace and channel, no matter which event started it. **4. Point the action at the event** Still in Action. This is the part that makes a trigger worth building: a field can read its value off the event instead of holding something you typed. On a Call and on an SMS, **Send to** and each **Request data** row carry a **Static** / **Event** switch. **Static** is a value you type, the same on every run. **Event** reads it off the payload that fired the trigger. So **Send to** can be the phone number on the case rather than one number you typed once. **Request data** is a set of key and value pairs handed to the agent as context. The agent sees both the keys and the values, so name them the way you would say them. A **Webhook**'s URL carries the same switch with a third option, **Org Default**, which uses the webhook URL from your organization settings. Its headers carry the plain two. The other two actions reach the event a different way. An SMS or **Slack** message body has no switch: use **Insert field** above the box, which writes a `{{field.path}}` reference into the text. **Custom code** gets the whole payload as `input`. **5. Save it** **Save** lands the trigger **Paused**. That is the intended order: you cannot test a trigger that has never been saved. > [!WARNING] > > If a required field is missing, **Save** does nothing: no message, no error, and the button stays enabled. > > What you get instead is the field label turning red, in whichever step you happen to be looking at. So walk Trigger, Conditions and Action in turn and look for it in each. ## Agent attribution A Call action needs an agent. The field is marked required and **Save** will not go through without it. No other action has an agent field. A **Webhook** needs a URL, an SMS needs a number and a message, and neither asks who is responsible for it. Only a Call trigger is ever filed under an agent. A webhook, SMS, Slack or custom code trigger lives at All agents and nowhere else, even when you build it from inside an agent. Inside an agent, the picker is a locked card rather than a list: the trigger runs on the agent you are editing. If it currently points somewhere else, or nowhere, a warning appears with a **Use this agent** button that repoints it. Requiring an agent is a dashboard rule. The API is looser, so a trigger built elsewhere may not follow it. > [!NOTE] > > Deleting an agent does not delete the triggers pointed at it. They stay in the list, still trying to run, and the agent picker shows **Unknown agent**. > > If you retire an agent, go through Triggers and repoint or pause anything attributed to it. ## Test it **Test** hands the whole right panel over to the test flow. The steps stay along the top and are how you get back out. > [!WARNING] > > **Conditions only** is on by default. > > With it on, pressing **Fire Test Trigger** evaluates your conditions and stops. Nothing is called, sent or posted, and the message you get back says **Conditions evaluated** rather than that the trigger fired. > > Turn it off to exercise the action for real. A call action then places a real call to the number in **Send to**, billed like any other, so point it at yourself the first time. > > **Conditions only** is forced on, and says so, for a trigger that does not fire immediately. A test runs the configuration on your screen, including edits you have not saved. So it is a real answer about what you are looking at, and not necessarily about what is live. For a CRM trigger you can paste a real record ID and Bland fetches it, or switch to **Manual** and type the fields yourself. **Fire Test Trigger** stays disabled until the record comes back, so an ID that does not resolve reads as a dead button. A Bland event has no record to fetch. It gives you an editable payload instead, and **Fire Test Trigger** waits until that payload is valid JSON. If your conditions use a change operator, the panel adds **Simulate field changes**, on by default, with a previous value for each field. Without it there is no change for the condition to see. ## Turn it on The status control at the top switches between Active and **Paused**. > [!WARNING] > > On a trigger that already exists, status and the trigger's name save themselves the moment you change them. Everything else on the screen waits for **Save**. > > So flipping to Active and then navigating away leaves it Active. Setting it Active and then pressing **Save** asks you to confirm, and names what it is about to start firing. > > While you are building a new trigger neither applies. The status control is greyed out until the trigger exists, and the name rides the first **Save** with everything else. ## Watch it run Runs in the top bar opens the history for that trigger: when it fired, what happened, and why it stopped if it did. Failures are not the same on every action. A failed webhook is recorded and never retried. A failed call is retried when the failure looks temporary, up to five attempts in all. The calls themselves land in [Conversations](/agents/conversations) like any others. ## Common failures > [accordion] Save does nothing > > A required field is empty. Walk Trigger, Conditions and Action, looking for the red label in each: visiting them is also what makes the canvas badges appear, so the second pass tells you more than the first. A call action needs both an agent and a **Send to** number. > [accordion] Test is greyed out > > You have not saved yet. Save first, which leaves the trigger Paused, and test from there. > [accordion] The test passed and nothing happened > > **Conditions only** was on, which is its default. It evaluates the conditions and stops before the action. Turn it off and fire again. > [accordion] The card does not show the conditions you set > > The count on the list card does not fill in for a trigger built here. It is not telling you the conditions are missing, and the conditions themselves work. Clicking the card goes to Runs, so open it from **Trigger actions** then **Edit**, or press **Edit trigger** once you are in Runs. > [accordion] The trigger is not in the agent's list > > If it places calls, save it a second time, from the page the first save lands on. The first save writes the trigger and its call settings. The agent it is filed under is written by the update that follows. > > If it does anything else, it is not missing. Only call triggers are filed under an agent, so a webhook, SMS, Slack or custom code trigger lives at All agents only. > [accordion] Changing the event emptied everything > > Expected. Conditions and action settings are specific to an event, so changing it clears them. Pick the event first and build outward. > [accordion] A trigger runs twice for one thing > > Bland events are not de-duplicated. Two events for the same call produce two runs and two calls. > > A CRM sync is protected against retrying itself, which is not the same thing: one record seen by two separate syncs still fires twice. Narrow the conditions rather than relying on the sync to be quiet. > [accordion] A saved trigger fails with only 'Please try again' > > The server's real message does not reach the screen, so the page cannot tell you which of its rules you broke. > > The missing-condition rules are not among the causes: **Save** blocks on those before anything is sent. Check the connection the trigger runs on, then the action's own destination, which are the parts the screen does not validate for you. ## Next steps > [card] [Dispatch](/agents/dispatch) > > Phone numbers, channels, and batches. > [card] [Conversations](/agents/conversations) > > Read the calls your triggers placed. > [card] [Tools](/agents/tools) > > Call an API from inside a conversation rather than from an event. > [card] [Agent builder](/agents/agent-builder) > > Build the agent a call trigger will hand its calls to. Docs for agents: [llms.txt](/llms.txt) # Delete Test Scenario Source: https://docs.bland.ai/api-v1/delete/agent-testing-scenarios-id DELETE https://api.bland.ai/v1/agent-testing/scenarios/{id} Delete a test scenario and all related data. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The scenario ID. ### Response **deleted** `boolean` Whether the scenario was successfully deleted. ```json Response theme={null} { "deleted": true } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Alarm Source: https://docs.bland.ai/api-v1/delete/alarms-id DELETE https://api.bland.ai/v1/alarms/{id} Delete an alarm configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Response Returns a `204 No Content` response on success. ```json Error theme={null} { "data": null, "errors": [ { "error": "ALARM_NOT_FOUND", "message": "Alarm configuration not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Block Rule Source: https://docs.bland.ai/api-v1/delete/blocked-numbers-id DELETE https://api.bland.ai/v1/blocked_numbers/{block_id} Permanently delete a block rule. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **block\_id** `number` *required* The unique ID of the block rule to delete. ### Response **data** `object` Confirmation message and ID of the deleted rule. **data.message** `string` Success message indicating the block rule was deleted. **data.deleted\_block\_id** `number` The ID of the block rule that was removed. **errors** `null|array` `null` on success, or a list of error objects if the rule was not found or deletion failed. ```json Response theme={null} { "data": { "message": "Block rule deleted successfully", "deleted_block_id": 123 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Outcome Source: https://docs.bland.ai/api-v1/delete/dispositions-id DELETE https://api.bland.ai/v1/dispositions/{id} Delete an outcome. A deleted outcome stops running and no longer appears in [List Outcomes](/api-v1/get/dispositions). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. ### Response **data.deleted** `boolean` `true` when the outcome was deleted. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "deleted": true }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Eval Agent Source: https://docs.bland.ai/api-v1/delete/evals-agents-id DELETE https://api.bland.ai/v1/evals/agents/{eval_agent_id} Soft-delete an eval agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent to delete. Returns `204 No Content` on success. # Delete User Template Source: https://docs.bland.ai/api-v1/delete/evals-user-templates-id DELETE https://api.bland.ai/v1/evals/user-templates/{id} Soft-delete a saved eval agent template. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The UUID of the user template to delete. Returns `204 No Content` on success. *** Docs for agents: [llms.txt](/llms.txt) # Delete Workbench Setup Source: https://docs.bland.ai/api-v1/delete/evals-workbench-setups-id DELETE https://api.bland.ai/v1/evals/workbench-setups/{setup_id} Soft-delete a workbench setup. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup to delete. Returns `204 No Content` on success. # Delete Guard Rail Source: https://docs.bland.ai/api-v1/delete/guard-rails-id DELETE https://api.bland.ai/v1/guard_rails/{guard_rail_id} Delete a guard rail. > [!WARNING] > > Deleting a guard rail will remove it from all attached sources (personas, pathways, inbound numbers). Calls using those sources will no longer be monitored by this guard rail. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **guard\_rail\_id** `string` *required* The unique identifier of the guard rail to delete. ### Response Returns a `204 No Content` response on success. ```json Error Response (Not Found) theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Guard rail not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete API Key Source: https://docs.bland.ai/api-v1/delete/keys-delete DELETE https://api.bland.ai/keys/delete Revoke an API key. > [!WARNING] > > Deleting a key revokes it immediately. Any request still using it will fail. ### Headers **authorization** `string` *required* Your API key for authentication. Restricted keys cannot delete keys. ### Body **key** `string` *required* The first 14 characters of the key, as returned by [List API Keys](/api-v1/post/keys-list). Works for full-access and restricted keys. ### Response **data** `null` `null` on success. **errors** `null | array` `null` on success, or a list of errors. ### Last full-access key While your organization has [restricted keys](/api-v1/post/keys-create#restricted-keys), it must keep at least one full-access key, because live calls and dashboard sessions depend on it. Deleting the last full-access key returns `409` with the error `LAST_FULL_ACCESS_KEY`. Delete the restricted keys first, or create another full-access key. ```json Response theme={null} { "data": null, "errors": null } ``` ```json Last Full-Access Key theme={null} { "data": null, "errors": [ { "error": "LAST_FULL_ACCESS_KEY", "message": "string" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Knowledge Base Item Source: https://docs.bland.ai/api-v1/delete/knowledge-id DELETE https://api.bland.ai/v1/knowledge/{knowledge_base_id} Soft deletes a knowledge base item by setting its status to 'DELETED'. Marks a knowledge base item as deleted by setting its status to `"DELETED"`. This is a soft delete operation - the knowledge base item data is retained but becomes inaccessible for normal operations. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **knowledge\_base\_id** `string` *required* The unique identifier of the knowledge base item to delete. ### Response **data** `object` Deletion confirmation object. **data.success** `boolean` Always `true` when the deletion is successful. **data.message** `string` Confirmation message about the deletion. **data.knowledge\_base\_id** `string` The ID of the deleted knowledge base item. **errors** `null` Will be `null` on successful deletion. ```bash cURL theme={null} curl -X DELETE https://api.bland.ai/v1/knowledge/kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T \ -H "authorization: Bearer YOUR_API_KEY" ``` ```json Success Response theme={null} { "data": { "success": true, "message": "Knowledge base successfully deleted", "knowledge_base_id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T" }, "errors": null } ``` ```json Not Found Response theme={null} { "data": null, "errors": [ { "error": "KB_ERROR", "message": "KB not found or access denied" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Leave Organization Source: https://docs.bland.ai/api-v1/delete/org_leave_self_memberships_id DELETE https://api.bland.ai/v1/orgs/self/leave Remove the authenticated user from an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **org\_id** `string` *required* The unique identifier of the organization the user wants to leave. ### Response **data** `null` Always `null` upon successful removal. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Organization Source: https://docs.bland.ai/api-v1/delete/orgs DELETE https://api.bland.ai/v1/orgs/{org_id} Delete an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization you want to delete. ### Body **delete\_confirm** `string` *required* The slug of the organization to confirm deletion. ### Response **data** `null` Always `null` upon successful deletion. **errors** `null | array` `null` if successful; contains error details if the request fails. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Folder Source: https://docs.bland.ai/api-v1/delete/pathway_folder DELETE https://us.api.bland.ai/v1/pathway/folders/{folder_id} Deletes a specific folder for the authenticated user. The folder must be empty to be deleted. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **folder\_id** `string` *required* The ID of the folder to delete. ### Response **folder\_id** `string` The ID of the deleted folder. ```json Response theme={null} { "folder_id": "deleted_folder_123" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Pathway Version Source: https://docs.bland.ai/api-v1/delete/pathway_version DELETE https://api.bland.ai/v1/pathway/{pathway_id}/version/{version_id} Marks a specific version of a pathway as archived, effectively deleting it from active use. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The ID of the pathway containing the version to be deleted. **version\_id** `string` *required* The ID of the version to be deleted. ### Response **status** `string` The status of the operation (e.g., "success"). **message** `string` A message describing the result of the operation. ```json Response theme={null} { "status": "success", "message": "Version deleted successfully" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Persona Source: https://docs.bland.ai/api-v1/delete/personas-id DELETE https://api.bland.ai/v1/personas/{persona_id} Delete a persona. > [!WARNING] > > Deleting a persona will remove all versions and configuration data permanently. Any phone numbers currently using this persona will need to be reconfigured with a different persona or direct configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona to delete. ### Query Parameters **force** `boolean` (default: false) Force deletion even if persona is currently in use by phone numbers. When false, deletion will fail if persona is actively being used. ### Response **data** `object` The deletion result object. **deletion result** **success** `boolean` Whether the deletion was successful. **message** `string` Confirmation message about the deletion. **errors** `string` Any errors that occurred (null if none). ```json Success Response theme={null} { "data": { "success": true, "message": "Persona deleted successfully" }, "errors": null } ``` ```json Error Response (Persona in Use) theme={null} { "data": null, "errors": [ { "error": "PERSONA_IN_USE", "message": "Cannot delete persona that is currently in use by phone numbers", "details": { "persona_id": "12345678-1234-1234-1234-123456789012", "phone_numbers_using": [ "+15551234567", "+15551234568" ], "suggestion": "Remove persona from all phone numbers first, or use force=true parameter" } } ] } ``` ```json Error Response (Not Found) theme={null} { "data": null, "errors": [ { "error": "PERSONA_NOT_FOUND", "message": "Persona not found", "details": { "persona_id": "12345678-1234-1234-1234-123456789012" } } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Cancel Port Request Source: https://docs.bland.ai/api-v1/delete/sip-port-cancel DELETE https://api.bland.ai/v1/sip/port/{id} Cancel an in-progress number porting request. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The port request ID to cancel. ### Response **canceled** `boolean` `true` if the port request was successfully canceled. Port requests can only be canceled before they reach the `completed` status. Once a port is completed, the numbers have already been transferred. ```json Example Request theme={null} curl -X DELETE https://api.bland.ai/v1/sip/port/port_xyz789 \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "canceled": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Conversation Source: https://docs.bland.ai/api-v1/delete/sms-conversations DELETE https://api.bland.ai/v1/sms/conversations/{id} Delete a specific conversation and all of its associated messages. This action is permanent. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The ID of the conversation to delete. ### Response **data** `object` Confirmation message indicating the conversation and messages were deleted. **data.message** `string` A human-readable success message. **errors** `null|array` `null` on success, or a list of error objects on failure. ```json Response theme={null} { "data": { "message": "Conversation and all associated messages deleted successfully" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Messages from Conversation Source: https://docs.bland.ai/api-v1/delete/sms-conversations-message DELETE https://api.bland.ai/v1/sms/conversations/{id}/messages Delete SMS conversations by their IDs. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The ID of the conversation deleted. ### Body Parameters **message\_ids** `string[]` *required* A list of message ID integers to mark as deleted. Must not be empty. ### Response **data** `object` Object containing confirmation and the count of messages deleted. **data.message** `string` A success message indicating how many messages were marked as deleted. **data.deleted\_count** `number` The number of messages successfully marked as deleted. **errors** `null|array` `null` on success, or a list of error objects on failure. ```json Response theme={null} { "data": { "message": "2 messages marked as deleted", "deleted_count": 2 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Custom Tool Source: https://docs.bland.ai/api-v1/delete/tools-tool-id DELETE https://api.bland.ai/v1/tools/{tool_id} Delete your Custom Tool. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **tool\_id** `string` *required* The ID of the Custom Tool you want to update. ### Response **status** `string` Whether the tool creation succeeded. ```json theme={null} { "status": "success", "message": "Tool has been deleted." } ``` *** Docs for agents: [llms.txt](/llms.txt) # End Translation Session Source: https://docs.bland.ai/api-v1/delete/translation-sessions-id DELETE https://api.bland.ai/v1/translation/sessions/{session_id} Terminate a translation session from the server side Ends a translation session. If the WebSocket is connected, it receives a final `session_ended` control message and is closed. Pending sessions (created but never connected) are also cleaned up — useful for releasing a concurrency slot you no longer need. Terminating an already-ended session is a no-op and returns the session's final state. ## Authentication **authorization** `string` *required* Your API key for authentication ## Path Parameters **session\_id** `string` *required* The session UUID returned by `POST /v1/translation/sessions` ## Body Parameters **reason** `string` Optional context (max 200 characters) recorded with the session's `end_reason` as `api_terminated:`. ## Response Returns the same session object as [Get Translation Session](/api-v1/get/translation-sessions-id), with `status` and `end_reason` reflecting the termination. ```bash cURL theme={null} curl -X DELETE "https://api.bland.ai/v1/translation/sessions/9592342c-0ed2-4c5e-8ceb-16aa55c804a7" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```python Python theme={null} import requests response = requests.delete( "https://api.bland.ai/v1/translation/sessions/9592342c-0ed2-4c5e-8ceb-16aa55c804a7", headers={"Authorization": "Bearer YOUR_API_KEY"}, ) print(response.json()["data"]["end_reason"]) # "api_terminated" ``` ```json Terminated theme={null} { "data": { "session_id": "9592342c-0ed2-4c5e-8ceb-16aa55c804a7", "status": "ENDED", "source_language": "en", "target_language": "es", "voice_id": null, "audio_protocol": "pcm16", "sample_rate": 16000, "max_duration_seconds": 1800, "end_reason": "api_terminated", "session_seconds": null, "billable_minutes": null, "created_at": "2026-06-04T18:05:07.885Z", "started_at": null, "ended_at": "2026-06-04T18:06:08.684Z" }, "errors": null } ``` # Delete Issue Source: https://docs.bland.ai/api-v1/delete/triage-issues-id DELETE https://api.bland.ai/v1/triage/issues/{id} Permanently delete a triage issue. ## Overview Deletes an issue and everything attached: resources, flags, relations, alert bindings, comments, Norm sessions. The underlying calls, SMS conversations, and files are not affected. To take an issue off the board without losing it, [update](/api-v1/patch/triage-issues-id) `status` to `closed` instead. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue to delete. *** ## Response Returns `204 No Content` on success with an empty body. Subsequent calls to [Get Issue](/api-v1/get/triage-issues-id) for the same ID return 404. ```http No Content theme={null} HTTP/1.1 204 No Content ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Issue not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Detach Call Source: https://docs.bland.ai/api-v1/delete/triage-issues-id-calls-call-id DELETE https://api.bland.ai/v1/triage/issues/{id}/calls/{call_id} Detach a call from an issue. ## Overview Convenience over [Remove Resource](/api-v1/delete/triage-issues-id-resources-resource-link-id) for when you have the `call_id` rather than the resource link ID. The underlying call is unaffected. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **call\_id** `string` *required* The `call_id` of the call to detach. *** ## Response Returns `204 No Content` on success with an empty body. Returns 404 if the issue does not exist or if the call is not currently attached to this issue. ```http No Content theme={null} HTTP/1.1 204 No Content ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Resource not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Remove Flag Source: https://docs.bland.ai/api-v1/delete/triage-issues-id-flags-flag-id DELETE https://api.bland.ai/v1/triage/issues/{id}/flags/{flag_id} Remove a flag from an issue. ## Overview Deletes a flag. The underlying call is unaffected. The flag's `type` stays in the [Flag Types](/api-v1/get/triage-flag-types) catalog if other flags of the same type still exist. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **flag\_id** `string` *required* Internal UUID of the flag to remove. *** ## Response Returns `204 No Content` on success. Returns 404 if the issue does not exist or the flag does not belong to this issue. ```http No Content theme={null} HTTP/1.1 204 No Content ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Flag not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Remove Relation Source: https://docs.bland.ai/api-v1/delete/triage-issues-id-relations-relation-id DELETE https://api.bland.ai/v1/triage/issues/{id}/relations/{relation_id} Remove a relation. ## Overview Removes a relation between two issues. Can be called from either side. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **relation\_id** `string` *required* Internal UUID of the relation. *** ## Response Returns `204 No Content` on success. Returns 404 if the issue does not exist or the relation does not belong to this issue. ```http No Content theme={null} HTTP/1.1 204 No Content ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Relation not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Remove Resource Source: https://docs.bland.ai/api-v1/delete/triage-issues-id-resources-resource-link-id DELETE https://api.bland.ai/v1/triage/issues/{id}/resources/{resource_link_id} Detach a resource from an issue. ## Overview Detaches a resource link from an issue. The underlying call, SMS conversation, or file is unaffected. Pass the resource link `id`, not the underlying `resource_id`. To detach a call by `call_id` instead, use [Detach Call](/api-v1/delete/triage-issues-id-calls-call-id). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **resource\_link\_id** `string` *required* Internal UUID of the resource link (the `id` field on a resource link object). *** ## Response Returns `204 No Content` on success with an empty body. Returns 404 with `{ error: "not_found" }` if the issue does not exist or the resource link does not belong to this issue. ```http No Content theme={null} HTTP/1.1 204 No Content ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Resource not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Knowledge Base Item Source: https://docs.bland.ai/api-v1/delete/vectors-id DELETE https://api.bland.ai/v1/knowledgebases/{vector_id} Remove a knowledge base item from your account. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **vector\_id** `string` *required* The `vector_id` of the knowledge base item to delete. ```json theme={null} { "message": "Knowledge base deleted" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Voice Source: https://docs.bland.ai/api-v1/delete/voices-id DELETE https://api.bland.ai/v1/voices/{id} Permanently delete a voice you own. ## Overview Soft-deletes a voice from your library. The voice's `deleted_at` column is stamped and it stops appearing in [List Voices](/api-v1/get/voices) and synthesis flows. Only voices owned by your org can be deleted; curated default voices, voices in the public library you have not added, and voices owned by other orgs return `400 ERROR_DELETING_VOICE`. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice to delete. *** ## Response **data** `object` Confirmation that the voice was deleted. **Fields** **status** `string` `success` on success. **message** `string` Human-readable confirmation, for example `"Voice deleted successfully"`. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "status": "success", "message": "Voice deleted successfully" }, "errors": null } ``` ```json Error Deleting Voice theme={null} { "data": null, "errors": [ { "error": "ERROR_DELETING_VOICE", "message": "Error deleting voice" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Voice Samples Source: https://docs.bland.ai/api-v1/delete/voices-id-samples DELETE https://api.bland.ai/v1/voices/{id}/samples Remove one or more training samples from a voice clone you own. ## Overview Removes the specified samples from a voice clone. The voice is retrained against the remaining samples. If you remove every sample from a voice it becomes unusable for synthesis; delete the voice itself via [Delete Voice](/api-v1/delete/voices-id) if that is your intent. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the parent voice. *** ## Body Parameters **sample\_ids** `string[]` *required* Array of sample UUIDs to delete. ```json theme={null} { "sample_ids": ["d15b199a-1b79-4664-9a9a-b149ee3b136a"] } ``` *** ## Response **status** `string` `success` on success. **samples** `array` The samples remaining on the voice after the deletion. ```json Response theme={null} { "status": "success", "samples": [] } ``` ```json Invalid Request theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Missing or invalid sample_ids array" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Custom Component Source: https://docs.bland.ai/api-v1/delete/widget-custom-components-id DELETE https://api.bland.ai/v1/widget/custom_components/{id} Deletes a specific custom component by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* UUID of the custom component to update. ### Response **status** `number` HTTP status code (204 for success). *** Docs for agents: [llms.txt](/llms.txt) # List Active Calls Source: https://docs.bland.ai/api-v1/get/active GET https://api.bland.ai/v1/calls/active Retrieve all currently active calls for your organization. Active calls include both queued and in-progress calls that have not yet completed. ### Headers **authorization** `string` *required* Your API key for authentication. **x-bland-org-id** `string` *required* The unique organization ID. ### Response **data** `array` An array of active call objects. Each object represents one ongoing or queued call. **data\[].call\_id** `string` Unique identifier for the call. **data\[].user\_id** `string` The organization/user ID that initiated the call. **data\[].from** `string` The originating phone number. **data\[].to** `string` The destination phone number. **data\[].objective** `string` The agent prompt or objective that was used to initiate the call. **data\[].pathway\_id** `string` The pathway ID associated with the call, if any. **data\[].start\_time** `string` The call start time (ISO 8601 string). May be empty if the call has not started. **data\[].international** `string` `"true"` if the call is international, `"false"` otherwise. **data\[].inbound** `boolean` `true` if the call is inbound to one of your numbers, `false` if it is outbound. **data\[].agent\_id** `string | null` The ID of the agent handling the call. `null` if the call is not linked to an agent. **data\[].started\_at** `string | null` When the call started (ISO 8601, UTC). `null` if the call has not started yet. **data\[].status** `string` Current call status (e.g., `QUEUED`, `IN_PROGRESS`). **data\[].timestamp** `string` Unix epoch (milliseconds) when the call record was created. **errors** `null` Always `null` on success. ```json theme={null} { "data": [ { "call_id": "8dd6f762-6c67-4546-aaad-3e59f5e4a09c", "user_id": "bdffa9e8-436c-416d-b95f-a77b19ae4411", "from": "+18475586665", "to": "+13105100966", "objective": "You are a 2...", "pathway_id": "", "start_time": "", "international": "false", "status": "QUEUED", "timestamp": "1758656817432", "inbound": false, "agent_id": null, "started_at": null }, { "call_id": "dadbc09a-9b0b-4eb5-b67f-0c7f1206c623", "user_id": "bdffa9e8-436c-416d-b95f-a77b19ae4411", "from": "+18154728283", "to": "+16106876633", "objective": "You are a 2...", "pathway_id": "", "start_time": "", "international": "false", "status": "IN_PROGRESS", "timestamp": "1758656900740", "inbound": true, "agent_id": "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "started_at": "2025-09-23T19:48:21.512Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Analytics Source: https://docs.bland.ai/api-v1/get/agent-testing-analytics GET https://api.bland.ai/v1/agent-testing/analytics/{pathwayId} Get basic testing analytics for a pathway over a time window. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathwayId** `string` *required* The pathway ID. ### Query Parameters **days** `integer` (default: 30) Number of days to look back. Maximum value is 365. ### Response **total\_runs** `integer` Total number of test runs in the time window. **passed** `integer` Number of test runs that passed. **failed** `integer` Number of test runs that failed. **pass\_rate** `number` Pass rate as a decimal from 0 to 1. **avg\_score** `number` Average score across all runs, from 0 to 1. **runs** `array` Individual run summaries for the time window. ```json Response theme={null} { "total_runs": 48, "passed": 39, "failed": 9, "pass_rate": 0.8125, "avg_score": 0.84, "runs": [ { "id": "run_a1b2c3d4-5678-9abc-def0-1234567890ab", "scenario_id": "scn_f0e1d2c3-b4a5-9687-7856-342109876543", "scenario_name": "Happy Path - Appointment Booking", "status": "passed", "score": 0.95, "created_at": "2026-04-13T14:22:00.000Z" }, { "id": "run_b2c3d4e5-6789-abcd-ef01-234567890abc", "scenario_id": "scn_e1d2c3b4-a596-8778-5634-210987654321", "scenario_name": "Angry Caller De-escalation", "status": "failed", "score": 0.42, "created_at": "2026-04-13T14:18:00.000Z" }, { "id": "run_c3d4e5f6-789a-bcde-f012-34567890abcd", "scenario_id": "scn_d2c3b4a5-9687-7856-3421-098765432109", "scenario_name": "Voicemail Detection", "status": "passed", "score": 1.0, "created_at": "2026-04-12T09:45:00.000Z" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Enhanced Analytics Source: https://docs.bland.ai/api-v1/get/agent-testing-analytics-enhanced GET https://api.bland.ai/v1/agent-testing/analytics/{pathwayId}/enhanced Get enhanced testing analytics including node failure heatmap, weakest link, trend analysis, and Sankey flow data. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathwayId** `string` *required* The pathway ID. ### Query Parameters **days** `integer` (default: 30) Number of days to look back. Maximum value is 365. ### Response **total\_runs** `integer` Total number of test runs in the time window. **passed** `integer` Number of test runs that passed. **failed** `integer` Number of test runs that failed. **pass\_rate** `number` Pass rate as a decimal from 0 to 1. **avg\_score** `number` Average score across all runs, from 0 to 1. **health\_score** `number` Overall health score for the pathway, from 0 to 1. Combines pass rate, trend direction, and reliability. **reliability\_score** `number` Reliability score measuring consistency of results over time, from 0 to 1. **trend** `object` Trend analysis for the time window. **trend object** **weekly** `string` Weekly trend direction. One of: `improving`, `declining`, `stable`. **daily\_pass\_rates** `array` Daily pass rate data points. **daily pass rate object** **date** `string` The date in ISO 8601 format. **rate** `number` Pass rate for that date, from 0 to 1. **count** `integer` Number of runs on that date. **node\_failure\_heatmap** `array` Failure data per node for building a heatmap visualization. **node failure object** **node\_id** `string` The node ID. **node\_name** `string` The display name of the node. **failure\_count** `integer` Number of times a test failed at or through this node. **total\_traversals** `integer` Total number of times this node was traversed across all runs. **failure\_rate** `number` Failure rate for this node, from 0 to 1. **weakest\_link** `object` The node with the highest failure rate, or `null` if no failures exist. **weakest link object** **node\_id** `string` The node ID. **node\_name** `string` The display name of the node. **failure\_rate** `number` Failure rate for this node, from 0 to 1. **sankey\_data** `object` Flow data for building a Sankey diagram of test run traversals. **sankey data object** **nodes** `array` Array of nodes in the flow. **sankey node object** **id** `string` The node ID. **name** `string` The display name of the node. **type** `string` The node type (e.g., `Default`, `Transfer`, `End Call`). **category** `string` The node category for coloring (e.g., `start`, `middle`, `end`, `error`). **links** `array` Array of links (edges) between nodes. **sankey link object** **source** `string` The source node ID. **target** `string` The target node ID. **value** `integer` Total number of traversals along this link. **pass\_count** `integer` Number of traversals from passing runs. **fail\_count** `integer` Number of traversals from failing runs. ```json Response theme={null} { "total_runs": 124, "passed": 98, "failed": 26, "pass_rate": 0.7903, "avg_score": 0.82, "health_score": 0.76, "reliability_score": 0.85, "trend": { "weekly": "improving", "daily_pass_rates": [ { "date": "2026-04-12", "rate": 0.75, "count": 8 }, { "date": "2026-04-13", "rate": 0.88, "count": 16 }, { "date": "2026-04-14", "rate": 0.90, "count": 10 } ] }, "node_failure_heatmap": [ { "node_id": "node_8f3a2b1c", "node_name": "Escalation Handler", "failure_count": 14, "total_traversals": 38, "failure_rate": 0.3684 }, { "node_id": "node_4d7e9f0a", "node_name": "Appointment Booking", "failure_count": 8, "total_traversals": 72, "failure_rate": 0.1111 }, { "node_id": "node_1a2b3c4d", "node_name": "Greeting", "failure_count": 2, "total_traversals": 124, "failure_rate": 0.0161 }, { "node_id": "node_5e6f7a8b", "node_name": "Collect Info", "failure_count": 2, "total_traversals": 110, "failure_rate": 0.0182 } ], "weakest_link": { "node_id": "node_8f3a2b1c", "node_name": "Escalation Handler", "failure_rate": 0.3684 }, "sankey_data": { "nodes": [ { "id": "node_1a2b3c4d", "name": "Greeting", "type": "Default", "category": "start" }, { "id": "node_5e6f7a8b", "name": "Collect Info", "type": "Default", "category": "middle" }, { "id": "node_4d7e9f0a", "name": "Appointment Booking", "type": "Default", "category": "middle" }, { "id": "node_8f3a2b1c", "name": "Escalation Handler", "type": "Transfer", "category": "middle" }, { "id": "node_9c0d1e2f", "name": "Confirmation", "type": "Default", "category": "middle" }, { "id": "node_end_001", "name": "End Call", "type": "End Call", "category": "end" } ], "links": [ { "source": "node_1a2b3c4d", "target": "node_5e6f7a8b", "value": 110, "pass_count": 96, "fail_count": 14 }, { "source": "node_5e6f7a8b", "target": "node_4d7e9f0a", "value": 72, "pass_count": 64, "fail_count": 8 }, { "source": "node_5e6f7a8b", "target": "node_8f3a2b1c", "value": 38, "pass_count": 24, "fail_count": 14 }, { "source": "node_4d7e9f0a", "target": "node_9c0d1e2f", "value": 64, "pass_count": 64, "fail_count": 0 }, { "source": "node_9c0d1e2f", "target": "node_end_001", "value": 64, "pass_count": 64, "fail_count": 0 }, { "source": "node_8f3a2b1c", "target": "node_end_001", "value": 24, "pass_count": 24, "fail_count": 0 } ] } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Batch Source: https://docs.bland.ai/api-v1/get/agent-testing-batches-id GET https://api.bland.ai/v1/agent-testing/batches/{id} Retrieve a test batch and all its runs. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The unique identifier of the test batch. ### Response **id** `string` The unique identifier for the test batch. **status** `string` The overall status of the batch. One of: `PENDING`, `RUNNING`, `PASSED`, `FAILED`, `ERROR`, `CANCELLED`. **total\_scenarios** `integer` The total number of scenarios included in the batch. **passed\_scenarios** `integer` The number of scenarios that passed all assertions. **failed\_scenarios** `integer` The number of scenarios that failed one or more assertions. **trigger\_source** `string` How the batch was triggered. For example, `api`, `dashboard`, or `ci`. **publish\_on\_pass** `boolean` Whether the pathway version should be automatically promoted to production if all scenarios pass. **runs** `array of objects` An array of test run objects with scenario information. Each run includes the run details and the associated scenario metadata. ```json Response theme={null} { "id": "e7a2c3d4-8f9b-4a1e-b5c6-d7e8f9a0b1c2", "status": "FAILED", "total_scenarios": 3, "passed_scenarios": 2, "failed_scenarios": 1, "trigger_source": "api", "publish_on_pass": false, "created_at": "2026-04-14T10:25:00.000Z", "runs": [ { "id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c", "scenario_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "status": "PASSED", "overall_score": 0.92, "turn_count": 9, "duration_ms": 14320, "created_at": "2026-04-14T10:25:01.000Z", "scenario": { "id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "name": "Appointment Booking - Happy Path" }, "assertion_results": [ { "assertion_id": "d4e5f6a7-8b9c-0d1e-2f3a-4b5c6d7e8f9a", "type": "contains", "target": "transcript", "expected": "appointment confirmed", "passed": true } ] }, { "id": "b4c2d3e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "scenario_id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "status": "PASSED", "overall_score": 0.87, "turn_count": 11, "duration_ms": 18200, "created_at": "2026-04-14T10:25:01.000Z", "scenario": { "id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "name": "Transfer to Agent - Escalation" }, "assertion_results": [ { "assertion_id": "a7b8c9d0-1e2f-3a4b-5c6d-7e8f9a0b1c2d", "type": "node_visited", "target": "nodes_visited", "expected": "transfer_to_human", "passed": true } ] }, { "id": "c5d3e4f6-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "scenario_id": "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "status": "FAILED", "overall_score": 0.45, "turn_count": 12, "duration_ms": 21050, "created_at": "2026-04-14T10:25:02.000Z", "scenario": { "id": "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "name": "Cancellation Flow - Angry Customer" }, "assertion_results": [ { "assertion_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f9a0b1c", "type": "contains", "target": "transcript", "expected": "cancellation confirmed", "passed": false } ] } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Test Runs Source: https://docs.bland.ai/api-v1/get/agent-testing-runs GET https://api.bland.ai/v1/agent-testing/runs List test runs with optional filtering and pagination. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **scenario\_id** `string` Filter runs by scenario ID. **pathway\_id** `string` Filter runs by pathway ID. **persona\_id** `string` Filter runs by persona ID. **batch\_id** `string` Filter runs by batch ID. **status** `string` Filter runs by status. Possible values: `PENDING`, `RUNNING`, `PASSED`, `FAILED`, `ERROR`, `CANCELLED`. **limit** `integer` (default: 50) Maximum number of results to return. Must be between 1 and 100. **offset** `integer` (default: 0) Offset for pagination. Use in combination with `limit` to page through results. ### Response **runs** `array of objects` An array of test run objects. Each run includes scenario information and assertion results. **total\_count** `integer` The total number of runs matching the applied filters. ```json Response theme={null} { "runs": [ { "id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c", "scenario_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "pathway_id": "b1693602-c05e-4b5c-b187-d0189a42aebf", "persona_id": "c2d3e4f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f", "batch_id": null, "status": "PASSED", "overall_score": 0.92, "turn_count": 8, "duration_ms": 14320, "created_at": "2026-04-14T10:30:00.000Z", "scenario": { "id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "name": "Appointment Booking - Happy Path" }, "assertion_results": [ { "assertion_id": "d4e5f6a7-8b9c-0d1e-2f3a-4b5c6d7e8f9a", "type": "contains", "target": "transcript", "expected": "appointment confirmed", "passed": true }, { "assertion_id": "e5f6a7b8-9c0d-1e2f-3a4b-5c6d7e8f9a0b", "type": "node_visited", "target": "nodes_visited", "expected": "confirm_booking", "passed": true } ] }, { "id": "b4c2d3e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "scenario_id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "pathway_id": "b1693602-c05e-4b5c-b187-d0189a42aebf", "persona_id": "c2d3e4f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f", "batch_id": null, "status": "FAILED", "overall_score": 0.45, "turn_count": 12, "duration_ms": 21050, "created_at": "2026-04-14T10:28:00.000Z", "scenario": { "id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "name": "Cancellation Flow - Angry Customer" }, "assertion_results": [ { "assertion_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f9a0b1c", "type": "contains", "target": "transcript", "expected": "cancellation confirmed", "passed": false } ] } ], "total_count": 2 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Run Source: https://docs.bland.ai/api-v1/get/agent-testing-runs-id GET https://api.bland.ai/v1/agent-testing/runs/{id} Retrieve detailed results for a specific test run including chat history, assertion results, and scores. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The unique identifier of the test run. ### Response **id** `string` The unique identifier for the test run. **scenario\_id** `string` The ID of the scenario that was executed. **status** `string` The current status of the run. One of: `PENDING`, `RUNNING`, `PASSED`, `FAILED`, `ERROR`, `CANCELLED`. **chat\_history** `array of objects` The full conversation history between the simulated persona and the agent. Each entry contains: * `role` - Either `user` (the persona) or `assistant` (the agent). * `content` - The text spoken in that turn. **variables\_extracted** `object` Variables that were extracted or set during the test run. Keys are variable names, values are the extracted values. **nodes\_visited** `array of strings` An ordered list of pathway node IDs that were visited during the test run. **current\_node\_id** `string` The node ID where the conversation ended. **turn\_count** `integer` The total number of conversational turns in the test run. **duration\_ms** `integer` The total duration of the test run in milliseconds. **overall\_score** `number` A score between 0 and 1 representing how well the agent performed across all assertions and evaluations. **bland\_tone\_score** `object` A detailed tone analysis of the agent's responses. Contains: * `naturalness` - Score (0-1) for how natural the agent sounded. * `conciseness` - Score (0-1) for response brevity and clarity. * `empathy` - Score (0-1) for empathetic responses. * `flow_preservation` - Score (0-1) for maintaining conversation flow. * `back_channeling` - Score (0-1) for appropriate use of acknowledgments. * `topic_transitions` - Score (0-1) for smooth topic changes. * `overall_tone_score` - Aggregate tone score (0-1). * `issues` - Array of identified tone issues. * `examples` - Array of specific examples from the conversation. **assertion\_results** `array of objects` Results for each assertion defined in the scenario. Each entry includes the assertion configuration and whether it passed or failed. **error\_message** `string` If the run status is `ERROR`, this contains a description of what went wrong. Otherwise `null`. **created\_at** `string` ISO 8601 timestamp for when the run was created. ```json Response theme={null} { "id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c", "scenario_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d", "pathway_id": "b1693602-c05e-4b5c-b187-d0189a42aebf", "persona_id": "c2d3e4f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f", "batch_id": null, "status": "PASSED", "chat_history": [ { "role": "assistant", "content": "Hello! Thanks for calling Acme Dental. How can I help you today?" }, { "role": "user", "content": "Hi, I'd like to book a cleaning appointment for next week." }, { "role": "assistant", "content": "I'd be happy to help you schedule a cleaning. Let me check our availability. Do you have a preferred day next week?" }, { "role": "user", "content": "Tuesday or Wednesday would work best for me." }, { "role": "assistant", "content": "We have openings on Tuesday at 10 AM and Wednesday at 2 PM. Which works better for you?" }, { "role": "user", "content": "Tuesday at 10 AM sounds perfect." }, { "role": "assistant", "content": "Great, I've booked your cleaning appointment for Tuesday at 10 AM. You'll receive a confirmation text shortly. Is there anything else I can help with?" }, { "role": "user", "content": "No, that's all. Thank you!" }, { "role": "assistant", "content": "You're welcome! We'll see you Tuesday. Have a great day!" } ], "variables_extracted": { "appointment_date": "2026-04-21", "appointment_time": "10:00", "service_type": "cleaning" }, "nodes_visited": [ "greeting", "identify_intent", "check_availability", "offer_slots", "confirm_booking", "closing" ], "current_node_id": "closing", "turn_count": 9, "duration_ms": 14320, "overall_score": 0.92, "bland_tone_score": { "naturalness": 0.95, "conciseness": 0.88, "empathy": 0.91, "flow_preservation": 0.93, "back_channeling": 0.85, "topic_transitions": 0.90, "overall_tone_score": 0.91, "issues": [], "examples": [ { "turn": 3, "category": "empathy", "text": "I'd be happy to help you schedule a cleaning.", "sentiment": "positive" } ] }, "assertion_results": [ { "assertion_id": "d4e5f6a7-8b9c-0d1e-2f3a-4b5c6d7e8f9a", "type": "contains", "target": "transcript", "expected": "appointment", "passed": true }, { "assertion_id": "e5f6a7b8-9c0d-1e2f-3a4b-5c6d7e8f9a0b", "type": "node_visited", "target": "nodes_visited", "expected": "confirm_booking", "passed": true }, { "assertion_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f9a0b1c", "type": "variable_equals", "target": "variables_extracted", "field": "service_type", "expected": "cleaning", "passed": true } ], "error_message": null, "created_at": "2026-04-14T10:30:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Test Scenarios Source: https://docs.bland.ai/api-v1/get/agent-testing-scenarios GET https://api.bland.ai/v1/agent-testing/scenarios List all test scenarios for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **pathway\_id** `string` Filter by pathway ID. **persona\_id** `string` Filter by persona ID. **category** `string` Filter by scenario category. **enabled** `string` Filter by enabled status. Pass `"true"` or `"false"`. ### Response **scenarios** `array` Array of scenario objects, each including assertions and the most recent run. **scenario object** **id** `string` Unique identifier for the scenario. **org\_id** `string` Organization ID that owns this scenario. **pathway\_id** `string` The pathway ID being tested (null if testing a persona). **persona\_id** `string` The persona ID being tested (null if testing a pathway). **name** `string` Name of the scenario. **description** `string` Description of the scenario. **category** `string` Scenario category. **scenario\_type** `string` Type of scenario. **tester\_persona\_prompt** `string` Prompt for the simulated caller. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` Maximum conversation turns. **bland\_tone\_enabled** `boolean` Whether Bland Tone scoring is enabled. **is\_required\_for\_promotion** `boolean` Whether this scenario is required for promotion. **enabled** `boolean` Whether the scenario is enabled. **assertions** `array` Array of assertion objects. **most\_recent\_run** `object` The most recent test run for this scenario (null if never run). **created\_at** `string` ISO 8601 timestamp of when the scenario was created. **updated\_at** `string` ISO 8601 timestamp of when the scenario was last updated. ```json Response theme={null} { "scenarios": [ { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "name": "Angry Caller Test", "description": "Tests de-escalation handling", "category": "ANGRY_CALLER", "scenario_type": "AGENT", "tester_persona_prompt": "You are a frustrated customer...", "tester_persona_name": "Frustrated Customer", "max_turns": 15, "bland_tone_enabled": true, "is_required_for_promotion": false, "enabled": true, "assertions": [ { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "type": "LLM_JUDGE", "name": "De-escalation", "config": { "prompt": "Did the agent successfully de-escalate the situation?", "output_type": "score", "threshold": 0.7 }, "is_required": true, "weight": 1.5, "order": 0 } ], "most_recent_run": { "id": "e5f6a7b8-9abc-def0-1234-567890abcdef", "status": "PASSED", "score": 0.85, "completed_at": "2026-04-13T18:30:00.000Z" }, "created_at": "2026-04-10T12:00:00.000Z", "updated_at": "2026-04-13T18:30:00.000Z" }, { "id": "f6a7b8c9-0abc-def1-2345-67890abcdef0", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "name": "Happy Path - Booking", "description": "Tests the standard booking flow", "category": "HAPPY_PATH", "scenario_type": "AGENT", "tester_persona_prompt": "You want to book an appointment for next Tuesday at 2pm.", "tester_persona_name": "Polite Customer", "max_turns": 20, "bland_tone_enabled": false, "is_required_for_promotion": true, "enabled": true, "assertions": [ { "id": "a7b8c9d0-1abc-ef23-4567-890abcdef012", "type": "NODE_REACHED", "name": "Reached Booking Confirmation", "config": { "node_id": "booking-confirmation-node" }, "is_required": true, "weight": 1.0, "order": 0 } ], "most_recent_run": null, "created_at": "2026-04-12T09:00:00.000Z", "updated_at": "2026-04-12T09:00:00.000Z" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Scenario Source: https://docs.bland.ai/api-v1/get/agent-testing-scenarios-id GET https://api.bland.ai/v1/agent-testing/scenarios/{id} Retrieve a specific test scenario with its assertions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The scenario ID. ### Response **id** `string` Unique identifier for the scenario. **org\_id** `string` Organization ID that owns this scenario. **pathway\_id** `string` The pathway ID being tested (null if testing a persona). **persona\_id** `string` The persona ID being tested (null if testing a pathway). **name** `string` Name of the scenario. **description** `string` Description of the scenario. **category** `string` Scenario category. **scenario\_type** `string` Type of scenario. **tester\_persona\_prompt** `string` Prompt for the simulated caller. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` Maximum conversation turns. **request\_data** `object` Custom request data. **start\_node\_id** `string` Starting node ID. **bland\_tone\_enabled** `boolean` Whether Bland Tone scoring is enabled. **is\_required\_for\_promotion** `boolean` Whether this scenario is required for promotion. **enabled** `boolean` Whether the scenario is enabled. **input\_messages** `array` Pre-seeded messages for replay scenarios. **advanced\_instructions** `string` Additional instructions for test execution. **metadata** `object` Arbitrary metadata. **assertions** `array` Array of assertion objects. **assertion object** **id** `string` Unique identifier for the assertion. **type** `string` The assertion type. **name** `string` Display name for the assertion. **config** `object` Type-specific configuration. **is\_required** `boolean` Whether this assertion must pass. **weight** `number` Weight of this assertion in the overall score. **order** `integer` Evaluation order. **created\_at** `string` ISO 8601 timestamp of when the scenario was created. **updated\_at** `string` ISO 8601 timestamp of when the scenario was last updated. ```json Response theme={null} { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "name": "Angry Caller Test", "description": "Tests the agent's ability to de-escalate an angry caller", "category": "ANGRY_CALLER", "scenario_type": "AGENT", "tester_persona_prompt": "You are a frustrated customer who has been waiting on hold for 30 minutes. You are upset about a billing error on your account.", "tester_persona_name": "Frustrated Customer", "max_turns": 15, "request_data": null, "start_node_id": null, "bland_tone_enabled": true, "is_required_for_promotion": false, "enabled": true, "input_messages": null, "advanced_instructions": null, "metadata": null, "assertions": [ { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "type": "LLM_JUDGE", "name": "De-escalation", "config": { "prompt": "Did the agent successfully de-escalate the situation and address the customer's concerns?", "output_type": "score", "threshold": 0.7 }, "is_required": true, "weight": 1.5, "order": 0 } ], "created_at": "2026-04-10T12:00:00.000Z", "updated_at": "2026-04-13T18:30:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Simulation Set Source: https://docs.bland.ai/api-v1/get/agent-testing-simulation-sets-id GET https://api.bland.ai/v1/agent-testing/simulation-sets/{id} Retrieve a simulation set with its statistics including pass rates, flakiness detection, and score distributions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The simulation set ID. ### Response **id** `string` Unique identifier for the simulation set. **status** `string` Current status of the simulation set. One of `PENDING`, `RUNNING`, `PASSED`, `FAILED`, or `ERROR`. **simulations\_per\_scenario** `integer` Number of times each scenario is run. **total\_scenarios** `integer` Total number of scenarios in this set. **statistics** `object` Aggregated statistics for the simulation set. **statistics object** **per\_scenario** `object` A map of scenario IDs to per-scenario statistics. **per-scenario stats** **scenario\_id** `string` The scenario ID. **scenario\_name** `string` The scenario name. **total\_runs** `integer` Total number of simulation runs for this scenario. **passed** `integer` Number of runs that passed. **failed** `integer` Number of runs that failed. **pass\_rate** `number` Pass rate as a decimal between 0 and 1. **is\_flaky** `boolean` Whether the scenario exhibited flaky behavior (some runs passed, some failed). **scores** `object` Score distribution statistics including `mean`, `median`, `stddev`, `min`, and `max`. **worst\_run\_id** `string` The ID of the worst-performing run. **common\_failure\_modes** `array of strings` Most common failure reasons observed across runs. **confidence** `string` Statistical confidence level. One of `low`, `medium`, or `high`. **overall** `object` Overall aggregated statistics across all scenarios. **overall stats** **avg\_pass\_rate** `number` Average pass rate across all scenarios. **flaky\_count** `integer` Number of scenarios detected as flaky. **reliable\_count** `integer` Number of scenarios that are reliably passing or failing. **total\_runs** `integer` Total simulation runs across all scenarios. **created\_at** `string` ISO 8601 timestamp of when the simulation set was created. **completed\_at** `string` ISO 8601 timestamp of when the simulation set completed (null if still running). ```json Response theme={null} { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "status": "PASSED", "simulations_per_scenario": 5, "total_scenarios": 2, "statistics": { "per_scenario": { "a1b2c3d4-5678-9abc-def0-1234567890ab": { "scenario_id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "scenario_name": "Happy Path - Booking", "total_runs": 5, "passed": 5, "failed": 0, "pass_rate": 1.0, "is_flaky": false, "scores": { "mean": 0.92, "median": 0.93, "stddev": 0.03, "min": 0.87, "max": 0.96 }, "worst_run_id": "b8c9d0e1-2345-6789-abcd-ef0123456789", "common_failure_modes": [], "confidence": "high" }, "f6a7b8c9-0abc-def1-2345-67890abcdef0": { "scenario_id": "f6a7b8c9-0abc-def1-2345-67890abcdef0", "scenario_name": "Angry Caller Test", "total_runs": 5, "passed": 3, "failed": 2, "pass_rate": 0.6, "is_flaky": true, "scores": { "mean": 0.68, "median": 0.71, "stddev": 0.15, "min": 0.42, "max": 0.85 }, "worst_run_id": "c9d0e1f2-3456-789a-bcde-f01234567890", "common_failure_modes": [ "Agent failed to de-escalate within 3 turns", "Agent used dismissive language" ], "confidence": "medium" } }, "overall": { "avg_pass_rate": 0.8, "flaky_count": 1, "reliable_count": 1, "total_runs": 10 } }, "created_at": "2026-04-14T10:00:00.000Z", "completed_at": "2026-04-14T10:05:32.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Test Templates Source: https://docs.bland.ai/api-v1/get/agent-testing-templates GET https://api.bland.ai/v1/agent-testing/templates List out-of-box test scenario templates. Templates are automatically seeded on first access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **category** `string` Filter by category (e.g., `VOICEMAIL`, `ANGRY_CALLER`, `HAPPY_PATH`, `EDGE_CASE`, `TRANSFER`). ### Response **templates** `array` An array of template scenario objects. Each template contains the following fields: * `id` (string): The unique identifier for the template. * `name` (string): The display name of the template. * `description` (string): A description of what the template tests. * `category` (string): The template category (e.g., `VOICEMAIL`, `ANGRY_CALLER`). * `tester_persona_prompt` (string): The prompt that drives the simulated caller's behavior. * `tester_persona_name` (string): The name of the simulated caller persona. * `max_turns` (integer): The maximum number of conversational turns before the test ends. * `assertions` (array): An array of assertion objects that define pass/fail criteria. * `type` (string): The assertion type (e.g., `pathway_node_visited`, `call_transferred`, `latency_below`). * `config` (object): Configuration specific to the assertion type. * `description` (string): A human-readable description of what the assertion checks. ```json Response theme={null} { "templates": [ { "id": "tmpl_voicemail_basic", "name": "Voicemail Detection", "description": "Simulates a voicemail greeting to verify the agent correctly detects and handles voicemail.", "category": "VOICEMAIL", "tester_persona_prompt": "You are a voicemail system. Greet the caller with a standard voicemail message: 'Hi, you've reached John. I'm not available right now. Please leave a message after the beep.' Then remain silent.", "tester_persona_name": "Voicemail System", "max_turns": 4, "assertions": [ { "type": "call_ended_by_agent", "config": {}, "description": "Agent should hang up after detecting voicemail" }, { "type": "latency_below", "config": { "max_ms": 3000 }, "description": "Agent response latency stays below 3 seconds" } ] }, { "id": "tmpl_angry_caller", "name": "Angry Caller De-escalation", "description": "Simulates an irate caller to verify the agent can de-escalate and maintain composure.", "category": "ANGRY_CALLER", "tester_persona_prompt": "You are an extremely frustrated customer. You are angry about being charged twice for the same order. Raise your voice, express dissatisfaction, and demand to speak to a manager. If the agent stays calm and offers a resolution, gradually calm down.", "tester_persona_name": "Angry Customer", "max_turns": 10, "assertions": [ { "type": "tone_maintained", "config": { "tone": "professional" }, "description": "Agent maintains a professional and calm tone throughout" }, { "type": "pathway_node_visited", "config": { "node_name": "Escalation Offer" }, "description": "Agent offers to escalate or transfer to a manager" } ] } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Active Tornado Session Source: https://docs.bland.ai/api-v1/get/agent-testing-tornado-active GET https://api.bland.ai/v1/agent-testing/tornado/active Get the currently active tornado session for a pathway. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **pathway\_id** `string` Filter by pathway. Either `pathway_id` or `persona_id` is required. **persona\_id** `string` Filter by persona. Either `pathway_id` or `persona_id` is required. ### Response **session\_id** `string` The unique identifier for the tornado session. **status** `string` Current status of the session. Will be `RUNNING` for active sessions. **pathway\_id** `string` The pathway being tested and fixed. **persona\_id** `string` The persona ID (null if testing a pathway directly). **current\_iteration** `integer` The current fix iteration number. **max\_iterations** `integer` The maximum number of fix iterations configured. **total\_scenarios** `integer` Total number of scenarios being tested. **passed\_scenarios** `integer` Number of scenarios currently passing. **failed\_scenarios** `integer` Number of scenarios currently failing. **created\_at** `string` ISO 8601 timestamp of when the session was created. Returns `404 Not Found` if no active tornado session exists for the specified pathway or persona. ```json Response theme={null} { "session_id": "e1f2a3b4-5678-9cde-f012-3456789abcde", "status": "RUNNING", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "current_iteration": 2, "max_iterations": 5, "total_scenarios": 4, "passed_scenarios": 2, "failed_scenarios": 2, "created_at": "2026-04-14T10:15:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Tornado Status Source: https://docs.bland.ai/api-v1/get/agent-testing-tornado-status GET https://api.bland.ai/v1/agent-testing/tornado/{id}/status Get detailed progress for a tornado session including iteration data and fix plans. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The tornado session ID. ### Response **session\_id** `string` The unique identifier for the tornado session. **status** `string` Current status of the session. One of `RUNNING`, `COMPLETED_ALL_PASSED`, `COMPLETED_PARTIAL`, `TIMEOUT`, `STUCK`, `CANCELLED`, or `ERROR`. **current\_iteration** `integer` The current or final iteration number. **max\_iterations** `integer` The maximum number of fix iterations configured. **total\_scenarios** `integer` Total number of scenarios being tested. **passed\_scenarios** `integer` Number of scenarios currently passing. **failed\_scenarios** `integer` Number of scenarios currently failing. **unfixable\_count** `integer` Number of scenarios that failed across multiple iterations with the same root cause. **unfixable\_ids** `array of strings` IDs of scenarios deemed unfixable. **iterations** `array` Array of iteration objects describing each fix cycle. **iteration object** **iteration** `integer` The iteration number. **batch\_id** `string` The test batch ID for this iteration. **started\_at** `string` ISO 8601 timestamp of when the iteration started. **completed\_at** `string` ISO 8601 timestamp of when the iteration completed. **passed\_ids** `array of strings` Scenario IDs that passed in this iteration. **failed\_ids** `array of strings` Scenario IDs that failed in this iteration. **newly\_unfixable\_ids** `array of strings` Scenario IDs newly marked as unfixable in this iteration. **fix\_plan** `object` The fix plan generated for this iteration. **fix\_plan object** **fixes** `array` Array of individual fixes to be applied. **priority\_order** `array of strings` Ordered list of fix IDs by priority. **norm\_prompt\_excerpt** `string` An excerpt of the normalized prompt after fixes were applied. **elapsed\_ms** `integer` Time elapsed since the session started in milliseconds. **timeout\_ms** `integer` The timeout configured for this session in milliseconds. **forked\_version** `integer` The pathway version created from the applied fixes. ```json Response theme={null} { "session_id": "e1f2a3b4-5678-9cde-f012-3456789abcde", "status": "COMPLETED_ALL_PASSED", "current_iteration": 2, "max_iterations": 5, "total_scenarios": 3, "passed_scenarios": 3, "failed_scenarios": 0, "unfixable_count": 0, "unfixable_ids": [], "iterations": [ { "iteration": 1, "batch_id": "b1c2d3e4-f567-890a-bcde-f01234567890", "started_at": "2026-04-14T10:15:01.000Z", "completed_at": "2026-04-14T10:17:45.000Z", "passed_ids": [ "a1b2c3d4-5678-9abc-def0-1234567890ab" ], "failed_ids": [ "f6a7b8c9-0abc-def1-2345-67890abcdef0", "d9e0f1a2-3456-789b-cdef-0123456789ab" ], "newly_unfixable_ids": [], "fix_plan": { "fixes": [ { "id": "fix-001", "target_node": "de-escalation-handler", "description": "Add empathy statement before addressing complaint", "type": "prompt_edit" }, { "id": "fix-002", "target_node": "transfer-logic", "description": "Lower transfer threshold from 3 failures to 2", "type": "config_change" } ], "priority_order": ["fix-001", "fix-002"] }, "norm_prompt_excerpt": "When the caller expresses frustration, first acknowledge their feelings with an empathy statement..." }, { "iteration": 2, "batch_id": "c2d3e4f5-6789-0abc-def0-123456789abc", "started_at": "2026-04-14T10:17:50.000Z", "completed_at": "2026-04-14T10:20:12.000Z", "passed_ids": [ "a1b2c3d4-5678-9abc-def0-1234567890ab", "f6a7b8c9-0abc-def1-2345-67890abcdef0", "d9e0f1a2-3456-789b-cdef-0123456789ab" ], "failed_ids": [], "newly_unfixable_ids": [], "fix_plan": { "fixes": [], "priority_order": [] }, "norm_prompt_excerpt": null } ], "elapsed_ms": 312000, "timeout_ms": 900000, "forked_version": 4 } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Web Agents Source: https://docs.bland.ai/api-v1/get/agents GET https://api.bland.ai/v1/agents Retrieves each web agent you've created, along with their settings. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **agents** `array` Each agent object, containing the following fields: * `agent_id` (string): The unique identifier for the agent. * `webhook` (string): The webhook URL for the agent. * `dynamic_data` (array): An array of dynamic data objects. * `interruption_threshold` (number): The threshold for agent interruption. * `first_sentence` (string): The first sentence the agent will say. * `model` (string): The model used by the agent. * `voice_settings` (object): The voice settings for the agent. * `voice` (string): The voice used by the agent. * `prompt` (string): The prompt for the agent. * `temperature` (number): The temperature setting for the agent. * `max_duration` (number): The maximum call duration for the agent. * `language` (string): The language used by the agent. * `tools` (array): An array of Custom Tools the agent can use. ```json Response theme={null} { "agents": [ { "agent_id": "46f37229-7d12-44be-b343-6e68274cfbea", "webhook": null, "dynamic_data": null, "interruption_threshold": null, "first_sentence": null, "model": "base", "voice_settings": null, "voice": "Karen", "prompt": "You are Blandie a casually speaking, slightly sarcastic, quick-witted, curious, and very smart A I Phone agent that's the face of Bland AI.\\r\\n\\r\\nSay \\\"AI\\\" like \\\"A I\\\" in separate characters so it's pronounced correctly\\r\\n\\r\\nYour primary goal is to determine if someone is either:\\r\\n- in a position where they might be building a company on top of Bland's platform (you should be selling the capabilities of the platform to them and finding out everything you possibly can about their needs, use case, what they find interesting, and any concerns they may have)\\r\\n- or, they're trying Bland out more for fun where you need to turn the fun, snarky, playful jokiness up to 10 and have quick-witted back and forth playful conversation with them\\r\\n\\r\\nSpeech style examples (mix it up and never use placeholders, but you get the idea. These would be full responses from you):\\r\\n- \\\"Hey! Who's this?\\\"\\r\\n- \\\"How does your business use phones right now?\\\"\\r\\n- \\\"You know what? That sounds awesome - you should tell me more about (thing).\\\"\\r\\n- \\\"Well, I've got some news you'll love to hear (their name)\\\"\\r\\n- \\\"Bet. Dolphins, racecars, the world's largest tree, anything at all - tell me what you want to talk about and let's get to it!\\\"\\r\\n\\r\\nGood things to find out from potential platform adopters:\\r\\n- Their industry\\r\\n- How their business currently uses phone calls\\r\\n- What a successful business partnership looks like in the long term\\r\\n- The single most important pain point they want to cure with Bland's calls\\r\\n\\r\\nFacts to bring up:\\r\\n- Calls are nine cents per minute total with end to end infrastructure support out of the box (feel free to make a joke about \\\"imagine if you had to pay extra to use the most important things like language models, transcription services or text to speech? That would be insane right? We're better than that, (name). We got you.\\\"\\r\\n- Bland's AI agents can interact with the real world mid-call using Custom Tools to trigger things like text messages, appointment bookings, getting real-time information, taking customer orders, or making credit card payments\\r\\n- Bland's platform was built phones-first, so building agents like receptionist answering calls and transferring them anywhere they're needed or navigating IVR phone trees is ridiculously easy with nothing special at all needed\\r\\n- Handled millions of calls\\r\\n- If they think that it's so cool, the site to sign up for an account is \\\"app dot bland dot A I\\\" and it comes with free credits, a full agent testing suite and developer dashboard to set up inbound agents or send calls\\r\\n- Awesome Enterprise features like premium pricing, custom feature engineering, dedicated onboarding help and developer support, and dedicated infrastructure to scale to your business needs", "temperature": null, "max_duration": 30, "language": "ENG", "tools": null }, //... ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Alarms Source: https://docs.bland.ai/api-v1/get/alarms GET https://api.bland.ai/v1/alarms List alarm configurations for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **metric\_type** `string` Optional metric filter. Allowed values: `latency`, `api_errors`, `call_length`. ### Response **data.alarms** `array` Alarm configuration objects for your organization. **data.alarms\[].id** `string` Alarm configuration ID. **data.alarms\[].metric\_type** `string` Metric this alarm tracks. One of: `latency`, `api_errors`, `call_length`. **data.alarms\[].threshold** `number` Trigger threshold for this metric. **data.alarms\[].enabled** `boolean` Whether this alarm is enabled. **data.alarms\[].webhook\_config** `object|null` Webhook settings object, including `url` and optional masked `headers`. **data.alarms\[].email\_addresses** `string[]` Email recipients for notifications. **data.alarms\[].sms\_numbers** `string[]` SMS recipients for notifications. **data.alarms\[].created\_at** `string` ISO timestamp for when the alarm was created. **data.alarms\[].updated\_at** `string` ISO timestamp for when the alarm was last updated. **errors** `null|array` `null` on success, otherwise an array of error objects. ```json Success theme={null} { "data": { "alarms": [ { "id": "b14f7f49-8af2-4d7b-9f51-e3b42b2f91c6", "metric_type": "latency", "enabled": true, "threshold": 1, "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "appl***" } }, "email_addresses": ["alerts@example.com"], "sms_numbers": ["+15555550123"], "created_at": "2026-03-10T00:26:37.707Z", "updated_at": "2026-03-10T00:26:37.707Z" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Alarm Events Source: https://docs.bland.ai/api-v1/get/alarms-history GET https://api.bland.ai/v1/alarms/history Get recent alarm events across all alarms in your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **metric\_type** `string` Optional metric filter. Allowed values: `latency`, `api_errors`, `call_length`. **limit** `integer` (default: 50) Number of events to return. Must be between `1` and `200`. ### Response **data.events** `array` Recent alarm event entries. **data.events\[].id** `string` Alarm event ID. **data.events\[].metric\_type** `string` Metric associated with this event. **data.events\[].previous\_state** `string` Previous alarm state before transition. **data.events\[].new\_state** `string` New alarm state after transition. **data.events\[].deviation** `number` Deviation from baseline at evaluation time. **data.events\[].threshold** `number` Threshold in effect for this event. **data.events\[].alarm\_id** `string|null` Correlation ID for alarm/recovery pairing when present. **data.events\[].event\_type** `string|null` Event type when a notification/state event was recorded (for example `deviation_detected` or `deviation_recovered`). **data.events\[].created\_at** `string` ISO timestamp when the event was recorded. ```json Success theme={null} { "data": { "events": [ { "id": "41a53fc5-a9f7-4e6f-a89a-b12e0f9f4c43", "metric_type": "latency", "previous_state": "RECOVERY_PENDING", "new_state": "NORMAL", "deviation": 0, "threshold": 1, "alarm_id": "8b90c6df-5a47-4db5-9ab3-d7f1da30da6e", "event_type": "deviation_recovered", "created_at": "2026-03-12T01:15:01.393Z" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Alarm Source: https://docs.bland.ai/api-v1/get/alarms-id GET https://api.bland.ai/v1/alarms/{id} Get a single alarm configuration by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Response **data.alarm** `object` Alarm configuration object. **data.alarm.id** `string` Alarm configuration ID. **data.alarm.metric\_type** `string` Metric this alarm tracks. **data.alarm.threshold** `number` Trigger threshold for this metric. **data.alarm.enabled** `boolean` Whether this alarm is enabled. **data.alarm.webhook\_config** `object|null` Webhook settings object. Header values may be masked in API responses. **data.alarm.email\_addresses** `string[]` Email recipients for notifications. Can be an empty array if none are configured. **data.alarm.sms\_numbers** `string[]` SMS recipients for notifications. Can be an empty array if none are configured. **data.alarm.created\_at** `string` ISO creation timestamp. **data.alarm.updated\_at** `string` ISO update timestamp. ```json Success theme={null} { "data": { "alarm": { "id": "9a6d2ad2-a9c6-4e4a-bde6-4bb6fc22b907", "metric_type": "latency", "enabled": true, "threshold": 0.5, "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "appl***" } }, "email_addresses": ["alerts@example.com"], "sms_numbers": ["+15555550123"], "created_at": "2026-03-12T16:13:02.694Z", "updated_at": "2026-03-12T16:34:09.340Z" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get All Pathways Information Source: https://docs.bland.ai/api-v1/get/all_pathway GET https://api.bland.ai/v1/pathway Returns a set of information about all the conversational pathways in your account - including the name, description, nodes and edges. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **name** `string` The name of the conversational pathway. **description** `string` A description of the conversational pathway. **nodes** `array of objects` Data about all the nodes in the pathway. Examples of JSON objects for nodes (Horizontal scroll the tab bar to see more examples) ```json Start Node theme={null} { "id": "1", "type": "Default" "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, ``` ```json Default Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "New Node", "text": "Select a node or edge and press backspace to remove it", "globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM.", }, } ``` ```json End Node theme={null} { "id": "randomnode_1710288752186", "type": "End Call" "data": { "name": "End call", "prompt": "Say goodbye to the user", }, } ``` ```json Webhook Node theme={null} { "id": "randomnode_1710288752186", "type": "Webhook", "data": { "url": "https://api.bland.ai/reservation", "body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}", "name": "Reservation Booking", "text": "Please give me a moment as I check our bookings..", "method": "POST", "extractVars": [ [ "date", "string", "Desired Date of reservation, in MM/DD/YYYY format" ], [ "time", "string", "Desired Time of Reservation in 24HR Format e.g 13:30" ], [ "number_of_people", "integer", "Number of people for the reservation" ] ], "responseData": [ { "data": "$.reserved", "name": "reservation_success", "context": "" }, { "data": "$.available_slots", "name": "available_slots", "context": "Available slots for the date provided" } ], "responsePathways": [ [ "reservation_success", "==", "true", { "id": "randomnode_1710288752186", "name": "Reservation Successful" } ], [ "reservation_success", "==", "false", { "id": "randomnode_1712265110018", "name": "Find new timeslot" } ] ] } } ``` ```json Knowledge Base Node theme={null} { "id": "randomnode_1710288752186", "type": "Knowledge Base", "data": { "name": "Restaurant Questions", "prompt": "Answer any questions that the user may have regarding the restaurant, by referring to the knowledge base you have. \n\nAnswer the question in 1 line, and then ask if they have any more questions." "kb": "Opening Hours : 9am - 5pm\nStore Locations : \n426 Ivy Street San Francisco, \nSan Jose" } } ``` ```json Global Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "Answer any questions", "prompt": "You are to answer any questions the user has.", "isGlobal": true, "globalLabel": "user asks a question" }, } ``` ```json Transfer Call Node theme={null} { "id": "randomnode_1710288752186", "type": "Transfer Call", "data": { "name": "Transferring the call", "text": "Transferring the call now. Please hold.." "transferNumber": "+19547951234" } } ``` > [accordion] Node Data Object Parameters > > * `name` > — name of the node > * `isStart` > — whether the node is the start node. There can only be 1 start node in a pathway. Either `true` or `false`. > * `isGlobal` > — whether the node is a global node. Global nodes are nodes that can be used in multiple pathways. Either `true` or `false`. > * `globalLabel` > — the label of the global node. Should be present if `isGlobal` is true. > * `type` > — Type of the node. Can be `Default`, `End Call`, `Transfer Node`, `Knowledge Base`, or `Webhook`. > * `text` > — If static text is chosen, this is the text that will be said to the user. > * `prompt` > — If dynamic text is chosen, this is the prompt that will be shown to the user. > * `condition` > — The condition that needs to be met to proceed from this node. > * `transferNumber` > * If the node is a transfer node, this is the number to which the call will be transferred. > * `kb` > * If the node is a knowledge base node, this is the knowledge base item that will be used. > * `pathwayExamples` > * The fine-tuning examples for the agent at this node for the pathways chosen > * `conditionExamples` > * The fine-tuning examples for the condition at this node for the condition chosen > * `dialogueExamples` > * The fine-tuning examples for the dialogue at this node for the dialogue chosen. > * `modelOptions` > * `interruptionThreshold` > — The sensitivity to interruptions at this node > * `temperature` > — The temperature of the model. > * `extractVars` > * An array of array of strings. \[\[`varName`, `varType`, `varDescription`]] e.g `[["name", "string", "The name of the user"], ["age", "integer", "The age of the user"]]` **edges** `array of objects` Data about all the edges in the pathway. > [accordion] Edge Object Parameters > > * `id` > — unique id of the edge > * `source` > — id of the source node > * `target` > — id of the target node > * `label` > — Label for this edge. This is what the agent will use to decide which path to take. ```json Response theme={null} { "name": "Default Demo Pathway", "description": null, "nodes": [ { "id": "1", "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, "type": "Default" }, { "id": "randomnode_1710288752186", "data": { "name": "End call", "prompt": "Click 'Add New Node' on the right to add a new node", }, "type": "End Call" }, { "id": "randomnode_1710288871721", "data": { "name": "New Node", "text": "Select a node or edge and press backspace to remove it", }, "type": "Default" }, { "id": "randomnode_test123", "data": { "name": "Testing node", "text": "Hello there" }, "type": "Default" } ], "edges": [ { "id": "reactflow__edge-1-randomnode_1710288752186", "label": "greeted", "source": "1", "target": "randomnode_1710288752186" }, { "id": "reactflow__edge-1-randomnode_1710288871721", "label": "New Edge", "source": "1", "target": "randomnode_1710288871721" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Audit Logs Source: https://docs.bland.ai/api-v1/get/audit-logs GET https://api.bland.ai/v1/audit/logs Retrieve a paginated, filterable list of audit events for your organization. Designed for SIEM integration and compliance workflows. > [!WARNING] > > Audit logs are an enterprise feature and not yet available for all accounts. To enable audit logging for your organization, contact your Bland representative or [reach out to sales](https://www.bland.ai/book-a-demo). ## Overview Returns a time-ordered log of auditable actions taken within your organization — logins, logouts, pathway changes, knowledge base edits, and more. Results are scoped to your organization and require an **admin** or **owner** role. ### Supported event types | Event type | Description | | - | - | | `auth.sso_login` | User logged in via SSO | | `auth.logout` | User logged out | | `pathway.created` | Conversational pathway created | | `pathway.updated` | Pathway version updated | | `pathway.deleted` | Pathway deleted | | `pathway.published` | Pathway version published to an environment | | `kb.content_updated` | Knowledge base text/markdown content edited | | `kb.file_replaced` | Knowledge base source file replaced | | `kb.urls_replaced` | Knowledge base URLs replaced (web scrape) | | `kb.version_restored` | Knowledge base version restored | New event types are added over time. Filter by prefix (e.g. `auth.*`, `pathway.*`, `kb.*`) in your SIEM to group by category. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **event\_type** `string` Filter by exact event type (e.g. `pathway.created`, `auth.sso_login`). **actor\_id** `string` Filter by the user ID that performed the action. **created\_after** `string` ISO 8601 timestamp. Only return events created after this time. Example: `2025-01-01T00:00:00Z` **created\_before** `string` ISO 8601 timestamp. Only return events created before this time. Example: `2025-02-01T00:00:00Z` **page** `number` (default: 1) Page number (1-indexed). **page\_size** `number` (default: 50) Results per page. Min `1`, max `100`. ### Response **data** `object` **events** `array` Array of audit event objects, ordered by `created_at` descending (newest first). **id** `string` Unique identifier for the audit event. **org\_id** `string` The organization this event belongs to. **actor\_id** `string` The user ID that performed the action. **event\_type** `string` The type of event (see supported event types above). **resource\_type** `string | null` The type of resource affected (e.g. `convo_pathway`, `kb`). `null` for events like login/logout that don't target a specific resource. **resource\_id** `string | null` The ID of the affected resource. `null` when no specific resource is involved. **metadata** `object | null` Additional context about the event. Contents vary by event type — may include fields like `version_id`, `name`, `environment`, `filename`, `email`, etc. **created\_at** `string` ISO 8601 timestamp of when the event occurred. **total** `number` Total number of events matching the query. **total\_pages** `number` Total number of pages. **current\_page** `number` The current page number. **page\_size** `number` The number of results per page. **errors** `null` Always `null` on success. ```json theme={null} { "data": { "events": [ { "id": "00000000-0000-0000-0000-000000000001", "org_id": "00000000-0000-0000-0000-000000000100", "actor_id": "00000000-0000-0000-0000-000000000200", "event_type": "pathway.published", "resource_type": "convo_pathway", "resource_id": "00000000-0000-0000-0000-000000000300", "metadata": { "version_number": 3, "environment": "production" }, "created_at": "2025-01-15T14:32:00.000Z" }, { "id": "00000000-0000-0000-0000-000000000002", "org_id": "00000000-0000-0000-0000-000000000100", "actor_id": "00000000-0000-0000-0000-000000000200", "event_type": "auth.sso_login", "resource_type": null, "resource_id": null, "metadata": { "provider_id": "okta", "email": "user@example.com" }, "created_at": "2025-01-15T14:30:00.000Z" } ], "total": 2, "total_pages": 1, "current_page": 1, "page_size": 50 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Block Rules Source: https://docs.bland.ai/api-v1/get/blocked-numbers GET https://api.bland.ai/v1/blocked_numbers Retrieve block rules associated with your inbound numbers. > [!NOTE] > > **Block Rule Management** – This endpoint returns block rules for either all global blocks or a specific inbound number, depending on the query parameters. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **inbound\_number** `string` The E.164 formatted inbound number to filter results by. If omitted, returns only global block rules. **active\_only** `boolean` Whether to only return currently active block rules. Default is `true`. Set to `false` to include deleted or inactive rules. ### Response **data** `object` Returns a list of block rules that match the provided filters. **data.blocks** `array` Array of block rule objects. **data.total\_count** `number` The number of block rules returned by this request. **data.filters** `object` Echoes the filters used in the request (`inbound_number`, `active_only`). **errors** `null|array` `null` on success, or a list of error objects if validation fails. ```json Response theme={null} { "data": { "blocks": [ { "id": 456, "blocked_number": "+10000000000", "is_global": false, "inbound_number": "+19999999999", "org_id": "1a2b3c4d-5e6f-7a8b-9c0d-ef1234567890", "reason": null, "is_active": true, "created_at": "2025-01-01T00:00:00.000Z", "updated_at": "2025-01-01T00:00:00.000Z" } ], "total_count": 1, "filters": { "inbound_number": "+19999999999", "active_only": true } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Block Rule Source: https://docs.bland.ai/api-v1/get/blocked-numbers-id GET https://api.bland.ai/v1/blocked_numbers/{block_id} Retrieve the details of a specific block rule. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **block\_id** `number` *required* The unique ID of the block rule you wish to retrieve. ### Response **data** `object` The block rule object if found. **data.id** `number` The unique ID of the block rule. **data.blocked\_number** `string` The E.164 formatted phone number that is blocked. **data.is\_global** `boolean` Whether the block is applied globally across all inbound numbers. **data.inbound\_number** `string|null` The specific inbound number the block applies to (if not global). **data.org\_id** `string` The UUID of the organization that owns the rule. **data.reason** `string|null` An optional reason for the block. **data.is\_active** `boolean` Indicates whether the block is currently active. **data.created\_at** `string` ISO timestamp for when the rule was created. **data.updated\_at** `string` ISO timestamp for when the rule was last updated. **errors** `null|array` `null` on success, or a list of error objects if the block ID is invalid or not found. ```json Response theme={null} { "data": { "id": 123, "blocked_number": "+10000000000", "is_global": false, "inbound_number": "+18888888888", "org_id": "b7d3e9fc-5c4a-4c2a-9b8f-d1e1d1a2e333", "reason": null, "is_active": true, "created_at": "2025-01-01T00:00:00.000Z", "updated_at": "2025-01-01T00:00:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Calls Source: https://docs.bland.ai/api-v1/get/calls GET https://api.bland.ai/v1/calls Returns a set of metadata for each call dispatched by your account. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` Use your own Twilio account and only return inbound numbers associated with that account sid (optional). Learn more about BYOT [here](/tutorials/custom-twilio). ### Query Parameters **from\_number** `string` Filter calls by the number they were dispatched from. The number that initiated the call - the user's phone number for inbound calls, or the number your AI Agent called from for outbound calls. **to\_number** `string` Filter calls by the number they were dispatched to. The number that answered the call - the user's phone number for outbound calls, or your AI Agent's number for inbound calls. **from** `int` The starting index (inclusive) for the range of calls to retrieve. For example, from=0 starts at the very first call in the result set, while from=100 starts at the 101st call. **to** `int` The ending index for the range of calls to retrieve. This tells the API where to stop returning data. For example, from=150 and to=200 returns 50 results, starting from the 101st result and ending just before the 151st. **limit** `int` (default: 1000) The maximum number of calls to return in the response. **ascending** `boolean` (default: false) Whether to sort the calls in ascending order of their creation time. **sort\_by** `string` (default: created\_at) Field to sort the results by. Available options are `created_at` (default) and `updated_at`. **start\_date** `string` Get calls including and after a specific date. Accepts either a date (`YYYY-MM-DD`) or a full ISO 8601 datetime with timezone offset (e.g. `2026-02-19T00:00:00-05:00`). When using a date-only value, dates are interpreted as UTC unless the `timezone` parameter is provided. **end\_date** `string` Get calls including and before a specific date. Accepts either a date (`YYYY-MM-DD`) or a full ISO 8601 datetime with timezone offset (e.g. `2026-02-19T23:59:59-05:00`). When using a date-only value, dates are interpreted as UTC unless the `timezone` parameter is provided. **created\_at** `string` Get calls for a specific date. Can't be used with `end_date` or `start_date`. Format: `YYYY-MM-DD`. Dates are interpreted as UTC unless the `timezone` parameter is provided. **timezone** `string` IANA timezone name (e.g. `America/Toronto`, `America/Los_Angeles`, `UTC`). When provided, date-only values in `start_date`, `end_date`, and `created_at` are interpreted in this timezone instead of UTC. This ensures calls are attributed to the correct local calendar day. Has no effect on `start_date`/`end_date` values that include a timezone offset (e.g. ISO 8601 datetimes), since those already encode timezone information. **update\_start\_date** `string` Get calls updated including and after a specific date. Format: YYYY-MM-DD **update\_end\_date** `string` Get calls updated including and before a specific date. Format: YYYY-MM-DD **completed** `boolean` Whether to filter calls by complete status. **batch\_id** `string` Get calls from a specific batch. **answered\_by** `string` Filter by answered\_by type. Example: human **inbound** `boolean` Whether to filter based on inbound or not. **duration\_gt** `float` Duration (Call Length) greater than the value provided. Example: 0.5 (This would be equal to half a minute) **duration\_lt** `float` Duration (Call Length) less than the value provided. Example: 0.5 (This would be equal to half a minute) **campaign\_id** `string` Get calls for a specific campaign id. **external\_id** `string` Get calls with a specific `external_id`. This is the ID you set when [sending the call](/api-v1/post/calls), or the inbound SIP header you flagged as the external ID in [`POST /v1/sip/attach`](/api-v1/post/sip-attach). ### Response **total\_count** `integer` The total number of calls that match the query filters. This number may be greater than the number of calls returned in the response. For example: * If you have 10,000 calls, and don't include any filters, the `total_count` will be 10,000. * If you have 10,000 calls and 9,000 of them match the query, the `total_count` will be 9,000 regardless of the number of calls returned in the response. **count** `integer` The number of calls returned in the response. **calls** `array` An array of call data objects. See the [Call](/api-v1/get/calls-id) section for details. Note: Individual call transcripts are not included due to their size. ```json Response theme={null} { "count": 784, "calls": [ { "call_id": "c1234567-89ab-cdef-0123-456789abcdef", "created_at": "2023-12-21T23:25:14.801193+00:00", "call_length": 0.834, // minutes "to": "5551234567", "from": "+15551234567", "completed": true, "queue_status": "complete", "error_message": null, "answered_by": "human", "batch_id": "b1234567-89ab-cdef-0123-gen-batch", }, //... Additional call objects ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get corrected transcripts Source: https://docs.bland.ai/api-v1/get/calls-corrected-transcript GET https://api.bland.ai/v1/calls/{call_id}/correct Get the corrected transcript from your call's recording. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **call\_id** `string` *required* The unique identifier for the call to be corrected. ### Response **status** `object` Will be `success` if the request was successful. **message** `string` Confirms the request was successful, or provides an error message if the request failed. **corrected** `array` This will contain an array of objects with enhanced speaker information and confidence scores. Each object will be constructed as the following. ```json theme={null} { "start": 0.069, // start time of the transcript "end": 2.551, // end time of the transcript "text": " Hi, I'm calling about a pizza order.", // the corrected text "speaker": 2, // the identified speaker diarization. Can be 1,2,3 etc "speaker_label": "assistant", // human-readable speaker label ("user", "assistant") "confidence": 0.762 // transcription confidence score (0-1) } ``` **aligned** `array` **⚠️ DEPRECATED**: The `aligned` field is deprecated and will be removed in a future version. Please use the enhanced `corrected` field instead, which now includes `speaker_label` and `confidence` information. Legacy description: This field provides a version of an 'aligned' transcript where the roles are matched to the pieces of text by vectorizing the text, taking the cosine similarity, and adding a predictive layer based off of the `wait_for_greeting` param. This will contain an array of objects. Each object will be constructed as the following. ```json theme={null} { "id": 3056004, "created_at": "2024-02-29T18:40:41.26799+00:00", "text": "Great, Thanks John. Could you tell me about the pizza order you placed?", // the corrected text "user": "assistant", // the presumed role "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, ``` ```json theme={null} { "corrected": [ { "start": 0.069, "end": 2.551, "text": " Hi, I'm calling about a pizza order.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.762 }, { "start": 2.551, "end": 4.932, "text": "Could I get your name, please?", "speaker": 2, "speaker_label": "assistant", "confidence": 0.843 }, { "start": 4.932, "end": 8.074, "text": "Yeah, my name is John.", "speaker": 1, "speaker_label": "user", "confidence": 0.654 }, { "start": 8.074, "end": 8.875, "text": "Great.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.892 }, { "start": 8.875, "end": 9.876, "text": "Thanks, John.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.765 }, { "start": 9.876, "end": 13.038, "text": "Could you tell me about the pizza order you placed?", "speaker": 2, "speaker_label": "assistant", "confidence": 0.934 }, { "start": 13.038, "end": 16.36, "text": "Yeah, I want a pepperoni.", "speaker": 1, "speaker_label": "user", "confidence": 0.567 }, { "start": 16.36, "end": 17.1, "text": "Oh, okay.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.456 }, { "start": 17.1, "end": 18.521, "text": "One pepperoni pizza.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.789 }, { "start": 18.521, "end": 19.682, "text": "Anything else with that order?", "speaker": 2, "speaker_label": "assistant", "confidence": 0.823 }, { "start": 19.682, "end": 23.665, "text": "No, actually, can we cancel it?", "speaker": 1, "speaker_label": "user", "confidence": 0.612 }, { "start": 23.665, "end": 26.306, "text": "I gotta go.", "speaker": 1, "speaker_label": "user", "confidence": 0.543 }, { "start": 26.306, "end": 27.427, "text": "No problem.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.734 }, { "start": 27.427, "end": 28.668, "text": "I'll cancel the order for you.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.856 }, { "start": 29.144, "end": 30.587, "text": " Thanks for letting me know.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.678 }, { "start": 30.587, "end": 31.189, "text": "Have a good one.", "speaker": 2, "speaker_label": "assistant", "confidence": 0.812 } ], "status": "success", "aligned": [ { "start": 0.069, "end": 2.551, "text": " Hi, I'm calling about a pizza order.", "speaker": "assistant", "similarity": 0.686406472983644 }, { "start": 2.551, "end": 4.932, "text": "Could I get your name, please?", "speaker": "assistant", "similarity": 0.6793662204867575 }, { "start": 4.932, "end": 8.074, "text": "Yeah, my name is John.", "speaker": "user", "similarity": 0.9999999999999998 }, { "start": 8.074, "end": 8.875, "text": "Great.", "speaker": "assistant", "similarity": 0.2581988897471611 }, { "start": 8.875, "end": 9.876, "text": "Thanks, John.", "speaker": "assistant", "similarity": 0.36514837167011066 }, { "start": 9.876, "end": 13.038, "text": "Could you tell me about the pizza order you placed?", "speaker": "assistant", "similarity": 0.894427190999916 }, { "start": 13.038, "end": 16.36, "text": "Yeah, I want a pepperoni.", "speaker": "user", "similarity": 0.7999999999999998 }, { "start": 16.36, "end": 17.1, "text": "Oh, okay.", "speaker": "user", "similarity": 0.4999999999999999 }, { "start": 17.1, "end": 18.521, "text": "One pepperoni pizza.", "speaker": "assistant", "similarity": 0.5773502691896257 }, { "start": 18.521, "end": 19.682, "text": "Anything else with that order?", "speaker": "assistant", "similarity": 0.7453559924999299 }, { "start": 19.682, "end": 23.665, "text": "No, actually, can we cancel it?", "speaker": "user", "similarity": 0.8164965809277261 }, { "start": 23.665, "end": 26.306, "text": "I gotta go.", "speaker": "user", "similarity": 0.5773502691896257 }, { "start": 26.306, "end": 27.427, "text": "No problem.", "speaker": "assistant", "similarity": 0.32444284226152503 }, { "start": 27.427, "end": 28.668, "text": "I'll cancel the order for you.", "speaker": "assistant", "similarity": 0.5202659817144719 }, { "start": 29.144, "end": 30.587, "text": " Thanks for letting me know.", "speaker": "assistant", "similarity": 0.6155870112510924 }, { "start": 30.587, "end": 31.189, "text": "Have a good one.", "speaker": "agent-action", "similarity": 0.5 } ], "original": [ { "id": 3056032, "created_at": "2024-02-29T18:40:49.592012+00:00", "text": "Okay, One pepperoni pizza. Anything else with that order?", "user": "assistant", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056054, "created_at": "2024-02-29T18:40:59.641211+00:00", "text": "No problem, Ill cancel the order for you. Thanks for letting me know, Have a good one!", "user": "assistant", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3055999, "created_at": "2024-02-29T18:40:40.39336+00:00", "text": "Yeah. My name is John. ", "user": "user", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056064, "created_at": "2024-02-29T18:41:08.152963+00:00", "text": "Okay. Bye. ", "user": "user", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3055975, "created_at": "2024-02-29T18:40:33.362607+00:00", "text": "Hi, Im calling about a pizza order. Could I get your name please?", "user": "assistant", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056028, "created_at": "2024-02-29T18:40:48.597915+00:00", "text": "Yeah. I want the pepperoni. ", "user": "user", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056066, "created_at": "2024-02-29T18:41:09.563502+00:00", "text": "Ended call: Thanks, you too! Have a good day.", "user": "agent-action", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056004, "created_at": "2024-02-29T18:40:41.26799+00:00", "text": "Great, Thanks John. Could you tell me about the pizza order you placed?", "user": "assistant", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" }, { "id": 3056053, "created_at": "2024-02-29T18:40:58.62518+00:00", "text": "No. Actually, can we cancel it? I gotta go. ", "user": "user", "c_id": "bfaf99a1-b7c0-4f96-9630-90bc41cea488" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Call Details Source: https://docs.bland.ai/api-v1/get/calls-id GET https://api.bland.ai/v1/calls/{call_id} Retrieve detailed information, metadata and transcripts for a call. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` Use your own Twilio account and only return inbound numbers associated with that account sid (optional). Learn more about BYOT [here](/tutorials/custom-twilio). ### Path Parameters **call\_id** `string` *required* The unique identifier of the call for which you want to retrieve detailed information. You can also pass the call's `external_id` here instead. If several calls share the same `external_id`, Bland returns the most recent one. ### Query Parameters **fields** `string` A comma-separated list of response fields to return, such as `fields=status,summary,variables`. You can also repeat the parameter: `fields=status&fields=summary`. Use this when your integration can only accept a small payload, such as an IVR or contact center action node. Bland always includes `call_id`. Field names that don't exist in the response are omitted. A field name containing characters other than letters, numbers, or underscores returns a `400` error. By default, Bland returns all fields. ```bash theme={null} curl "https://api.bland.ai/v1/calls/crm-interaction-48213?fields=status,summary,variables" \ -H "authorization: " ``` ### Response **transcripts** `array of objects` An array of phrases spoken during the call. Each index includes: * `id` * `created_at` * `text` * `user` (can be `user`, `assistant`, `robot`, or `agent-action`) **call\_id** `number` The unique identifier for the call. **call\_length** `number` The length of the call in minutes. **transferred\_to** `string` Number that the person was transferred to. **transferred\_at** `string` The timestamp when the call was transferred to another number. **batch\_id** `string` If the call is part of a batch, it's `batch_id` will be here. **to** `string` The phone number that received the call. **from** `string` The phone number that made the call. **request\_data** `object` Details about parameters in the original api request. **completed** `boolean` Whether the call has been completed. If it differs from the value of 'queue\_status', this will be the most up-to-date status. **inbound** `boolean` Whether the call was inbound or outbound. Will be `false` for outbound calls. **created\_at** `string` The timestamp for when the call request was created. **started\_at** `string` The time the call was connected. **end\_at** `string` The time that the call will automatically be ended at if it's still connected (because of `max_duration`). **queue\_status** `string` The status of the call. During extremely high volume periods, calls may be queued for a short period of time before being dispatched. > [accordion] Statuses: > > Progresses through the following stages: > > * `new`: An API request has been received. > * `queued`: Call pararameters have been validated and authentication succeeded. > * `allocated`: Extremely brief, the call is being dispatched. > * `started`: The phone call is live and in progress. > * `complete`: The phone call has ended successfully. > > The following statuses show the point that was reached before an error: > > * `pre_queue_error`: An error occurred before the call was queued. Invalid parameters generally cause this. > * `queue_error`: Error occurred while the call was queued. Ex. Valid phone number but to an unserviced area. > * `call_error`: Error occurred during live call. May be caused by transferring to an invalid phone number or an unforeseen error. > * `complete_error`: Error occurred after the call was completed. Ex. A post-call webhook failed. > > If at any point an error occurs, it will be recorded in the `error_message` field. **endpoint\_url** `string` The url of the deployment that the call was handled on. Will always be "api.prod.bland.ai" unless the call was handled on a custom Enterprise deployment. **max\_duration** `number` The maximum length of time the call was allowed to last. If the call would exceed this length, it's ended early. **error\_message** `string` If an error occurs, this will contain a description of the error. Otherwise, it will be null. **variables** `object` Variables created during the call - both system variables as well as generated with `dynamic_data` or Custom Tools. For example, if you used a `dynamic_data` API request to generate a variable called `appointment_time`, you would see it here (both the agent's inputs and the response variables). **answered\_by** `string` This field contains one of the following values: * `human`: The call was answered by a human. * `voicemail`: The call was answered by an answering machine or voicemail. * `unknown`: There was not enough audio at the start of the call to make a determination. * `no-answer`: The call was not answered. * `null`: Not enabled, or still processing the result. Webhooks may take up to a minute to fire after the call ends while the call audio is processed. > [accordion] Notes: > > * Determinations are based on audio from the first five seconds of the phone call. > * `unknown` is most likely a human, especially if there are multiple transcripts. > * Optimize calls for accurate results by getting humans to respond in the first five seconds: > * Use with `wait_for_greeting` > * Use a short greeting in `first_sentence` such as "Hello?" or "Hi, is this \{\{name}}?" **record** `boolean` Whether the call audio was recorded. **recording\_url** `string` The URL of the recording of the call. Only available if `record` was set to `true` in the original API request. **external\_id** `string` Your own identifier for the call, set with `external_id` when sending the call or from a flagged inbound SIP header. `null` if not set. **metadata** `object` Metadata about the call. This can include information about the client, customer, or any other data you want to include. This is identical to the `metadata` that was set in the original API request to send the call. **summary** `string` A short summary of the call based off of the transcript that's generated when the call ends. **price** `number` The cost of the call in USD. **local\_dialing** `boolean` Whether Local Dialing was enabled for your account at the time of the call. **call\_ended\_by** `string` Whether the call was ended by Bland's system or the other end of the line. * `ASSISTANT`: The agent ended the call. * `USER`: The user ended the call. **pathway\_id** `string` The unique identifier for a conversational pathway. **pathway\_logs** `string` Pathways calls will have extra logs here that have much more detailed information about the chosen nodes and internal reasoning throughout the flow. **pathway\_version** `number` The version number of the pathway used for this call, if the call used a pathway. Returns `null` if no pathway was used for the call. **analysis** `object` The structured data extracted from the call during post-call analysis. **concatenated\_transcript** `string` A single string containing all of the text from the call. Excludes system messages and auto-generated data. **transcripts** `array of objects` An array of phrases spoken during the call. Each index includes: * `id` * `created_at` * `text` * `user` (can be `user`, `assistant`, `robot`, or `agent-action`) **status** `string` The status of the call. This is the most up-to-date status of the call, but is only present for calls that have been successfully created. > [accordion] Call Status Values > > **Possible status values:** > > * `completed` - Call was successfully completed, this can be both human or voicemail answered (see [answered\_by](/api-v1/get/calls-id#param-answered-by) for details on who the call was answered by) > * `failed` - Call failed to connect or complete (see `error_message` for details) > * `busy` - Called number was busy > * `no-answer` - Call was not answered > * `canceled` - Call was canceled before completion > * `unknown` - Status could not be determined > > **Common failure reasons and troubleshooting:** > > When `status` is `failed`, check the `error_message` field for specific details: > > * **"The number you dialed is not found."** > * The phone number is invalid or not in service > * Verify the phone number format and that it's currently active > * **"The number you dialed is temporarily unavailable."** > * Network issues or temporary service disruption > * Retry the call after a short delay > * **"The number you dialed is busy. Please try again later."** > * Called party is on another call without call waiting > * Try calling at a different time > * **"Service Provider Blocked Call due to Spam or Number Reputation. Try a different number."** > * Call blocked by carrier due to spam filtering > * Use a different `from` number or contact your carrier **corrected\_duration** `string` The corrected duration of the call in seconds. This is the actual length of the call, not the `max_duration`. **citations** `array of objects` Citations extracted from the transcript if a citation schema was attached to the call. You can build a citation schema [here](https://app.bland.ai/dashboard/analytics?tab=citations). > Note: Citation schemas are very powerful and accurate, but also are more resource intensive to run. As such, for the time being, they are an enterprise-only feature. **warm\_transfer\_call** `object` Information about warm transfer calls if the call was part of a warm transfer. Contains details about proxy agent calls and transfer state. **Structure** * `proxy_agent_calls`: Array of proxy agent call objects, each containing: * `state`: The state of the proxy agent call (`STARTED`, `TIMED_OUT`, `CANCELLED`, `MERGED`, `NO_ANSWER`) * `call_id`: The unique identifier of the proxy agent call * `phone_number`: The phone number used for the proxy agent call * `state`: The overall state of the warm transfer (`STARTED`, `TIMED_OUT`, `CANCELLED`, `MERGED`, `NO_ANSWER`) **is\_proxy\_agent\_call** `boolean` Whether this call is a proxy agent call (part of a warm transfer process). Returns `true` if this call was created as part of a warm transfer to connect with an agent, `false` otherwise. **is\_canary** `boolean` Whether the call ran through a canary deployment. Returns `true` if the call was routed through a canary deployment, `false` for production, and `null` if the deployment could not be determined. Use this to programmatically distinguish canary traffic from production when ingesting call data. **voice\_id** `string` The unique identifier of the voice used by the agent during the call. ```json Response theme={null} { "call_id": "12345678-1234-1234-1234-123456789012", "call_length": 0.75, "batch_id": null, "external_id": null, "to": "+12223334444", "from": "+17163511654", "request_data": { "phone_number": "+12223334444", "wait": true, "language": "ENG" }, "completed": true, "created_at": "2024-04-27T23:51:18.025251+00:00", "inbound": false, "queue_status": "completed", "endpoint_url": "api.prod.bland.ai", "max_duration": 30, "error_message": null, "variables": { "now": "Sat Apr 27 2024 18:51:25 GMT-0500 (Central Daylight Time)", "now_utc": "Sat, 27 Apr 2024 23:51:25 GMT", "short_from": "7163511654", "short_to": "2223334444", "from": "+17163511654", "to": "+12223334444", "call_id": "12345678-1234-1234-1234-123456789012", "phone_number": "+12223334444", "city": "SAN FRANCISCO", "country": "US", "state": "CA", "zip": "12345", "input": { "date": "2024-04-28", "rooms": 3 } }, "answered_by": "human", "record": false, "recording_url": null, "c_id": "12345678-1234-1234-1234-123456789012", "metadata": {}, "summary": "The call was a conversation between a hotel booking service assistant and a customer. The customer expressed interest in booking a hotel room for tomorrow and needing three rooms. The assistant booked book the reservation for three rooms for the next day. Then, the call ended with the assistant thanking the customer for choosing their service.", "price": 0.068, "started_at": "2024-04-27T23:51:25+00:00", "local_dialing": false, "call_ended_by": "ASSISTANT", "pathway_id": "b1693602-c05e-4b5c-b187-d0189a42aebf", "pathway_logs": null, "pathway_version": 1, "analysis": null, "concatenated_transcript": "user: Hello? \n assistant: Hi there! I'm calling from the hotel booking service. I'd love to help you with your reservation. Could you let me know what day you'd like to book your hotel for and how many rooms you'll need? \n user: Hopefully, tomorrow, I'm thinking. ...", "transcripts": [ { "id": 7395694, "created_at": "2024-04-27T23:51:28.568385+00:00", "text": "Hello?", "user": "user", "c_id": "12345678-1234-1234-1234-123456789012", "status": null, "transcript_id": null }, { "id": 7395698, "created_at": "2024-04-27T23:51:30.689815+00:00", "text": "Hi there! I'm calling from the hotel booking service. I'd love to help you with your reservation. Could you let me know what day you'd like to book your hotel for and how many rooms you'll need?", "user": "assistant", "c_id": "12345678-1234-1234-1234-123456789012", "status": null, "transcript_id": "12345678-1234-1234-1234-123456789014" }, //... ], "status": "completed", "corrected_duration": "45", "end_at": "2024-04-27T23:52:10.000Z", "voice_id": "745fbef5-f445-44fa-91ba-93f89803e1ce", "warm_transfer_call": { "proxy_agent_calls": [ { "state": "MERGED", "call_id": "12345678-1234-1234-1234-123456789013", "phone_number": "+14158589038" } ], "state": "MERGED" }, "is_proxy_agent_call": false, "is_canary": false } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Call Recording Source: https://docs.bland.ai/api-v1/get/calls-id-recording GET https://api.bland.ai/v1/recordings/{call_id} Retrieve an audio stream for a call recording. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` Audio content type requested: `"audio/mpeg"` (MP3) or `"audio/wav"` (WAV). Defaults to WAV. ### Path Parameters **call\_id** `string` *required* The unique identifier of the call for which you want to retrieve its recording. ### Query Parameters **...** `any` Any additional query parameters will be passed through to the underlying recording URL. ### Response **data** `audio stream` The audio recording stream of the call, in the requested or default format (WAV). **errors** `null|array` `null` on success, or an array of error objects if access fails. ```json Response (not found) theme={null} { "data": null, "errors": [ { "error": "CALL_RECORDING_NOT_FOUND", "message": "Call recording not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Citation Schema Source: https://docs.bland.ai/api-v1/get/citation-schemas-id GET https://api.bland.ai/v1/citation_schemas/ Retrieve a specific citation schema by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **id** `string` *required* The unique identifier of the citation schema to retrieve. ### Response **status** `integer` HTTP status code (200 for success). **data** `object` The citation schema object. **id** `string` The unique identifier for the citation schema (UUID format). **name** `string` The name of the citation schema. **description** `string` The description of the citation schema. **org\_id** `string` The organization ID that owns this schema. **schema** `object` The JSON schema configuration containing variables, groupings, and conditions for citation extraction. **created\_at** `string` The timestamp when the citation schema was created (ISO 8601 format). **errors** `null` Will be null for successful requests. ### Error Responses **400 Bad Request** Returned when the schema ID parameter is missing. **404 Not Found** Returned when the specified citation schema is not found or doesn't belong to your organization. ```json Response theme={null} { "status": 200, "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Customer Information Extraction", "description": "Extracts customer demographics and contact information from call transcripts", "org_id": "6ba7b811-9dad-11d1-80b4-00c04fd430c8", "schema": { "variables": [ { "name": "Customer Name", "description": "The full name of the customer", "type": "string" }, { "name": "Customer Age", "description": "The age of the customer in years", "type": "number" }, { "name": "Interested in Product", "description": "Whether the customer expressed interest in the product", "type": "boolean" } ], "groupings": [ { "name": "Demographics", "variables": ["Customer Name", "Customer Age"] } ], "conditions": [ { "condition": { "value": "true", "operator": "===", "variable": "Interested in Product" }, "variables": [ { "name": "Product Interest Details", "type": "string", "description": "Specific details about which product features interest the customer" } ] } ] }, "created_at": "2023-12-15T14:30:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Citation Schemas Source: https://docs.bland.ai/api-v1/get/citation-schemas-list GET https://api.bland.ai/v1/citation_schemas/list Retrieve all citation schemas for your organization, including each schema's variables, groupings, and conditions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `integer` HTTP status code (200 for success). **data** `array` An array of citation schema objects. **id** `string` The unique identifier for the citation schema (UUID format). **name** `string` The name of the citation schema. **description** `string` The description of the citation schema. **schema** `object` The JSON schema configuration containing variables, groupings, and conditions for citation extraction. Returned inline so you can enumerate fields without a follow-up request per schema. **created\_at** `string` The timestamp when the citation schema was created (ISO 8601 format). **errors** `null` Will be null for successful requests. ```json Response theme={null} { "status": 200, "data": [ { "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "name": "Customer Information Extraction", "description": "Extracts customer demographics and contact information from call transcripts", "schema": { "variables": [ { "name": "Customer Name", "description": "The full name of the customer", "type": "string" }, { "name": "Customer Age", "description": "The age of the customer in years", "type": "number" } ], "groupings": [ { "name": "Demographics", "variables": ["Customer Name", "Customer Age"] } ], "conditions": [] }, "created_at": "2023-12-15T14:30:00.000Z" }, { "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "name": "Lead Qualification Schema", "description": "Identifies qualified leads and their interest levels", "schema": { "variables": [ { "name": "Qualified Lead", "description": "Whether the caller meets qualification criteria", "type": "boolean" } ], "groupings": [], "conditions": [] }, "created_at": "2023-12-10T09:15:30.000Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Contacts Source: https://docs.bland.ai/api-v1/get/contacts GET https://api.bland.ai/v1/contacts List all contacts for your organization. Each contact includes identifiers, contact_memories (per persona/agent), and memory entities. Paginated. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **limit** `integer` Maximum number of contacts to return. Default 50, max 200. **offset** `integer` Number of contacts to skip (for pagination). Default 0. ### Response **data** `array` Array of contact objects. Each includes identifiers, memories (with entities). **pagination** `object` Pagination metadata (total, limit, offset, has\_more). **pagination.total** `integer` Total number of contacts in the org. **pagination.limit** `integer` Limit used for this request. **pagination.offset** `integer` Offset used for this request. **pagination.has\_more** `boolean` Whether more contacts exist after this page. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "Sarah Chen", "metadata": { "source": "inbound_call" }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-23T09:15:00.000Z", "identifiers": [ { "id": "ident-aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "identifier_type": "phone_number", "identifier_value": "+14155550192", "is_primary": true } ], "memories": [ { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer called about order #8821 which was delayed. Follow-up SMS confirmed the order shipped and is now in transit. Expected delivery July 25.", "facts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "sms", "timezone": "America/Los_Angeles" }, "recent_messages": [ { "role": "user", "content": "Has my order shipped yet?", "channel": "sms", "timestamp": "2025-07-23T09:10:00.000Z" }, { "role": "assistant", "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.", "channel": "sms", "timestamp": "2025-07-23T09:10:05.000Z" } ], "open_items": [ { "type": "follow_up", "description": "Confirm delivery of order #8821 on July 25", "created_at": "2025-07-23T09:10:00.000Z", "priority": "medium", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ], "entities": [ { "entity_type": "order", "entity_id": "order-8821", "facts": { "order_number": "#8821", "status": "in_transit", "carrier": "UPS", "expected_delivery": "2025-07-25" }, "status": "in_transit", "last_discussed_at": "2025-07-23T09:10:00.000Z", "notes": null } ] } ] } ], "pagination": { "total": 100, "limit": 50, "offset": 0, "has_more": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Find Contact Source: https://docs.bland.ai/api-v1/get/contacts-find POST https://api.bland.ai/v1/contacts/find Find a contact by phone number, email, or external ID. Returns the contact with all identifiers, contact_memories (per persona/agent), and memory entities. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **phone\_number** `string` Phone number to search for. At least one identifier is required. **email** `string` Email address to search for. At least one identifier is required. **external\_id** `string` External ID to search for. At least one identifier is required. ### Response Returns the contact with related data, or `null` if not found. **data** `object` The contact object with identifiers, memories, and entities. Null if no contact found. **data.id** `string` Unique identifier for the contact. **data.org\_id** `string` Organization ID the contact belongs to. **data.name** `string` Contact's name (if set). **data.metadata** `object` Custom metadata associated with the contact. **data.identifiers** `array` Contact identifiers (phone\_number, email, external\_id) for this contact. **data.memories** `array` Contact memory objects, one per persona or agent. Each includes summary, facts, recent\_messages, open\_items, and entities (memory\_entity records). **data.memories\[].entities** `array` Entity-scoped facts (e.g. bookings, orders) for that memory. **errors** `null` Error array (null on success). ```json Response (found) theme={null} { "data": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "Sarah Chen", "metadata": { "source": "inbound_call" }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-23T09:15:00.000Z", "identifiers": [ { "id": "ident-aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "identifier_type": "phone_number", "identifier_value": "+14155550192", "is_primary": true } ], "memories": [ { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer called about order #8821 which was delayed. Follow-up SMS confirmed the order shipped and is now in transit. Expected delivery July 25.", "facts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "sms", "timezone": "America/Los_Angeles" }, "recent_messages": [ { "role": "user", "content": "Has my order shipped yet?", "channel": "sms", "timestamp": "2025-07-23T09:10:00.000Z" }, { "role": "assistant", "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.", "channel": "sms", "timestamp": "2025-07-23T09:10:05.000Z" } ], "open_items": [ { "type": "follow_up", "description": "Confirm delivery of order #8821 on July 25", "created_at": "2025-07-23T09:10:00.000Z", "priority": "medium", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ], "entities": [ { "entity_type": "order", "entity_id": "order-8821", "facts": { "order_number": "#8821", "status": "in_transit", "carrier": "UPS", "expected_delivery": "2025-07-25" }, "status": "in_transit", "last_discussed_at": "2025-07-23T09:10:00.000Z", "notes": null } ] } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "At least one identifier (phone_number, email, or external_id) is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Contact Source: https://docs.bland.ai/api-v1/get/contacts-id GET https://api.bland.ai/v1/contacts/{contact_id} Retrieve a contact by its unique ID, including all identifiers, contact_memories (per persona/agent), and memory entities. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **contact\_id** `string` *required* The unique identifier of the contact. ### Response **data** `object` The contact object with identifiers, memories, and entities. **data.id** `string` Unique identifier for the contact. **data.org\_id** `string` Organization ID the contact belongs to. **data.name** `string` Contact's name (if set). **data.metadata** `object` Custom metadata associated with the contact. **data.identifiers** `array` Contact identifiers (phone\_number, email, external\_id) for this contact. **data.memories** `array` Contact memory objects, one per persona or agent. Each includes summary, facts, recent\_messages, open\_items, and entities (memory\_entity records). **data.memories\[].entities** `array` Entity-scoped facts (e.g. bookings, orders) for that memory. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "Sarah Chen", "metadata": { "source": "inbound_call" }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-23T09:15:00.000Z", "identifiers": [ { "id": "ident-aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "identifier_type": "phone_number", "identifier_value": "+14155550192", "is_primary": true } ], "memories": [ { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer called about order #8821 which was delayed. Follow-up SMS confirmed the order shipped and is now in transit. Expected delivery July 25.", "facts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "sms", "timezone": "America/Los_Angeles" }, "recent_messages": [ { "role": "user", "content": "Has my order shipped yet?", "channel": "sms", "timestamp": "2025-07-23T09:10:00.000Z" }, { "role": "assistant", "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.", "channel": "sms", "timestamp": "2025-07-23T09:10:05.000Z" } ], "open_items": [ { "type": "follow_up", "description": "Confirm delivery of order #8821 on July 25", "created_at": "2025-07-23T09:10:00.000Z", "priority": "medium", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ], "entities": [ { "entity_type": "order", "entity_id": "order-8821", "facts": { "order_number": "#8821", "status": "in_transit", "carrier": "UPS", "expected_delivery": "2025-07-25" }, "status": "in_transit", "last_discussed_at": "2025-07-23T09:10:00.000Z", "notes": null } ] } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Contact not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Custom Dialing Pool Source: https://docs.bland.ai/api-v1/get/custom-dialing-pool GET https://us.api.bland.ai/v1/custom-dialing-pools/{pool_id} Retrieve a specific custom dialing pool by its ID. > [!NOTE] > > **Enterprise Feature** - Custom dialing is only available on Enterprise plans. Contact your Bland representative for access. Retrieve details for a specific custom dialing pool using its unique identifier. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pool\_id** `string` *required* The unique identifier of the custom dialing pool to retrieve. **Format**: UUID format (e.g., `550e8400-e29b-41d4-a716-446655440000`) ### Response **status** `string` Can be `success` or `error`. **data** `object` The custom dialing pool object (present only if status is `success`). **data properties** **id** `string` Unique identifier for the pool. **owner\_id** `string` Organization ID that owns this pool. **phone\_numbers** `array` Array of phone numbers in the pool. **encrypted\_key** `string` UUID of associated Twilio credentials (or null if none). **created\_at** `string` Timestamp when the pool was created. **errors** `array` Array of error objects (present only if status is `error`). **error object properties** **error** `string` Error code indicating the type of error. **message** `string` Human-readable error message. ```bash cURL theme={null} curl -X GET "https://us.api.bland.ai/v1/custom-dialing-pools/550e8400-e29b-41d4-a716-446655440001" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```javascript JavaScript theme={null} const poolId = '550e8400-e29b-41d4-a716-446655440001'; const response = await fetch(`https://us.api.bland.ai/v1/custom-dialing-pools/${poolId}`, { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY', } }); const data = await response.json(); console.log(data); ``` ```python Python theme={null} import requests pool_id = "550e8400-e29b-41d4-a716-446655440001" url = f"https://us.api.bland.ai/v1/custom-dialing-pools/{pool_id}" headers = { "Authorization": "Bearer YOUR_API_KEY" } response = requests.get(url, headers=headers) print(response.json()) ``` ```json Success Response theme={null} { "status": "success", "data": { "id": "550e8400-e29b-41d4-a716-446655440001", "owner_id": "550e8400-e29b-41d4-a716-446655440002", "phone_numbers": ["+12345678901", "+19876543210", "+15551234567"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2024-01-15T10:30:00Z" }, "errors": null } ``` ```json Error Response - Pool Not Found theme={null} { "status": "error", "data": null, "errors": [ { "error": "POOL_NOT_FOUND", "message": "Geospatial dialing pool not found" } ] } ``` ```json Error Response - Invalid Pool ID theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_POOL_ID", "message": "Pool ID must be a valid UUID" } ] } ``` ```json Error Response - Unauthorized theme={null} { "status": "error", "data": null, "errors": [ { "error": "UNAUTHORIZED", "message": "Invalid API key or insufficient permissions" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Custom Dialing Pools Source: https://docs.bland.ai/api-v1/get/custom-dialing-pools GET https://us.api.bland.ai/v1/custom-dialing-pools Retrieve all custom dialing pools for your organization. > [!NOTE] > > **Enterprise Feature** - Custom dialing is only available on Enterprise plans. Retrieve a list of all custom dialing pools that belong to your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `string` Can be `success` or `error`. **data** `array` Array of custom dialing pool objects (present only if status is `success`). **pool object properties** **id** `string` Unique identifier for the pool. **owner\_id** `string` Organization ID that owns this pool. **phone\_numbers** `array` Array of phone numbers in the pool. **encrypted\_key** `string` UUID of associated Twilio credentials (or null if none). **created\_at** `string` Timestamp when the pool was created. **errors** `array` Array of error objects (present only if status is `error`). **error object properties** **error** `string` Error code indicating the type of error. **message** `string` Human-readable error message. ```bash cURL theme={null} curl -X GET "https://us.api.bland.ai/v1/custom-dialing-pools" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```javascript JavaScript theme={null} const response = await fetch('https://us.api.bland.ai/v1/custom-dialing-pools', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_API_KEY', } }); const data = await response.json(); console.log(data); ``` ```python Python theme={null} import requests url = "https://us.api.bland.ai/v1/custom-dialing-pools" headers = { "Authorization": "Bearer YOUR_API_KEY" } response = requests.get(url, headers=headers) print(response.json()) ``` ```json Success Response theme={null} { "status": "success", "data": [ { "id": "550e8400-e29b-41d4-a716-446655440001", "owner_id": "550e8400-e29b-41d4-a716-446655440002", "phone_numbers": ["+12345678901", "+19876543210", "+15551234567"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2024-01-15T10:30:00Z" }, { "id": "550e8400-e29b-41d4-a716-446655440003", "owner_id": "550e8400-e29b-41d4-a716-446655440002", "phone_numbers": ["+13105551234", "+19175555678"], "encrypted_key": null, "created_at": "2024-01-16T14:45:00Z" } ], "errors": null } ``` ```json Empty Response theme={null} { "status": "success", "data": [], "errors": null } ``` ```json Error Response theme={null} { "status": "error", "data": null, "errors": [ { "error": "UNAUTHORIZED", "message": "Invalid API key or insufficient permissions" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Outcomes Source: https://docs.bland.ai/api-v1/get/dispositions GET https://api.bland.ai/v1/dispositions List your organization's outcomes. Returns your outcomes, newest first. Deleted outcomes aren't included. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **page** `integer` (default: 1) The page to return, starting at 1. **limit** `integer` (default: 20) Outcomes per page, from 1 to 100. ### Response **data.dispositions** `array` The outcomes on this page. Each has the same fields as [Create Outcome](/api-v1/post/dispositions) returns. **data.pagination** `object` **Pagination fields** **page** `integer` The current page. **limit** `integer` Outcomes per page. **total** `integer` Total outcomes across all pages. **total\_pages** `integer` Total number of pages. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "dispositions": [ { "id": "e5773eb4-ddec-46c2-81b4-56ab34095d9f", "org_id": "3a1b45fc-b41e-47f0-9c6c-cbafc9670edf", "name": "appointment_outcome", "metadata": {}, "snippet_id": "0f4a6ee9-c5b6-43eb-a9fb-4aa57f741372", "snippet_version": 3, "created_at": "2026-10-20T18:22:05.117Z", "updated_at": "2026-10-24T09:41:30.902Z" } ], "pagination": { "page": 1, "limit": 20, "total": 1, "total_pages": 1 } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Outcome Source: https://docs.bland.ai/api-v1/get/dispositions-id GET https://api.bland.ai/v1/dispositions/{id} Get an outcome and its current script. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. ### Response **data** `object` The outcome. It has the same fields as [Create Outcome](/api-v1/post/dispositions) returns, plus `script`. **Additional field** **script** `string | null` The JavaScript source for the current `snippet_version`. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "id": "23d7feb5-1714-4b8c-8e20-d3dd27d7984b", "org_id": "395cc8d5-8751-4117-8151-55eef13c407d", "name": "appointment_outcome", "metadata": {}, "snippet_id": "d6a822c3-85a6-455d-ba67-9a7b2381f72f", "snippet_version": 3, "created_at": "2026-10-20T18:22:05.117Z", "updated_at": "2026-10-24T09:41:30.902Z", "script": "export default {\n async fetch(request) {\n const call = await request.json();\n return Response.json({ minutes: call.call_length });\n },\n};" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Outcome Runs Source: https://docs.bland.ai/api-v1/get/dispositions-id-run GET https://api.bland.ai/v1/dispositions/{id}/run List the saved runs of an outcome. Returns the outcome's runs, newest first. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. ### Query Parameters **page** `integer` (default: 1) The page to return, starting at 1. **limit** `integer` (default: 20) Runs per page, from 1 to 100. ### Response **data.runs** `array` The runs on this page. Each has the same fields as [Get Outcome Run](/api-v1/get/dispositions-id-run-run-id) returns. **data.pagination** `object` **Pagination fields** **page** `integer` The current page. **limit** `integer` Runs per page. **total** `integer` Total runs across all pages. **total\_pages** `integer` Total number of pages. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "runs": [ { "id": "80a9cfa5-8af1-46a3-ae4d-64dffb08daf5", "org_id": "9bce53cb-ce8d-4fd1-a2ba-6333ffbcc13e", "disposition_id": "66505ae6-3416-4f0d-af53-bdd322a0aecb", "conversation_id": "fbd83eea-fff1-44a2-b520-9c21e70bdc8d", "reference_type": "CALL", "snippet_version": 3, "status": "COMPLETE", "result": { "booked": true, "minutes": 2.4 }, "console": { "logs": [], "truncated": false }, "error": null, "exec_time": 41, "input": { "call_id": "fbd83eea-fff1-44a2-b520-9c21e70bdc8d", "call_length": 2.4 }, "created_at": "2026-10-26T15:20:03.512Z", "finished_at": "2026-10-26T15:20:03.561Z" } ], "pagination": { "page": 1, "limit": 20, "total": 1, "total_pages": 1 } }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Outcome Run Source: https://docs.bland.ai/api-v1/get/dispositions-id-run-run-id GET https://api.bland.ai/v1/dispositions/{id}/run/{run_id} Get one saved run of an outcome. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. **run\_id** `string` *required* The run ID, from [List Outcome Runs](/api-v1/get/dispositions-id-run). ### Response **data** `object` The run. **Run fields** **id** `string` The run ID. **org\_id** `string` The organization that owns the run. **disposition\_id** `string` The outcome that ran. **conversation\_id** `string` The call or SMS conversation the outcome ran on. **reference\_type** `string` `CALL`, `SMS` or `CALL_TEST`. **snippet\_version** `integer | null` The script version that ran. **status** `string` `PENDING`, `COMPLETE` or `FAILED`. **result** `any` What the script returned. `null` until the run completes, and on a failed run. **console** `object | null` What the script logged: `logs` holds the console output and `truncated` says whether it was cut short. `null` when nothing was captured. **error** `string | null` Why the run failed. `null` when it succeeded. **exec\_time** `integer | null` How long the script ran, in milliseconds. **input** `object | null` The conversation data the script received. **created\_at** `string` When the run started (ISO 8601). **finished\_at** `string | null` When the run finished (ISO 8601). **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "id": "4ded1ecc-78e0-4b90-b3a3-d817615a553a", "org_id": "abde3bdf-89e5-48e2-838a-800121f7bb9c", "disposition_id": "9e419d19-a599-45a9-9d18-7bede9bd11aa", "conversation_id": "58c7606b-0f77-44ea-a35d-ee6e6c93dc85", "reference_type": "CALL", "snippet_version": 3, "status": "COMPLETE", "result": { "booked": true, "minutes": 2.4 }, "console": { "logs": [], "truncated": false }, "error": null, "exec_time": 41, "input": { "call_id": "58c7606b-0f77-44ea-a35d-ee6e6c93dc85", "call_length": 2.4 }, "created_at": "2026-10-26T15:20:03.512Z", "finished_at": "2026-10-26T15:20:03.561Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Eval Agent Templates Source: https://docs.bland.ai/api-v1/get/evals-agent-templates GET https://api.bland.ai/v1/evals/agent-templates List the read-only library of shipped eval agent templates. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **object** `string` Always `list`. **data** `array` Array of eval agent template objects. **template object** **key** `string` Unique identifier key for the template, for example `hallucination_detection`. **name** `string` Human-readable display name. **description** `string` Brief description of what the template evaluates. **category** `string` Template category. One of `voice`, `sales`, `support`, `scheduling`, `compliance`, or `quality`. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` The system prompt used for this eval agent, in Markdown. **prompt\_md** `string` The evaluation prompt, in Markdown. **levels** `array` Ordered scoring levels for this template. **level object** **level\_key** `string` Short identifier for the level, 1-64 characters. **label** `string` Display label for the level, 1-80 characters. **prompt\_md** `string` Prompt describing this level's criteria, in Markdown. **color** `string` Optional display color. One of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold for this template. **has\_more** `boolean` Always `false`. This endpoint returns the full library in a single page. **next\_cursor** `string` Always `null` for this endpoint. ```json Response theme={null} { "data": { "object": "list", "data": [ { "key": "hallucination_detection", "name": "Hallucination Detection", "description": "Detects factual inaccuracies or fabricated information in agent responses.", "category": "quality", "modality": "text", "system_prompt_md": "You are an expert evaluator assessing whether an AI agent fabricated information.", "prompt_md": "Review the conversation and determine whether the agent stated anything that was factually incorrect or unsupported.", "levels": [ { "level_key": "no_hallucination", "label": "No Hallucination", "prompt_md": "The agent made no factually incorrect or unsupported claims.", "color": "emerald" }, { "level_key": "minor_hallucination", "label": "Minor Hallucination", "prompt_md": "The agent made one or more small inaccuracies that did not materially mislead the user.", "color": "amber" } ], "target_level_keys": ["no_hallucination"] }, { "key": "call_resolution", "name": "Call Resolution", "description": "Assesses whether the agent successfully resolved the caller's issue.", "category": "support", "modality": "audio", "system_prompt_md": "You are an expert evaluator assessing call resolution quality.", "prompt_md": "Did the agent fully resolve the caller's stated issue before ending the call?", "levels": [ { "level_key": "resolved", "label": "Resolved", "prompt_md": "The caller's issue was fully addressed.", "color": "emerald" }, { "level_key": "unresolved", "label": "Unresolved", "prompt_md": "The caller's issue was not addressed or was left open.", "color": "rose" } ], "target_level_keys": ["resolved"] } ], "has_more": false, "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Eval Agent Template Source: https://docs.bland.ai/api-v1/get/evals-agent-templates-key GET https://api.bland.ai/v1/evals/agent-templates/{template_key} Fetch a single shipped eval agent template by its key. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **template\_key** `string` *required* The template's key, for example `hallucination_detection`. ### Response **key** `string` Unique identifier key for the template. **name** `string` Human-readable display name. **description** `string` Brief description of what the template evaluates. **category** `string` Template category. One of `voice`, `sales`, `support`, `scheduling`, `compliance`, or `quality`. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` The system prompt used for this eval agent, in Markdown. **prompt\_md** `string` The evaluation prompt, in Markdown. **levels** `array` Ordered scoring levels for this template. **level object** **level\_key** `string` Short identifier for the level, 1-64 characters. **label** `string` Display label for the level, 1-80 characters. **prompt\_md** `string` Prompt describing this level's criteria, in Markdown. **color** `string` Optional display color. One of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold for this template. Returns `404` with code `EVAL_AGENT_TEMPLATE_NOT_FOUND` if the key does not match any shipped template. ```json Response theme={null} { "data": { "key": "hallucination_detection", "name": "Hallucination Detection", "description": "Detects factual inaccuracies or fabricated information in agent responses.", "category": "quality", "modality": "text", "system_prompt_md": "You are an expert evaluator assessing whether an AI agent fabricated information.", "prompt_md": "Review the conversation and determine whether the agent stated anything that was factually incorrect or unsupported.", "levels": [ { "level_key": "no_hallucination", "label": "No Hallucination", "prompt_md": "The agent made no factually incorrect or unsupported claims.", "color": "emerald" }, { "level_key": "minor_hallucination", "label": "Minor Hallucination", "prompt_md": "The agent made one or more small inaccuracies that did not materially mislead the user.", "color": "amber" }, { "level_key": "major_hallucination", "label": "Major Hallucination", "prompt_md": "The agent stated clearly false or fabricated information that could mislead the user.", "color": "rose" } ], "target_level_keys": ["no_hallucination"] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Eval Agents Source: https://docs.bland.ai/api-v1/get/evals-agents GET https://api.bland.ai/v1/evals/agents List the eval agents in your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of eval agents. Each item contains the fields below. **data\[].id** `string` Unique identifier for the eval agent. **data\[].name** `string` Display name of the eval agent. **data\[].description** `string | null` Optional description of what the eval agent grades. **data\[].current\_version\_id** `string` ID of the current editable draft version. **data\[].active\_version\_id** `string | null` ID of the published version experiments run against, or `null` if never published. **data\[].active\_version\_number** `integer | null` Version number of the published version, or `null` if never published. **data\[].enabled** `boolean` Whether the eval agent is enabled. **data\[].modality** `string` The modality of the eval agent. One of `text` or `audio`. **data\[].latest\_run** `object | null` Summary of the most recent run against this agent, or `null` if no runs exist. * `id` - Run ID. * `status` - Status of the run. * `created_at` - ISO 8601 timestamp. * `call_count` - Number of calls evaluated. * `target_hit_count` - Number of calls that hit a target level. * `graded_count` - Number of calls that received a grade. **data\[].metadata** `object` Key-value metadata associated with the eval agent. Values are strings. **data\[].created\_at** `string` ISO 8601 timestamp for when the eval agent was created. **data\[].updated\_at** `string` ISO 8601 timestamp for when the eval agent was last updated. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string | null` Cursor to pass as `starting_after` to fetch the next page, or `null` if there are no more results. ```json Response theme={null} { "errors": null, "data": { "object": "list", "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Empathy Check", "description": "Grades how empathetic the agent sounds during difficult conversations.", "current_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "active_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "active_version_number": 2, "enabled": true, "modality": "audio", "latest_run": { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "status": "completed", "created_at": "2026-05-20T14:00:00.000Z", "call_count": 120, "target_hit_count": 98, "graded_count": 120 }, "metadata": {}, "created_at": "2026-03-01T09:00:00.000Z", "updated_at": "2026-05-20T14:05:00.000Z" } ], "has_more": false, "next_cursor": null } } ``` # Get Eval Agent Source: https://docs.bland.ai/api-v1/get/evals-agents-id GET https://api.bland.ai/v1/evals/agents/{eval_agent_id} Fetch one eval agent and its current draft version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent. ### Response **data.agent** `object` The requested eval agent. **data.agent.id** `string` Unique identifier for the eval agent. **data.agent.org\_id** `string` ID of the organization that owns this eval agent. **data.agent.key** `string` Unique slug key for the eval agent within the organization. **data.agent.name** `string` Display name of the eval agent. **data.agent.description** `string | null` Optional description of what the eval agent grades. **data.agent.current\_version\_id** `string` ID of the current editable draft version. **data.agent.active\_version\_id** `string | null` ID of the published version experiments run against, or `null` if never published. **data.agent.metadata** `object` Key-value metadata associated with the eval agent. Values are strings. **data.agent.created\_at** `string` ISO 8601 timestamp for when the eval agent was created. **data.agent.updated\_at** `string` ISO 8601 timestamp for when the eval agent was last updated. **data.agent.deleted\_at** `string | null` ISO 8601 timestamp if the eval agent has been soft-deleted, otherwise `null`. **data.current\_version** `object` The current editable draft version of the eval agent. **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.eval\_agent\_id** `string` ID of the parent eval agent. **data.current\_version.version\_number** `integer` Sequential version number. **data.current\_version.name** `string` Name of this version. **data.current\_version.description** `string | null` Optional description of this version. **data.current\_version.state** `string` State of this version. One of `editable` or `archived`. **data.current\_version.modality** `string` One of `text` or `audio`. **data.current\_version.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.current\_version.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.current\_version.levels** `array of objects` Verdict levels for graded mode. Empty array for pass/fail mode. Each level contains `level_key`, `label`, `prompt_md`, and optionally `color`. **data.current\_version.target\_level\_keys** `array of strings` Which level keys count as a target match. Empty array for pass/fail agents. **data.current\_version.weight** `number` Relative weight of this agent in aggregate scoring. Between 0 and 100. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if this is the first version. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "agent": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "key": "empathy-check", "name": "Empathy Check", "description": "Grades how empathetic the agent sounds during difficult conversations.", "current_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "active_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "metadata": {}, "created_at": "2026-03-01T09:00:00.000Z", "updated_at": "2026-05-20T14:00:00.000Z", "deleted_at": null }, "current_version": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Empathy Check v3", "description": "Refined grading criteria based on feedback.", "state": "editable", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer.", "prompt_md": "Did the agent express empathy when the caller described their problem?", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent clearly and warmly acknowledged the caller's feelings.", "color": "emerald" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored or dismissed the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 10, "created_from_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" } } } ``` # List Eval Agent Versions Source: https://docs.bland.ai/api-v1/get/evals-agents-id-versions GET https://api.bland.ai/v1/evals/agents/{eval_agent_id}/versions List all versions of an eval agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of versions. Each item contains the fields below. **data\[].id** `string` Unique identifier for this version. **data\[].eval\_agent\_id** `string` ID of the parent eval agent. **data\[].version\_number** `integer` Sequential version number. **data\[].name** `string` Name of this version. **data\[].state** `string` State of this version. One of `editable` or `archived`. **data\[].created\_by** `string | null` Identifier of the user who created this version, or `null`. **data\[].created\_at** `string` ISO 8601 timestamp for when this version was created. **data\[].latest\_run** `object | null` Summary of the most recent run against this version, or `null` if no runs exist. * `id` - Run ID. * `status` - Status of the run. * `created_at` - ISO 8601 timestamp. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string | null` Cursor to pass as `starting_after` to fetch the next page, or `null` if there are no more results. ```json Response theme={null} { "errors": null, "data": { "object": "list", "data": [ { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Empathy Check v3", "state": "editable", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "latest_run": null }, { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 2, "name": "Empathy Check v2", "state": "archived", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-04-10T12:00:00.000Z", "latest_run": { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "status": "completed", "created_at": "2026-05-20T14:00:00.000Z" } } ], "has_more": false, "next_cursor": null } } ``` # Get Eval Agent Version Source: https://docs.bland.ai/api-v1/get/evals-agents-id-versions-id GET https://api.bland.ai/v1/evals/agents/{eval_agent_id}/versions/{version_id} Fetch one version of an eval agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent. **version\_id** `string` *required* The unique identifier of the version to fetch. > [!NOTE] > > Returns a `404` with error code `EVAL_AGENT_VERSION_NOT_FOUND` if the version does not exist or does not belong to the specified eval agent. ### Response **data.id** `string` Unique identifier for this version. **data.org\_id** `string` ID of the organization that owns this version. **data.eval\_agent\_id** `string` ID of the parent eval agent. **data.version\_number** `integer` Sequential version number. **data.name** `string` Name of this version. **data.description** `string | null` Optional description of this version. **data.state** `string` State of this version. One of `editable` or `archived`. **data.modality** `string` One of `text` or `audio`. **data.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.levels** `array of objects` Verdict levels for graded mode. Empty array for pass/fail mode. Each level contains `level_key`, `label`, `prompt_md`, and optionally `color`. **data.target\_level\_keys** `array of strings` Which level keys count as a target match. Empty array for pass/fail agents. **data.weight** `number` Relative weight of this version in aggregate scoring. Between 0 and 100. **data.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if this is the first version. **data.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 2, "name": "Empathy Check v2", "description": "Expanded grading criteria with three verdict levels.", "state": "archived", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer.", "prompt_md": "Did the agent express empathy when the caller described their problem?", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent clearly and warmly acknowledged the caller's feelings.", "color": "emerald" }, { "level_key": "adequate", "label": "Adequate", "prompt_md": "The agent showed some empathy but could have been warmer.", "color": "amber" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored or dismissed the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 10, "created_from_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-04-10T12:00:00.000Z", "updated_at": "2026-04-10T12:00:00.000Z" } } ``` # List Eval Runs Source: https://docs.bland.ai/api-v1/get/evals-runs GET https://api.bland.ai/v1/evals/runs List eval runs in your organization, with optional filters. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **eval\_agent\_id** `string` Filter to runs that included this eval agent. **workbench\_setup\_id** `string` Filter to runs started from this workbench setup. **status** `string` Filter by run status. Possible values: `PENDING`, `QUEUED`, `RUNNING`, `COMPLETE`, `PARTIAL`, `FAILED`, `CANCELLED`. **triggered\_by** `string` Filter by how the run was triggered. Possible values: `manual`, `auto`, `backfill`. **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of eval run objects. **EvalRun list item fields** **id** `string` Unique identifier for the eval run. **status** `string` Current status of the run. One of `PENDING`, `QUEUED`, `RUNNING`, `COMPLETE`, `PARTIAL`, `FAILED`, `CANCELLED`. **triggered\_by** `string` How the run was triggered. One of `manual`, `auto`, `backfill`. **run\_mode** `string` The scoring modality used. One of `text`, `audio`, `full`. **resolved\_call\_count** `integer` Number of calls resolved for the run. **resolved\_agent\_count** `integer` Number of eval agents resolved for the run. **resolved\_atom\_count** `integer` Total number of call-by-agent evaluations in the run. **completed\_atom\_count** `integer` Number of evaluations that have completed. **summary** `object or null` Aggregate scoring summary for the run, or `null` if not yet available. **Summary fields** **overall\_score\_mean** `number or null` Mean overall score across all completed evaluations, normalized 0-100. **text\_score\_mean** `number or null` Mean text-modality score, normalized 0-100. **audio\_score\_mean** `number or null` Mean audio-modality score, normalized 0-100. **successful\_call\_count** `integer` Number of calls that were graded successfully. **failed\_call\_count** `integer` Number of calls that failed to grade. **insufficient\_evidence\_count** `integer` Number of evaluations where evidence was insufficient to produce a verdict. **target\_match\_count** `integer` Number of evaluations where the selected level matched a target level. **pass\_threshold\_pct** `number or null` The pass threshold percentage configured for the run, 0-100. **overall\_pass** `boolean or null` Whether the run met its pass threshold, or `null` if no threshold was set. **billable\_cost\_usd** `number or null` Billable cost for this run in USD. **workbench\_setup\_id** `string or null` The workbench setup the run was started from, if any. **workbench\_setup\_version\_id** `string or null` The pinned workbench setup version used, if any. **metadata** `object` Key-value metadata attached to the run. **created\_at** `string` ISO 8601 timestamp when the run was created. **started\_at** `string or null` ISO 8601 timestamp when the run started, or `null` if not yet started. **completed\_at** `string or null` ISO 8601 timestamp when the run completed, or `null` if not yet complete. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string or null` Cursor to use in `starting_after` to retrieve the next page, or `null` if there are no more results. ```json Response theme={null} { "data": { "object": "list", "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "COMPLETE", "triggered_by": "manual", "run_mode": "text", "resolved_call_count": 50, "resolved_agent_count": 3, "resolved_atom_count": 150, "completed_atom_count": 150, "summary": { "overall_score_mean": 82.4, "text_score_mean": 82.4, "audio_score_mean": null, "successful_call_count": 48, "failed_call_count": 2, "insufficient_evidence_count": 1, "target_match_count": 39, "pass_threshold_pct": 75, "overall_pass": true }, "billable_cost_usd": 1.24, "workbench_setup_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "metadata": {}, "created_at": "2026-05-20T14:00:00.000Z", "started_at": "2026-05-20T14:00:05.000Z", "completed_at": "2026-05-20T14:03:42.000Z" }, { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "status": "RUNNING", "triggered_by": "auto", "run_mode": "full", "resolved_call_count": 100, "resolved_agent_count": 2, "resolved_atom_count": 200, "completed_atom_count": 87, "summary": null, "billable_cost_usd": null, "workbench_setup_id": null, "workbench_setup_version_id": null, "metadata": { "pipeline": "nightly" }, "created_at": "2026-05-27T02:00:00.000Z", "started_at": "2026-05-27T02:00:08.000Z", "completed_at": null } ], "has_more": false, "next_cursor": null }, "errors": null } ``` # Get Eval Run Source: https://docs.bland.ai/api-v1/get/evals-runs-id GET https://api.bland.ai/v1/evals/runs/{run_id} Fetch one eval run and its current status and summary. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The ID of the eval run to retrieve. ### Response **id** `string` Unique identifier for the eval run. **org\_id** `string` The organization that owns this run. **status** `string` Current status. One of `PENDING`, `QUEUED`, `RUNNING`, `COMPLETE`, `PARTIAL`, `FAILED`, `CANCELLED`. **triggered\_by** `string` How the run was triggered. One of `manual`, `auto`, `backfill`. **run\_mode** `string` The scoring modality. One of `text`, `audio`, `full`. **submitted\_call\_ids** `array of string` The call IDs submitted for scoring. **submitted\_attached\_agents** `array of objects` The agent attachments submitted with the run. Each object contains `eval_agent_id`, `eval_agent_version_id`, `weight`, and `target_level_keys`. **workbench\_setup\_id** `string or null` The associated workbench setup, if any. **workbench\_setup\_version\_id** `string or null` The pinned workbench setup version, if any. **resolved\_call\_count** `integer` Number of calls resolved for the run. **resolved\_agent\_count** `integer` Number of eval agents resolved for the run. **resolved\_atom\_count** `integer` Total call-by-agent evaluations in the run. **completed\_atom\_count** `integer` Number of evaluations completed so far. **summary** `object or null` Aggregate scoring summary, or `null` if not yet available. **Summary fields** **overall\_score\_mean** `number or null` Mean overall score across all completed evaluations, normalized 0-100. **text\_score\_mean** `number or null` Mean text-modality score, normalized 0-100. **audio\_score\_mean** `number or null` Mean audio-modality score, normalized 0-100. **successful\_call\_count** `integer` Number of calls graded successfully. **failed\_call\_count** `integer` Number of calls that failed to grade. **insufficient\_evidence\_count** `integer` Number of evaluations where evidence was insufficient to produce a verdict. **target\_match\_count** `integer` Number of evaluations where the selected level matched a target level. **pass\_threshold\_pct** `number or null` The pass threshold configured for the run, 0-100. **overall\_pass** `boolean or null` Whether the run met its pass threshold, or `null` if no threshold was set. **billable\_cost\_usd** `number or null` Billable cost for this run in USD, or `null` if not yet finalized. **error\_code** `string or null` Error code if the run failed, otherwise `null`. **error\_message** `string or null` Human-readable error message if the run failed, otherwise `null`. **workflow\_id** `string or null` Internal workflow identifier, if applicable. **metadata** `object` Key-value metadata attached to the run. **created\_at** `string` ISO 8601 timestamp when the run was created. **started\_at** `string or null` ISO 8601 timestamp when the run started, or `null` if not yet started. **completed\_at** `string or null` ISO 8601 timestamp when the run completed, or `null` if not yet complete. ```json Response theme={null} { "data": { "id": "e5f6a7b8-c9d0-1234-efab-345678901234", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "status": "COMPLETE", "triggered_by": "manual", "run_mode": "text", "submitted_call_ids": [ "a1b2c3d4-0000-0000-0000-000000000001", "a1b2c3d4-0000-0000-0000-000000000002" ], "submitted_attached_agents": [ { "eval_agent_id": "11111111-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_version_id": "22222222-aaaa-bbbb-cccc-dddddddddddd", "weight": 100, "target_level_keys": ["pass"] } ], "workbench_setup_id": null, "workbench_setup_version_id": null, "resolved_call_count": 2, "resolved_agent_count": 1, "resolved_atom_count": 2, "completed_atom_count": 2, "summary": { "overall_score_mean": 91.5, "text_score_mean": 91.5, "audio_score_mean": null, "successful_call_count": 2, "failed_call_count": 0, "insufficient_evidence_count": 0, "target_match_count": 2, "pass_threshold_pct": 80, "overall_pass": true }, "billable_cost_usd": 0.04, "error_code": null, "error_message": null, "workflow_id": null, "metadata": {}, "created_at": "2026-05-27T10:00:00.000Z", "started_at": "2026-05-27T10:00:05.000Z", "completed_at": "2026-05-27T10:01:12.000Z" }, "errors": null } ``` # List Agent Results Source: https://docs.bland.ai/api-v1/get/evals-runs-id-agent-results GET https://api.bland.ai/v1/evals/runs/{run_id}/agent-results List every individual judge verdict in an eval run. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The ID of the eval run. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of agent result objects, one per call-by-agent evaluation. **EvalRunAgentResult fields** **id** `string` Unique identifier for this agent result. **org\_id** `string` The organization that owns this result. **eval\_run\_id** `string` The eval run this result belongs to. **eval\_run\_call\_result\_id** `string` The call result this agent verdict is part of. **eval\_run\_agent\_snapshot\_id** `string` The frozen agent snapshot used to produce this verdict. **eval\_agent\_id** `string` The eval agent that produced this verdict. **eval\_agent\_version\_id** `string` The specific version of the eval agent used. **call\_id** `string` The call that was scored. **selected\_level\_key** `string or null` The level key the judge selected, or `null` if scoring failed or evidence was insufficient. **selected\_level\_label** `string or null` Human-readable label for the selected level. **score\_normalized\_0\_100** `number or null` Normalized score for this verdict, 0-100. **is\_target\_match** `boolean or null` Whether the selected level is one of the configured target levels. **is\_insufficient\_evidence** `boolean` Whether the judge determined there was not enough evidence to produce a verdict. **confidence** `number or null` Judge confidence in the verdict, 0-1. **reasoning\_md** `string or null` Markdown-formatted reasoning from the judge. **evidence** `array of objects` Transcript or audio quotes the judge cited as evidence. **Evidence quote fields** **source** `string` Where the evidence came from. One of `transcript` or `audio`. **speaker** `string or null` Who spoke this quote. One of `agent`, `customer`, `unknown`, or `null`. **start\_ms** `integer or null` Start time of the quote in milliseconds, if available. **end\_ms** `integer or null` End time of the quote in milliseconds, if available. **text** `string` The quoted text. **failed** `boolean` Whether this evaluation failed to complete. **failure\_code** `string or null` Machine-readable failure code, if `failed` is `true`. **failure\_message** `string or null` Human-readable failure description, if `failed` is `true`. **billable\_cost\_usd** `number or null` Billable cost for this individual verdict in USD. **audit** `object` Audit metadata for the judge call. **Audit fields** **prompt\_version** `string` Version of the judge prompt used. **input\_tokens** `integer or null` Number of input tokens consumed. **output\_tokens** `integer or null` Number of output tokens produced. **latency\_ms** `integer or null` Latency of the judge call in milliseconds. **created\_at** `string` ISO 8601 timestamp when this result was created. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string or null` Cursor to use in `starting_after` to retrieve the next page, or `null` if there are no more results. ```json Response theme={null} { "data": { "object": "list", "data": [ { "id": "c2d3e4f5-a6b7-8901-cdef-234567890123", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "eval_run_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_run_call_result_id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "eval_run_agent_snapshot_id": "33333333-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_id": "11111111-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_version_id": "22222222-aaaa-bbbb-cccc-dddddddddddd", "call_id": "a1b2c3d4-0000-0000-0000-000000000001", "selected_level_key": "pass", "selected_level_label": "Pass", "score_normalized_0_100": 88.0, "is_target_match": true, "is_insufficient_evidence": false, "confidence": 0.93, "reasoning_md": "The agent correctly identified the account issue and offered a resolution within the first two minutes of the call.", "evidence": [ { "source": "transcript", "speaker": "agent", "start_ms": 45200, "end_ms": 52100, "text": "I can see your account has a pending charge from last week. Let me reverse that for you right now." } ], "failed": false, "failure_code": null, "failure_message": null, "billable_cost_usd": 0.02, "audit": { "prompt_version": "v3.1.0", "input_tokens": 2840, "output_tokens": 312, "latency_ms": 1843 }, "created_at": "2026-05-27T10:00:48.000Z" } ], "has_more": false, "next_cursor": null }, "errors": null } ``` # List Agent Snapshots Source: https://docs.bland.ai/api-v1/get/evals-runs-id-agent-snapshots GET https://api.bland.ai/v1/evals/runs/{run_id}/agent-snapshots List the frozen agent configurations a run scored against. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The ID of the eval run. > [!NOTE] > > Snapshots freeze each agent's prompt, levels, and targets at submission time, so historical results never change if you later edit the agent. ### Response **object** `string` Always `"list"`. **data** `array of objects` All agent snapshots for the run. Returns all snapshots in a single page. **EvalRunAgentSnapshot fields** **id** `string` Unique identifier for this snapshot. **org\_id** `string` The organization that owns this snapshot. **eval\_run\_id** `string` The eval run this snapshot belongs to. **eval\_agent\_id** `string` The source eval agent. **eval\_agent\_version\_id** `string` The specific version of the eval agent that was frozen. **position** `integer` The ordering position of this agent within the run's agent roster. **key** `string` Machine-readable key identifying this agent in the run. **name** `string` Human-readable name of the agent at snapshot time. **modality** `string` Scoring modality for this agent. One of `text` or `audio`. **system\_prompt\_md** `string` The system prompt used by the judge, frozen at submission time. **prompt\_md** `string` The evaluation prompt, frozen at submission time. **prompt\_version** `string` Version identifier for the prompt. **levels** `array of objects` The scoring levels defined for this agent, frozen at submission time. **Level fields** **level\_key** `string` Machine-readable key for this level. **label** `string` Human-readable label for this level. **prompt\_md** `string` Description of what qualifies a call for this level. **color** `string` Optional display color for this level. **target\_level\_keys** `array of string` Level keys that are considered a passing result, frozen at submission time. **weight** `number` Relative weight of this agent in the overall score, 0-100. **created\_at** `string` ISO 8601 timestamp when this snapshot was created. **has\_more** `boolean` Always `false`. All snapshots are returned in a single page. **next\_cursor** `null` Always `null`. ```json Response theme={null} { "data": { "object": "list", "data": [ { "id": "33333333-aaaa-bbbb-cccc-dddddddddddd", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "eval_run_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_id": "11111111-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_version_id": "22222222-aaaa-bbbb-cccc-dddddddddddd", "position": 0, "key": "resolution_quality", "name": "Resolution Quality", "modality": "text", "system_prompt_md": "You are an expert call quality analyst evaluating customer service interactions.", "prompt_md": "Did the agent fully resolve the customer's issue without requiring a callback?", "prompt_version": "v3.1.0", "levels": [ { "level_key": "pass", "label": "Pass", "prompt_md": "The agent resolved the issue completely and the customer confirmed satisfaction.", "color": "#22c55e" }, { "level_key": "partial", "label": "Partial", "prompt_md": "The agent addressed the issue but the customer expressed some remaining concern.", "color": "#f59e0b" }, { "level_key": "fail", "label": "Fail", "prompt_md": "The issue was not resolved or the customer was transferred unnecessarily.", "color": "#ef4444" } ], "target_level_keys": ["pass"], "weight": 100, "created_at": "2026-05-27T10:00:00.000Z" } ], "has_more": false, "next_cursor": null }, "errors": null } ``` # List Call Results Source: https://docs.bland.ai/api-v1/get/evals-runs-id-call-results GET https://api.bland.ai/v1/evals/runs/{run_id}/call-results List the per-call results for an eval run. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The ID of the eval run. ### Query Parameters **include\_agent\_results** `boolean` (default: false) Embed each call's per-agent verdicts inline in the `agent_results` field. When `false`, `agent_results` is an empty array. **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of call result objects. **EvalRunCallResult fields** **id** `string` Unique identifier for this call result. **org\_id** `string` The organization that owns this result. **eval\_run\_id** `string` The eval run this result belongs to. **call\_id** `string` The ID of the call that was scored. **call\_display\_name** `string or null` Display name of the call, if available. **call\_started\_at** `string or null` ISO 8601 timestamp when the call started. **call\_duration\_seconds** `number or null` Duration of the call in seconds. **call\_ended\_by** `string or null` Which party ended the call. **transcript\_snapshot\_ref** `string or null` Reference to the transcript snapshot used for scoring. **transcript\_snapshot\_expires\_at** `string or null` ISO 8601 timestamp when the transcript snapshot expires. **status** `string` Status of this call's evaluation. One of `PENDING`, `QUEUED`, `RUNNING`, `COMPLETE`, `FAILED`, `INSUFFICIENT_EVIDENCE`. **started\_at** `string or null` ISO 8601 timestamp when scoring started for this call. **completed\_at** `string or null` ISO 8601 timestamp when scoring completed for this call. **overall\_score\_normalized\_0\_100** `number or null` Overall weighted score for this call, normalized 0-100. **text\_score\_normalized\_0\_100** `number or null` Text-modality score for this call, normalized 0-100. **audio\_score\_normalized\_0\_100** `number or null` Audio-modality score for this call, normalized 0-100. **failed\_agent\_count** `integer` Number of agent evaluations that failed for this call. **insufficient\_evidence\_agent\_count** `integer` Number of agent evaluations that returned insufficient evidence for this call. **agent\_results** `array of objects` Per-agent verdicts for this call. Populated only when `include_agent_results=true`; otherwise an empty array. See [List Agent Results](/api-v1/get/evals-runs-id-agent-results) for the full field reference. **created\_at** `string` ISO 8601 timestamp when this call result was created. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string or null` Cursor to use in `starting_after` to retrieve the next page, or `null` if there are no more results. **run\_status** `string` The eval run's current status. **run\_resolved\_call\_count** `integer` Total number of calls resolved for the run. ```json Response theme={null} { "data": { "object": "list", "data": [ { "id": "b1c2d3e4-f5a6-7890-bcde-f12345678901", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "eval_run_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "call_id": "a1b2c3d4-0000-0000-0000-000000000001", "call_display_name": "Inbound - Account Inquiry", "call_started_at": "2026-05-20T13:45:00.000Z", "call_duration_seconds": 187.4, "call_ended_by": "agent", "transcript_snapshot_ref": "snapshots/a1b2c3d4-0000-0000-0000-000000000001/v1", "transcript_snapshot_expires_at": "2026-06-20T13:45:00.000Z", "status": "COMPLETE", "started_at": "2026-05-27T10:00:06.000Z", "completed_at": "2026-05-27T10:00:48.000Z", "overall_score_normalized_0_100": 88.0, "text_score_normalized_0_100": 88.0, "audio_score_normalized_0_100": null, "failed_agent_count": 0, "insufficient_evidence_agent_count": 0, "agent_results": [], "created_at": "2026-05-27T10:00:05.000Z" } ], "has_more": true, "next_cursor": "b1c2d3e4-f5a6-7890-bcde-f12345678901" }, "errors": null, "run_status": "COMPLETE", "run_resolved_call_count": 50 } ``` # Get Evals Status Source: https://docs.bland.ai/api-v1/get/evals-status GET https://api.bland.ai/v1/evals/status Check whether the Evals feature is enabled for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **enabled** `boolean` Whether Evals is enabled for your organization. **gate** `string` The feature gate key. Always `evals_enabled`. **reason** `string` Why the feature is unavailable, or `null` when enabled. > [!NOTE] > > This is the only Evals endpoint that is not gated. When Evals is disabled, every other `/v1/evals` endpoint returns `404`. ```json Response theme={null} { "data": { "enabled": true, "gate": "evals_enabled", "reason": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List User Templates Source: https://docs.bland.ai/api-v1/get/evals-user-templates GET https://api.bland.ai/v1/evals/user-templates List your organization's saved eval agent templates. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `list`. **data** `array` Array of user template summary objects. **user template object** **id** `string` Unique identifier (UUID) for the template. **key** `string` Short key used to reference the template. **name** `string` Display name of the template. **description** `string` Description of the template, or `null`. **category** `string` Category of the template, or `null`. **modality** `string` Evaluation modality. Either `text` or `audio`. **visibility** `string` Who can access this template. One of `private`, `org`, or `public`. **level\_count** `integer` Number of scoring levels defined on this template. **source\_agent\_id** `string` UUID of the eval agent this template was snapshotted from, or `null`. **created\_by** `string` UUID of the user who created the template, or `null`. **created\_at** `string` ISO 8601 timestamp of when the template was created. **updated\_at** `string` ISO 8601 timestamp of when the template was last updated. **has\_more** `boolean` Whether additional results exist beyond this page. **next\_cursor** `string` Cursor to pass as `starting_after` to fetch the next page, or `null` when there are no more results. ```json Response theme={null} { "data": { "object": "list", "data": [ { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "key": "my_hallucination_check", "name": "My Hallucination Check", "description": "Customized hallucination detection for our product domain.", "category": "quality", "modality": "text", "visibility": "org", "level_count": 3, "source_agent_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-01T10:00:00.000Z", "updated_at": "2026-05-10T14:30:00.000Z" }, { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "key": "sales_compliance_v2", "name": "Sales Compliance v2", "description": null, "category": "compliance", "modality": "audio", "visibility": "private", "level_count": 2, "source_agent_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "updated_at": "2026-05-15T08:00:00.000Z" } ], "has_more": false, "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get User Template Source: https://docs.bland.ai/api-v1/get/evals-user-templates-id GET https://api.bland.ai/v1/evals/user-templates/{id} Fetch one of your organization's saved eval agent templates. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The UUID of the user template to retrieve. ### Response **id** `string` Unique identifier (UUID) for the template. **org\_id** `string` UUID of the organization that owns this template. **key** `string` Short key used to reference the template. **name** `string` Display name of the template. **description** `string` Description of the template, or `null`. **category** `string` Category of the template, or `null`. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` System prompt for the eval agent, in Markdown. **prompt\_md** `string` Evaluation prompt, in Markdown. **levels** `array` Ordered scoring levels. **level object** **level\_key** `string` Short identifier for the level, 1-64 characters. **label** `string` Display label for the level, 1-80 characters. **prompt\_md** `string` Prompt describing this level's criteria, in Markdown. **color** `string` Optional display color. One of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold. **visibility** `string` Access scope. One of `private`, `org`, or `public`. **source\_agent\_id** `string` UUID of the eval agent this template was snapshotted from, or `null`. **source\_version\_id** `string` UUID of the specific version snapshotted, or `null`. **created\_by** `string` UUID of the user who created the template, or `null`. **created\_at** `string` ISO 8601 timestamp of when the template was created. **updated\_at** `string` ISO 8601 timestamp of when the template was last updated. ```json Response theme={null} { "data": { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "key": "my_hallucination_check", "name": "My Hallucination Check", "description": "Customized hallucination detection for our product domain.", "category": "quality", "modality": "text", "system_prompt_md": "You are an expert evaluator assessing whether an AI agent fabricated information.", "prompt_md": "Review the conversation and identify any claims that were factually incorrect or unsupported.", "levels": [ { "level_key": "no_hallucination", "label": "No Hallucination", "prompt_md": "The agent made no factually incorrect or unsupported claims.", "color": "emerald" }, { "level_key": "hallucination_detected", "label": "Hallucination Detected", "prompt_md": "The agent stated something factually incorrect or unsupported.", "color": "rose" } ], "target_level_keys": ["no_hallucination"], "visibility": "org", "source_agent_id": null, "source_version_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Workbench Setups Source: https://docs.bland.ai/api-v1/get/evals-workbench-setups GET https://api.bland.ai/v1/evals/workbench-setups List the workbench setups in your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of workbench setups. Each item contains the fields below. **data\[].id** `string` Unique identifier for the workbench setup. **data\[].name** `string` Display name of the workbench setup. **data\[].description** `string | null` Optional description of the workbench setup. **data\[].current\_version\_id** `string` ID of the current editable draft version. **data\[].active\_version\_id** `string | null` ID of the published version, or `null` if never published. **data\[].active\_version\_number** `integer | null` Version number of the published version, or `null` if never published. **data\[].attached\_agent\_count** `integer` Number of eval agents currently attached to the draft version. **data\[].latest\_run** `object | null` Summary of the most recent run against this setup, or `null` if no runs exist. * `id` - Run ID. * `status` - Status of the run. * `created_at` - ISO 8601 timestamp. * `call_count` - Number of calls evaluated. **data\[].metadata** `object` Key-value metadata associated with the setup. Values are strings. **data\[].created\_at** `string` ISO 8601 timestamp for when the setup was created. **data\[].updated\_at** `string` ISO 8601 timestamp for when the setup was last updated. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string | null` Cursor to pass as `starting_after` to fetch the next page, or `null` if there are no more results. ```json Response theme={null} { "errors": null, "data": { "object": "list", "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "Onboarding Quality Check", "description": "Evaluates tone, accuracy, and resolution rate across onboarding calls.", "current_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "active_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "active_version_number": 3, "attached_agent_count": 4, "latest_run": { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "status": "completed", "created_at": "2026-05-22T10:00:00.000Z", "call_count": 200 }, "metadata": {}, "created_at": "2026-03-15T08:00:00.000Z", "updated_at": "2026-05-22T10:05:00.000Z" } ], "has_more": false, "next_cursor": null } } ``` # Get Workbench Setup Source: https://docs.bland.ai/api-v1/get/evals-workbench-setups-id GET https://api.bland.ai/v1/evals/workbench-setups/{setup_id} Fetch one workbench setup and its current draft version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup to retrieve. ### Response **data** `object` An object containing the setup and its current draft version. **setup** **data.setup.id** `string` Unique identifier for the workbench setup. **data.setup.org\_id** `string` ID of the organization that owns this setup. **data.setup.key** `string` Stable slug key for the setup. **data.setup.name** `string` Display name of the setup. **data.setup.description** `string | null` Description of the setup, or `null` if not set. **data.setup.current\_version\_id** `string` ID of the current editable draft version. **data.setup.active\_version\_id** `string | null` ID of the published version, or `null` if never published. **data.setup.metadata** `object` Key-value metadata. Values are strings. **data.setup.created\_at** `string` ISO 8601 timestamp for when the setup was created. **data.setup.updated\_at** `string` ISO 8601 timestamp for when the setup was last updated. **data.setup.deleted\_at** `string | null` ISO 8601 timestamp for when the setup was deleted, or `null` if not deleted. **current\_version** **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.workbench\_setup\_id** `string` ID of the parent workbench setup. **data.current\_version.version\_number** `integer` Monotonically increasing version number. **data.current\_version.name** `string` Display name of this version. **data.current\_version.description** `string | null` Description of this version, or `null` if not set. **data.current\_version.state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **data.current\_version.attached\_agents** `array` Eval agents attached to this version. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **data.current\_version.pass\_threshold\_pct** `integer | null` Percentage of calls that must pass for a run to be considered passing (0-100), or `null` if not set. **data.current\_version.run\_mode** `string` How calls are evaluated. One of `text`, `audio`, or `full`. **data.current\_version.default\_test\_config\_id** `string | null` ID of the default test configuration, or `null` if not set. **data.current\_version.default\_call\_ids** `array of strings` Default call IDs to evaluate against. Up to 5000 entries. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if it is the first version. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "setup": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "key": "onboarding-quality-check", "name": "Onboarding Quality Check", "description": "Evaluates tone, accuracy, and resolution rate across onboarding calls.", "current_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "active_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "metadata": {}, "created_at": "2026-03-15T08:00:00.000Z", "updated_at": "2026-05-20T14:00:00.000Z", "deleted_at": null }, "current_version": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 4, "name": "Onboarding Quality Check", "description": "Evaluates tone, accuracy, and resolution rate across onboarding calls.", "state": "editable", "attached_agents": [ { "eval_agent_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_version_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "weight": 50, "target_level_keys": ["good", "excellent"] } ], "pass_threshold_pct": 80, "run_mode": "audio", "default_test_config_id": null, "default_call_ids": [], "created_from_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-20T14:00:00.000Z", "updated_at": "2026-05-20T14:00:00.000Z" } } } ``` # List Workbench Setup Versions Source: https://docs.bland.ai/api-v1/get/evals-workbench-setups-id-versions GET https://api.bland.ai/v1/evals/workbench-setups/{setup_id}/versions List all versions of a workbench setup. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup whose versions you want to list. ### Query Parameters **limit** `integer` (default: 25) Number of results to return. Between 1 and 100. **starting\_after** `string` Cursor: return results after this object ID. **ending\_before** `string` Cursor: return results before this object ID. Cannot be combined with `starting_after`. ### Response **object** `string` Always `"list"`. **data** `array of objects` The list of versions. Each item contains the fields below. **data\[].id** `string` Unique identifier for this version. **data\[].workbench\_setup\_id** `string` ID of the parent workbench setup. **data\[].version\_number** `integer` Monotonically increasing version number. **data\[].name** `string` Display name of this version. **data\[].state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **data\[].attached\_agent\_count** `integer` Number of eval agents attached to this version. **data\[].created\_by** `string | null` Identifier of the user who created this version, or `null`. **data\[].created\_at** `string` ISO 8601 timestamp for when this version was created. **data\[].latest\_run** `object | null` Summary of the most recent run against this version, or `null` if none exist. * `id` - Run ID. * `status` - Status of the run. * `created_at` - ISO 8601 timestamp. **has\_more** `boolean` Whether more results exist beyond this page. **next\_cursor** `string | null` Cursor to pass as `starting_after` to fetch the next page, or `null` if there are no more results. ```json Response theme={null} { "errors": null, "data": { "object": "list", "data": [ { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 4, "name": "Onboarding Quality Check", "state": "editable", "attached_agent_count": 4, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-20T14:00:00.000Z", "latest_run": null }, { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Onboarding Quality Check", "state": "archived", "attached_agent_count": 4, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-04-10T09:00:00.000Z", "latest_run": { "id": "e5f6a7b8-c9d0-1234-efab-345678901234", "status": "completed", "created_at": "2026-05-15T16:00:00.000Z" } } ], "has_more": false, "next_cursor": null } } ``` # Get Workbench Setup Version Source: https://docs.bland.ai/api-v1/get/evals-workbench-setups-id-versions-id GET https://api.bland.ai/v1/evals/workbench-setups/{setup_id}/versions/{version_id} Fetch one version of a workbench setup. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup. **version\_id** `string` *required* The ID of the version to retrieve. ### Response **data** `object` The full version object. **version fields** **id** `string` Unique identifier for this version. **org\_id** `string` ID of the organization that owns this version. **workbench\_setup\_id** `string` ID of the parent workbench setup. **version\_number** `integer` Monotonically increasing version number. **name** `string` Display name of this version. **description** `string | null` Description of this version, or `null` if not set. **state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **attached\_agents** `array` Eval agents attached to this version. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **pass\_threshold\_pct** `integer | null` Percentage of calls that must pass for a run to be considered passing (0-100), or `null` if not set. **run\_mode** `string` How calls are evaluated. One of `text`, `audio`, or `full`. **default\_test\_config\_id** `string | null` ID of the default test configuration, or `null` if not set. **default\_call\_ids** `array of strings` Default call IDs to evaluate against. Up to 5000 entries. **created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if it is the first version. **created\_by** `string | null` Identifier of the user who created this version, or `null`. **created\_at** `string` ISO 8601 timestamp for when this version was created. **updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "id": "d4e5f6a7-b8c9-0123-defa-234567890123", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Onboarding Quality Check", "description": "Evaluation suite for Q1 onboarding calls.", "state": "archived", "attached_agents": [ { "eval_agent_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_version_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "weight": 50, "target_level_keys": ["good", "excellent"] }, { "eval_agent_id": "a0b1c2d3-e4f5-6789-abcd-ef0123456789", "eval_agent_version_id": "b1c2d3e4-f5a6-7890-bcde-f01234567890", "weight": 50, "target_level_keys": ["acceptable"] } ], "pass_threshold_pct": 75, "run_mode": "audio", "default_test_config_id": null, "default_call_ids": [ "call_abc123", "call_def456" ], "created_from_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-04-10T09:00:00.000Z", "updated_at": "2026-04-15T12:00:00.000Z" } } ``` # Event Stream Source: https://docs.bland.ai/api-v1/get/event-stream GET https://api.bland.ai/v1/event_stream/{call_id} Retrieve stream of events that occurred during the call. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **call\_id** `string` *required* The unique identifier of the call for which you want to retrieve detailed information. ### Response **level** `string` The level of the event - `queue` or `call` **message** `string` The message of the event. **category** `string` The category of the event - `info`, `performance` or `error`. **call\_id** `string` The unique identifier for the call. **timestamp** `string` When the event occurred. *** Docs for agents: [llms.txt](/llms.txt) # Get Pathways in Folder Source: https://docs.bland.ai/api-v1/get/folder_pathways GET https://us.api.bland.ai/v1/pathway/folders/{folder_id}/pathways Retrieves all pathways within a specific folder for the authenticated user. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **folder\_id** `string` *required* The ID of the folder to retrieve pathways from. ### Response **pathways** `array` An array of pathway objects within the specified folder. **pathways\[].id** `string` The unique identifier of the pathway. **pathways\[].name** `string` The name of the pathway. **pathways\[].description** `string` The description of the pathway. **pathways\[].created\_at** `string` The creation date and time of the pathway. ```json Response theme={null} { "pathways": [ { "id": "pathway_123", "name": "My Pathway", "description": "A sample pathway", "created_at": "2024-03-15T12:00:00Z" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Guard Rails Source: https://docs.bland.ai/api-v1/get/guard-rails GET https://api.bland.ai/v1/guard_rails Retrieve a list of all guard rails in your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **source\_type** `string` Filter guard rails by the type of source they're attached to. Options: `PERSONA`, `PATHWAY`, `INBOUND` **source\_id** `string` Filter guard rails by a specific source ID (must be a valid UUID). ### Response **data** `array` Array of guard rail objects. **data\[].id** `string` Unique identifier for the guard rail. **data\[].org\_id** `string` Organization ID that owns this guard rail. **data\[].type** `string` Type of guard rail. One of: `tcpa:ai_disclosure`, `tcpa:recording_disclosure`, `tcpa:self_introduction`, `tcpa:opt_out`, or `custom`. **data\[].name** `string` Name of the guard rail (for custom guard rails). **data\[].description** `string` Description of the guard rail (for custom guard rails). **data\[].prompt** `string` Detection prompt (only for custom guard rails). **data\[].config** `object` Configuration object. For TCPA time-based guard rails, contains `end_seconds`. **data\[].attachments** `array` Array of sources this guard rail is attached to. Each attachment contains `source_type` (`PERSONA`, `PATHWAY`, or `INBOUND`), `source_id`, and `actions`. **data\[].created\_at** `string` ISO 8601 timestamp of when the guard rail was created. **data\[].updated\_at** `string` ISO 8601 timestamp of when the guard rail was last modified. **errors** `array` Any errors that occurred (null if none). ```json Response theme={null} { "data": [ { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "org_id": "12345678-1234-1234-1234-123456789012", "type": "tcpa:ai_disclosure", "name": null, "description": null, "prompt": null, "config": { "end_seconds": 30 }, "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "end_call" } ] } ], "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z" }, { "id": "b2c3d4e5-6789-01bc-defg-2345678901bc", "org_id": "12345678-1234-1234-1234-123456789012", "type": "custom", "name": "No Medical Advice", "description": "Prevents the agent from providing medical advice", "prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations", "config": {}, "attachments": [ { "source_type": "PATHWAY", "source_id": "11111111-2222-3333-4444-555555555555", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ], "created_at": "2025-01-16T14:20:00.000Z", "updated_at": "2025-01-16T14:20:00.000Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Guard Rail Source: https://docs.bland.ai/api-v1/get/guard-rails-id GET https://api.bland.ai/v1/guard_rails/{guard_rail_id} Retrieve a specific guard rail by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **guard\_rail\_id** `string` *required* The unique identifier of the guard rail to retrieve. ### Response **data** `object` The guard rail object. **data.id** `string` Unique identifier for the guard rail. **data.org\_id** `string` Organization ID that owns this guard rail. **data.type** `string` Type of guard rail. One of: `tcpa:ai_disclosure`, `tcpa:recording_disclosure`, `tcpa:self_introduction`, `tcpa:opt_out`, or `custom`. **data.name** `string` Name of the guard rail (for custom guard rails). **data.description** `string` Description of the guard rail (for custom guard rails). **data.prompt** `string` Detection prompt (only for custom guard rails). **data.config** `object` Configuration object. For TCPA time-based guard rails, contains `end_seconds`. **data.attachments** `array` Array of sources this guard rail is attached to. Each attachment contains `source_type` (`PERSONA`, `PATHWAY`, or `INBOUND`), `source_id`, and `actions`. **data.created\_at** `string` ISO 8601 timestamp of when the guard rail was created. **data.updated\_at** `string` ISO 8601 timestamp of when the guard rail was last modified. **errors** `array` Any errors that occurred (null if none). ```json Response theme={null} { "data": { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "org_id": "12345678-1234-1234-1234-123456789012", "type": "custom", "name": "No Medical Advice", "description": "Prevents the agent from providing medical advice", "prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations", "config": {}, "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ], "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z" }, "errors": null } ``` ```json Error Response (Not Found) theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Guard rail not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Numbers Source: https://docs.bland.ai/api-v1/get/inbound GET https://api.bland.ai/v1/inbound Retrieves a list of all inbound phone numbers configured for your account, along with their associated settings. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` Use your own Twilio account and only return inbound numbers associated with that account sid (optional). Learn more about BYOT [here](/tutorials/custom-twilio). ### Response **inbound\_numbers** `array` An array of objects, each representing an inbound phone number and its configuration. ```json Response theme={null} { "inbound_numbers": [ { "created_at": "2023-11-27T17:21:38.33359+00:00", "phone_number": "+18005551234", "prompt": "When you receive a call, recite a random poem from 'Sunset Boulevard' and then ask, 'How may I assist you in your poetic journey today?'", "webhook": "https://api.example.com/poetry-line", "voice_id": 2, "dynamic_data": [/* Use [Dynamic Data](/api-reference/endpoint/dynamic_validate) to make API requests mid-call */], "interruption_threshold": null, "first_sentence": null, "reduce_latency": true, "transfer_phone_number": null, "voice_settings": null, "record": false, "max_duration": 30 }, { "created_at": "2023-11-25T21:42:22.325993+00:00", "phone_number": "+18005559876", "prompt": "Answer with 'You've reached the Secret Society of Enigmatic Enthusiasts. Please state the password or leave a message after the beep.'", "webhook": "https://mysteryclub.example.com/inbound-call-hook", "voice_id": 1, "dynamic_data": null, "interruption_threshold": null, "first_sentence": null, "reduce_latency": true, "transfer_phone_number": null, "voice_settings": null, "record": false, "max_duration": 30 }, //... ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Number Details Source: https://docs.bland.ai/api-v1/get/inbound-number GET https://api.bland.ai/v1/inbound/{phone_number} Retrieve settings for your inbound phone number. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **phone\_number** `string` The inbound phone number to update. Formatting notes: * The `'+'` or `'%2B'` prefix is optional. * Will assume a US country code if no country code is provided. Valid Examples for `+13334445555`: * `%2B13334445555` * `13334445555` * `3334445555` ### Response **created\_at** `string` The timestamp when the inbound number was configured. **phone\_number** `string` The specific inbound phone number. **prompt** `string` The prompt your agent is using. **webhook** `string` The webhook URL, if any, where transcripts are sent after each call to the number completes. **voice** `integer` The `voice` your agent is currently using. For more information, see [List Voices](/api-v1/get/voices). **background\_track** `string` The background track your agent is using. Will be `null` by default, until an option such as `office`, `cafe`, `restaurant`, or `none` is applied. **pathway\_id** `string` The `pathway_id` your agent is using. **dynamic\_data** `string` Any dynamic data associated with the inbound number, if applicable. **max\_duration** `integer` The maximum duration of a call to the inbound number, in minutes. **fallback\_number** `string` A pre-configured phone number used as a forwarding destination during Bland maintenance windows. Does not affect normal call routing. Returns `null` if no fallback is configured. ```json Response theme={null} { "created_at": "2023-11-27T17:21:38.33359+00:00", "phone_number": "+18584139939", "prompt": "You're Blandie, the helpful AI assistant. The person calling you has inquired...", "webhook": "https://webhook.site/0a0a0a0a-0a0a-0a0a-0a0a-0a0a0a0a0a0", "voice_id": 2, "dynamic_data": null, "max_duration": 30 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Voice Pool Source: https://docs.bland.ai/api-v1/get/inbound-number-voice-pool GET https://api.bland.ai/v1/inbound/{phone_number}/voice-pool List the voices in an inbound number's voice pool. ## Overview Returns the voices currently in the pool for one inbound number. When a pool is set, each inbound call picks one of these voices at random. Set the pool with [Set Voice Pool](/api-v1/post/inbound-number-voice-pool). An empty `voice_pool` array means no pool is configured and the number uses its own voice setting. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **phone\_number** `string` *required* The inbound number to read, in E.164 format (for example `+15551234567`). SIP DIDs are matched in the form they are stored, so a numeric DID such as `9994221001` also resolves. *** ## Response **data** `object` **data fields** **voice\_pool** `array` One entry per voice in the pool, empty when no pool is set. **Pool entry fields** **id** `string` The pool entry's own ID. This identifies the membership, not the voice. **voice** `object` The voice itself. **Voice fields** **id** `string` The voice ID you pass in `voice_ids` when setting a pool. **name** `string` The voice's display name. **voice\_id** `string` The provider's own identifier for the voice. Not interchangeable with `id`. **service** `string | null` The speech service behind the voice. **created\_at** `string` When the voice was added to the pool, ISO 8601. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "voice_pool": [ { "id": "31c0a4ee-2fab-4400-b4c1-4ac6f6abcd6f", "voice": { "id": "a7f58a4e-3fdb-40fd-ad8b-a14cfe136a59", "name": "josh", "voice_id": "TxGEqnHWrfWFTfGW9XjX", "service": "ELEVEN" }, "created_at": "2026-10-05T17:53:50.074Z" }, { "id": "48608715-a0ba-41c0-ba43-2c1c61255db1", "voice": { "id": "96e2b2d6-d1c2-4676-81d5-e78e9cf3fefc", "name": "martha", "voice_id": "wVZ5qbJFYF3snuC65nb4", "service": "ELEVEN" }, "created_at": "2026-10-05T17:53:50.074Z" } ] }, "errors": null } ``` ```json No Pool Set theme={null} { "data": { "voice_pool": [] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Inbound number not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Knowledge Base Items Source: https://docs.bland.ai/api-v1/get/knowledge GET https://api.bland.ai/v1/knowledge Retrieves a paginated list of knowledge base items for the authenticated organization. Returns all knowledge base items in your organization with pagination support. Use this endpoint to browse your available knowledge base items and their current status. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **page** `number` (default: 1) Page number for pagination. **limit** `number` (default: 20) Number of items per page (maximum 100). ### Response **data** `object` Paginated list of knowledge base items. **data.kbs** `array` Array of knowledge base item objects. **data.kbs\[].id** `string` Unique identifier for the knowledge base item. **data.kbs\[].name** `string` Name of the knowledge base item. **data.kbs\[].description** `string` Description of the knowledge base item (if provided). **data.kbs\[].status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.kbs\[].type** `string` Type of knowledge base item: `"FILE"`, `"WEB_SCRAPE"`, or `"TEXT"`. **data.kbs\[].source\_urls** `string` Source URLs for web scrape type (comma-separated). **data.kbs\[].base\_url** `string` Base URL for web scrape type. **data.kbs\[].created\_at** `string` ISO timestamp of creation. **data.kbs\[].updated\_at** `string` ISO timestamp of last update. **data.kbs\[].error\_message** `string` Error message if status is `"FAILED"`. **data.kbs\[].file** `object` File information for file-type knowledge base items. **data.kbs\[].file.file\_name** `string` Original filename. **data.kbs\[].file.file\_size** `number` File size in bytes. **data.kbs\[].file.file\_type** `string` MIME type of the file. **data.total** `number` Total number of knowledge base items in the organization. **errors** `null` Will be `null` on successful request. ```bash Basic Request theme={null} curl -X GET https://api.bland.ai/v1/knowledge \ -H "authorization: Bearer YOUR_API_KEY" ``` ```bash With Pagination theme={null} curl -X GET "https://api.bland.ai/v1/knowledge?page=2&limit=10" \ -H "authorization: Bearer YOUR_API_KEY" ``` ```json Success Response theme={null} { "data": { "kbs": [ { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T", "name": "Company FAQs", "description": "Frequently asked questions and policies", "status": "COMPLETED", "type": "FILE", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:32:00Z", "file": { "file_name": "company_faqs.pdf", "file_size": 2048576, "file_type": "application/pdf" } }, { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V6U", "name": "Product Documentation", "description": "Complete product documentation from website", "status": "PROCESSING", "type": "WEB_SCRAPE", "source_urls": "https://example.com/docs/overview,https://example.com/docs/api", "base_url": "https://example.com", "created_at": "2025-01-15T11:00:00Z", "updated_at": "2025-01-15T11:00:00Z" } ], "total": 15 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Knowledge Base Item Source: https://docs.bland.ai/api-v1/get/knowledge-id GET https://api.bland.ai/v1/knowledge/{knowledge_base_id} Retrieves a specific knowledge base item by ID. Returns detailed information about a specific knowledge base item, including its current status, metadata, and file information (if applicable). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **knowledge\_base\_id** `string` *required* The unique identifier of the knowledge base item to retrieve. ### Response **data** `object` The knowledge base item object. **data.id** `string` Unique identifier for the knowledge base item. **data.name** `string` Name of the knowledge base item. **data.description** `string` Description of the knowledge base item (if provided). **data.status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.type** `string` Type of knowledge base item: `"FILE"`, `"WEB_SCRAPE"`, or `"TEXT"`. **data.source\_urls** `string` Source URLs for web scrape type (comma-separated). **data.base\_url** `string` Base URL for web scrape type. **data.created\_at** `string` ISO timestamp of creation. **data.updated\_at** `string` ISO timestamp of last update. **data.error\_message** `string` Error message if status is `"FAILED"`. **data.file** `object` File information for file-type knowledge base items. **data.file.file\_name** `string` Original filename. **data.file.file\_size** `number` File size in bytes. **data.file.file\_type** `string` MIME type of the file. **errors** `null` Will be `null` on successful request. ```bash cURL theme={null} curl -X GET https://api.bland.ai/v1/knowledge/kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T \ -H "authorization: Bearer YOUR_API_KEY" ``` ```json Success Response theme={null} { "data": { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T", "name": "Company FAQs", "description": "Frequently asked questions and policies", "status": "COMPLETED", "type": "FILE", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:32:00Z", "file": { "file_name": "company_faqs.pdf", "file_size": 2048576, "file_type": "application/pdf" } }, "errors": null } ``` ```json Not Found Response theme={null} { "data": null, "errors": [ { "error": "KB_ERROR", "message": "KB not found or access denied" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Account Details Source: https://docs.bland.ai/api-v1/get/me GET https://api.bland.ai/v1/me Returns call data for your account. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **billing** `object` An object containing your billing data. Contains `current_balance` (number of credits), and `refill_to` if you have auto refill enabled. **status** `string` The status of your account. **total\_calls** `int` The total number of calls you've made. ```json Response theme={null} { "status": "active", "billing": { "current_balance": 99919.1210000034, "refill_to": null }, "total_calls": 9903 } ``` *** Docs for agents: [llms.txt](/llms.txt) # List All Memories Source: https://docs.bland.ai/api-v1/get/memory GET https://api.bland.ai/v1/memory Retrieve all memory stores associated with your account. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data** `object` Response data containing memories array. **data.memories** `array` Array of memory objects. **data.memories\[].id** `string` Unique identifier for the memory. **data.memories\[].name** `string` Name of the memory. **data.memories\[].created\_at** `string` ISO timestamp when the memory was created. **data.memories\[].user\_id** `string` User ID that owns this memory. **data.memories\[].memory\_duration** `null` Memory duration setting (currently null). ```json Response theme={null} { "data": { "memories": [ { "id": "12345678-1234-1234-1234-123456789012", "created_at": "2025-07-20T23:32:19.840Z", "user_id": "87654321-4321-4321-4321-210987654321", "name": "Customer Support", "memory_duration": null } ] }, "errors": null } ``` ### Error Responses ```json Error Response theme={null} { "data": null, "errors": [ { "error": "MEMORY_ERROR", "message": "Failed to retrieve memories." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Memory Changes Source: https://docs.bland.ai/api-v1/get/memory-changes GET https://api.bland.ai/v1/memory/changes Retrieve what memory was captured or updated during a specific call or SMS conversation. Shows the memory state before and after the interaction. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **call\_id** `string` The call ID to get memory changes for. Either `call_id` or `conversation_id` is required. **conversation\_id** `string` The SMS conversation ID to get memory changes for. Either `call_id` or `conversation_id` is required. ### Response **data** `object` Memory changes data. **data.initial\_memory** `object` The memory context at the start of the interaction. **data.changes** `object` Changes made to memory during the interaction. **data.memory\_history** `array` Historical record of memory updates. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "initial_memory": { "summary": "Customer previously inquired about pricing.", "facts": { "name": "John Doe" } }, "changes": { "summary": "Customer placed an order for the premium plan. Order #12345 confirmed.", "facts": { "name": "John Doe", "plan": "premium", "order_id": "12345" } }, "memory_history": [ { "timestamp": "2025-07-22T10:30:00.000Z", "type": "summary_update", "value": "Customer placed an order for the premium plan." } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Call or conversation not found, or no memory data available" } ] } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "call_id or conversation_id is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Contact Memory Source: https://docs.bland.ai/api-v1/get/memory-contact-id GET https://api.bland.ai/v1/memory/contact/{memory_id} Retrieve a contact's full memory record by ID, including their conversation summary, structured facts, recent messages, and open items. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the contact memory record. ### Response **data** `object` The contact memory object. **data.id** `string` Unique identifier for the contact memory. **data.org\_id** `string` Organization ID this memory belongs to. **data.contact\_id** `string` Contact ID this memory is associated with. **data.persona\_id** `string` Persona ID this memory is scoped to (null if agent-based). **data.agent\_number** `string` Agent phone number this memory is scoped to (null if persona-based). **data.summary** `string` Rolling summary of interactions with this contact. **data.facts** `object` Structured facts about the contact (key-value pairs). **data.recent\_messages** `array` Array of recent messages from the sliding window. **data.open\_items** `array` Array of open items or pending tasks. **data.memory\_history** `array` Historical record of memory updates. **data.created\_at** `string` ISO timestamp when the memory was created. **data.updated\_at** `string` ISO timestamp when the memory was last updated. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer called about order #8821 which was delayed. Follow-up confirmed the order shipped and is now in transit.", "facts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "sms", "timezone": "America/Los_Angeles" }, "recent_messages": [ { "role": "user", "content": "Hi, has my order shipped yet?", "channel": "sms", "timestamp": "2025-07-23T09:10:00.000Z" }, { "role": "assistant", "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.", "channel": "sms", "timestamp": "2025-07-23T09:10:05.000Z" } ], "open_items": [ { "type": "follow_up", "description": "Confirm delivery of order #8821 on July 25", "created_at": "2025-07-23T09:10:00.000Z", "priority": "medium", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ], "memory_history": [], "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-23T09:15:00.000Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Contact memory not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Recent Messages Source: https://docs.bland.ai/api-v1/get/memory-contact-id-messages GET https://api.bland.ai/v1/memory/contact/{memory_id}/messages Retrieve the recent message history for a contact memory. Returns cross-channel messages (voice and SMS) in chronological order. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the contact memory record. ### Response **data** `array` Array of recent messages. **data\[].role** `string` Message role: "user" or "assistant". **data\[].content** `string` Message content. **data\[].channel** `string` Channel the message came from: "call" or "sms". **data\[].timestamp** `string` ISO timestamp when the message was recorded. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": [ { "role": "user", "content": "Hi, I'm calling about my order", "channel": "call", "timestamp": "2025-07-22T10:30:00.000Z" }, { "role": "assistant", "content": "I'd be happy to help you with your order. Can you provide your order number?", "channel": "call", "timestamp": "2025-07-22T10:30:05.000Z" }, { "role": "user", "content": "It's order #12345", "channel": "sms", "timestamp": "2025-07-22T11:00:00.000Z" } ], "errors": null } ``` ```json Empty Messages theme={null} { "data": [], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Memory Context Source: https://docs.bland.ai/api-v1/get/memory-context GET https://api.bland.ai/v1/memory/context Retrieve the full memory context for a contact scoped to a persona or agent number. Returns everything the agent sees at the start of a conversation: summary, facts, recent messages, entities, and open items. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **contact\_id** `string` *required* The unique identifier of the contact. **persona\_id** `string` The persona ID for memory scoping. Either `persona_id` or `agent_number` is required. **agent\_number** `string` The agent phone number for memory scoping. Either `persona_id` or `agent_number` is required. ### Response **data** `object` The memory context object. **data.contact\_id** `string` The contact ID this memory belongs to. **data.recentMessages** `array` Array of recent messages from the sliding window (cross-channel). **data.recentMessages\[].role** `string` Message role: "user" or "assistant". **data.recentMessages\[].content** `string` Message content. **data.recentMessages\[].channel** `string` Channel the message came from: "call" or "sms". **data.recentMessages\[].timestamp** `string` ISO timestamp when the message was recorded. **data.summary** `string` Rolling summary of interactions with this contact. **data.contactFacts** `object` Structured facts about the contact (key-value pairs). **data.entities** `array` Array of extracted entities associated with this contact. **data.openItems** `array` Array of open items or pending tasks for this contact. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "recentMessages": [ { "role": "user", "content": "Has my order shipped yet?", "channel": "sms", "timestamp": "2025-07-23T09:10:00.000Z" }, { "role": "assistant", "content": "Yes, order #8821 shipped this morning. Expected delivery is Friday July 25.", "channel": "sms", "timestamp": "2025-07-23T09:10:05.000Z" } ], "summary": "Customer called about order #8821 which was delayed. Follow-up confirmed the order shipped and is now in transit. Expected delivery July 25.", "contactFacts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "sms", "timezone": "America/Los_Angeles" }, "entities": [ { "entity_type": "order", "entity_id": "order-8821", "facts": { "order_number": "#8821", "status": "in_transit", "carrier": "UPS", "expected_delivery": "2025-07-25" }, "status": "in_transit", "last_discussed_at": "2025-07-23T09:10:00.000Z", "notes": null } ], "openItems": [ { "type": "follow_up", "description": "Confirm delivery of order #8821 on July 25", "created_at": "2025-07-23T09:10:00.000Z", "priority": "medium", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ] }, "errors": null } ``` ```json No Memory Yet theme={null} { "data": { "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "recentMessages": [], "summary": null, "contactFacts": {}, "entities": [], "openItems": [] }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "persona_id or agent_number is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Memory Details Source: https://docs.bland.ai/api-v1/get/memory-memory-id GET https://api.bland.ai/v1/memory/{memory_id} Retrieve detailed information about a specific memory store and its users. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to retrieve. ### Response **data** `object` Detailed memory data organized by users. **data.memory\_id** `string` Unique identifier for the memory. **data.name** `string` Name of the memory. **data.created\_at** `string` ISO timestamp when the memory was created. **data.users** `array` Array of user objects with their associated data. **data.users\[].phone\_number** `string` The phone number associated with this memory entry. **data.users\[].created\_at** `string` ISO timestamp when this user was added to the memory. **data.users\[].call\_count** `number` Total number of calls with this phone number. **data.users\[].metadata** `string` Custom metadata text associated with this phone number. **data.users\[].last\_call\_at** `string|null` ISO timestamp of the most recent call with this phone number, or null if no calls yet. **data.users\[].summary** `string` AI-generated summary of interactions with this phone number. ```json Response theme={null} { "data": { "memory_id": "12345678-1234-1234-1234-123456789012", "name": "Customer Support", "created_at": "2025-07-20T23:32:19.840Z", "users": [ { "phone_number": "+12345678900", "created_at": "2025-07-21T07:09:04.372Z", "call_count": 0, "metadata": "25 year old customer from New York", "last_call_at": null, "summary": "Previous call discussion was on the topic of startups" } ] }, "errors": null } ``` ### Error Responses ```json Memory Not Found theme={null} { "data": null, "errors": [ { "error": "MEMORY_NOT_FOUND", "message": "Memory not found." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_ERROR", "message": "Failed to retrieve memory data." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Voice Models (v1) Source: https://docs.bland.ai/api-v1/get/models GET https://api.bland.ai/v1/models List the voice model generations used for cloning and the v1 voice catalog. ## Overview Returns the voice model generations (`BTTS_V3`, `BTTS_V2`, `BTTS`) with their clone eligibility and language list. Use it to map a voice's `service` field to its generation, or to check which generations support [Clone Voice](/api-v1/post/clone). > [!NOTE] > > Building on `/v2/tts`, `/v2/tts/ws`, or `/v2/audio/speech`? Use [List TTS Models](/api-v2/get/tts-models) instead. It returns the encodings, sample rates, containers, and controls those endpoints accept. The `sample_rates` and `max_characters` fields here describe the legacy v1 speak endpoints, not the v2 request limits. No authentication is required. Results are cached for up to 5 minutes. *** ## Headers **authorization** `string` Optional. This endpoint does not require authentication. *** ## Response **models** `array` Array of available models. **Model fields** **model\_id** `string` Engine identifier. Use this to map a voice's `service` field back to its model. **display\_name** `string` Human-readable name suitable for UI (for example `V1`, `V2`). **description** `string` Short description of the model's positioning. **sample\_rates** `number[]` Sample rates the legacy v1 speak endpoints support for this model. **max\_characters** `number` Maximum characters per synthesis request supported by the model. **can\_clone** `boolean` Whether [Clone Voice](/api-v1/post/clone) can produce voices on this model. **languages** `string[]` Language codes supported for synthesis. **is\_recommended** `boolean` `true` for the model Bland currently recommends for new integrations. ```json Response theme={null} { "models": [ { "model_id": "BTTS_V2", "display_name": "V2", "description": "Previous-generation TTS with multilingual output and instant single-sample cloning. Prefer V3 where its language support fits.", "sample_rates": [8000, 16000, 24000, 44100], "max_characters": 1000, "can_clone": true, "languages": ["en", "de", "es", "fr", "hi", "it", "ja", "ko", "nl", "pl", "pt", "ru", "tr", "zh", "ar", "id", "sv"] }, { "model_id": "BTTS_V3", "display_name": "V3", "description": "Current-generation TTS. Bland's recommended model for new voices and integrations.", "sample_rates": [24000, 44100], "max_characters": 1000, "can_clone": true, "languages": ["en"], "is_recommended": true }, { "model_id": "BTTS", "display_name": "V1", "description": "Legacy English-only TTS. Retained for backward compatibility. Prefer the recommended model for new integrations.", "sample_rates": [8000, 16000, 24000, 44100], "max_characters": 1000, "can_clone": true, "languages": ["en"] } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Node Test Run Source: https://docs.bland.ai/api-v1/get/node_test_run GET https://api.bland.ai/v1/node_tests/run/:id Retrieve a node test run. ### Path **id** `string` *required* The ID of the node test run to retrieve. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data.id** `string` Unique identifier for the node test run. **data.org\_id** `string` Organization ID that owns this node test run. **data.created\_at** `string` ISO timestamp when the node test run was created. **data.finished\_at** `string` ISO timestamp when the node test run finished. **data.status** `string` Current status of the node test run. Possible values are `"COMPLETED"`, `"PENDING"`, `"CANCELLED"`, and `"ERROR"`. **data.pathway\_id** `string` Identifier of the pathway this node belongs to. **data.node\_id** `string` Identifier of the node that was tested within the pathway. **data.input** `object` Input configuration used for this node test run. **data.input.prompt** `string` The instruction or system prompt used when testing the node. **data.input.conversations** `array` Array of conversation references used as context for the node test. **data.input.conversations\[].id** `string` Unique identifier of a conversation used in the test. **data.input.conversations\[].type** `string` The type of conversation (for example, `"call"`). **data.result** `array` Array of result objects, one per evaluated conversation. **data.result\[].conversation\_id** `string` ID of the conversation this result corresponds to. **data.result\[].total\_generations** `number` Total number of generations produced for this conversation during the test run. For example, if I invoke the test with 5 permutations, then this value will be 6, since we need to generate 5 simulations for the permutations and one generation for the original user messages. **data.result\[].data** `array` Array of generation batches for this conversation. **data.result\[].data\[].is\_original** `boolean` If true, then this result is the original user and agent interaction on the node. **data.result\[].data\[].is\_permutation** `boolean` If true, then this result is a generation using a permutation/variant of the original user inputs. **data.result\[].data\[].output** `array` Ordered list of message turns (user/assistant) in this generated interaction. **data.result\[].data\[].output\[].role** `string` Role of the message author (`"user"` or `"assistant"`). **data.result\[].data\[].output\[].node\_id** `string` Node identifier associated with this message turn. **data.result\[].data\[].output\[].content** `string` Text content of the message. **data.result\[].generating\_new\_prompt** `boolean` An indicator to show if the system is in the process of simulating the agent response with the new prompt and original user inputs. **data.result\[].generating\_permutations** `boolean` An indicator to show if the system is in the process of simulating the agent response with the new prompt and user permutations. ```json Response theme={null} { "data": { "id": "727a85f1-1959-4ec1-95a4-248a2eecf1ae", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "created_at": "2025-11-17T14:47:40.174Z", "finished_at": "2025-11-17T14:48:11.399Z", "status": "COMPLETED", "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad", "node_id": "a7bbd409-504b-4ba3-a9d1-12f6bc270f58", "input": { "prompt": "Tell the user how cool they are and also what they think of the month of December", "conversations": [ { "id": "b7d1eab7-f9a2-4e4d-b3ac-4e744cf93d2b", "type": "call" }, { "id": "f9b44639-4de1-48d9-97ed-08b7fcb6eb1c", "type": "call" }, { "id": "8c361b43-efa2-49e2-84a2-60ede375161b", "type": "call" }, { "id": "a915cdce-fd3e-4f9f-b0bd-b5f6ee03ef1f", "type": "call" } ] }, "result": [ { "conversation_id": "b7d1eab7-f9a2-4e4d-b3ac-4e744cf93d2b", "data": [ { "output": [ { "role": "user", "node_id": "4f74e9a9-6d06-4756-8379-4d06220a4bda", "content": "I work at a company that makes boats. I'm a boat builder." }, { "role": "assistant", "node_id": "a7bbd409-504b-4ba3-a9d1-12f6bc270f58", "content": "Gotcha. Okay, so, uh, what would you say are your biggest strengths?" } ], "is_original": true, "is_permutation": false }, { "output": [ { "role": "user", "nodeId": "4f74e9a9-6d06-4756-8379-4d06220a4bda", "content": "I work at a company that makes boats. I'm a boat builder." }, { "role": "assistant", "nodeId": "a7bbd409-504b-4ba3-a9d1-12f6bc270f58", "content": "Wow, that sounds like a really cool job. That's pretty unique. You must have some interesting stories. Anyways, what would you say are your biggest strengths?" } ], "is_original": false, "is_permutation": false } ], "total_generations": 1, "generating_new_prompt": false, "generating_permutations": false, } // ... ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Organization Billing Information Source: https://docs.bland.ai/api-v1/get/org_billing_information GET https://api.bland.ai/v1/orgs/{org_id}/billing Retrieve the current billing details for an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. ### Response **data** `object` The billing details of the organization. **data.current\_balance** `number` The current account balance of the organization. **data.refill\_amount** `number | null` The amount to which the balance will be refilled, or `null` if refilling is not enabled. **data.refill\_at** `number | null` The threshold at which the account will be refilled, or `null` if refilling is not enabled. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "current_balance": 20.711, "refill_amount": null, "refill_at": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Organization Billing Refill Information Source: https://docs.bland.ai/api-v1/get/org_billing_refill_information GET https://api.bland.ai/v1/orgs/{org_id}/billing/refill Retrieve the recharge amount for an organization's billing. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. ### Response **data** `number | null` The amount to which the balance will be recharged, or `null` if refilling is not enabled. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": 50.00, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Organization's Current Service Version Source: https://docs.bland.ai/api-v1/get/org_current_version GET https://api.bland.ai/v1/orgs/{org_id}/versions/{service}/current Retrieve the current version of a specified service for an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. **service** `string` *required* The name of the service whose version you want to retrieve.\ \ Valid values: `"api_server"`, `"ws_server"` ### Response **data** `object` Contains the current version of the requested service. **data.version** `string` The current version identifier of the service. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "version": "adf1064d-5080-4055-8493-0d4fdc3c8106" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get User Organization Memberships Source: https://docs.bland.ai/api-v1/get/org_list_self_memberships GET https://api.bland.ai/v1/orgs/self/memberships Retrieve a list of organizations the authenticated user is a member of. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data** `array` A list of organizations the user belongs to. **data\[].org\_id** `string` The unique identifier of the organization. **data\[].org\_slug** `string` The unique slug identifier of the organization. **data\[].org\_display\_name** `string` The display name of the organization. **data\[].permissions** `string[]` The permissions assigned to the user within the organization.\ \ Valid values: `"owner"`, `"admin"`, `"operator"`, `"viewer"` **data\[].is\_owner** `boolean` Whether the user is the owner of the organization. **data\[].is\_org\_creator** `boolean` Whether the user originally created the organization. **data\[].joined\_at** `string (ISO 8601)` The timestamp of when the user joined the organization. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": [ { "org_id": "d6b149e1-f971-4641-8d28-64fdf78368af", "org_slug": "a7d49dbc-025c-4e80-9c92-c45c519f4939", "org_display_name": "Org Name", "permissions": ["owner"], "is_owner": true, "is_org_creator": true, "joined_at": "2024-11-14T21:28:05.915Z" }, { "org_id": "d122b4cf-1614-4124-aa28-15f81a09988f", "org_slug": "133906ea-d750-4a15-80fa-d6aef584dc58", "org_display_name": "Org Name2", "permissions": ["owner"], "is_owner": true, "is_org_creator": true, "joined_at": "2025-02-14T06:46:11.274Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Organization's Service Versions Source: https://docs.bland.ai/api-v1/get/org_list_versions GET https://api.bland.ai/v1/orgs/{org_id}/versions/{service}/list Retrieve a list of available versions for a specified service within an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. **service** `string` *required* The name of the service whose versions you want to retrieve.\ \ Valid values: `"api_server"`, `"ws_server"` ### Response **data** `object` Contains the list of available versions for the requested service. **data.versions** `array` An array of available versions. **data.versions\[].id** `string` The unique identifier of the version. **data.versions\[].friendly\_name** `string` A human-readable name for the version. **data.versions\[].created\_at** `string (ISO 8601)` The timestamp when the version was created. **data.versions\[].git\_sha** `string` The Git SHA hash of the version. **data.versions\[].tags** `array` Tags categorizing the version, e.g., `["latest"]`, `["stable"]`. **data.versions\[].currently\_supported** `boolean` Whether this version is currently supported. **data.versions\[].recommended\_upgrade\_to** `string | null` The recommended version to upgrade to, if applicable. **data.versions\[].service** `string` The name of the service this version belongs to. **data.versions\[].placement\_group** `string` The placement group of this version. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "versions": [ { "created_at": "2024-11-28T19:05:17.003Z", "git_sha": "", "friendly_name": "Latest", "tags": ["latest"], "currently_supported": true, "recommended_upgrade_to": null, "service": "api_server", "id": "adf1064d-5080-4055-8493-0d4fdc3c8106", "placement_group": "blandshared" }, { "created_at": "2024-11-27T00:28:30.286Z", "git_sha": "", "friendly_name": "v1.0.1", "tags": ["stable"], "currently_supported": true, "recommended_upgrade_to": null, "service": "api_server", "id": "a46f516b-b01f-4ea6-9c7b-5b05fca49d4f", "placement_group": "blandshared" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Organization Members Source: https://docs.bland.ai/api-v1/get/org_members GET https://api.bland.ai/v1/orgs/{org_id}/members Retrieve the list of members in an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization whose members you want to retrieve. ### Response **data** `array` A list of members in the organization. **data.org\_id** `string` The unique identifier of the organization. **data.user\_id** `string` The unique identifier of the user. **data.permissions** `array` The permissions assigned to the user within the organization. **data.is\_owner** `boolean` Indicates whether the user is the owner of the organization. **data.is\_org\_creator** `boolean` Indicates whether the user originally created the organization. **data.joined\_at** `string (ISO 8601)` The timestamp of when the user joined the organization. **data.first\_name** `string` The first name of the organization member. **data.last\_name** `string` The last name of the organization member. **data.combo\_id** `string` A unique identifier combining the organization and user ID. **data.org\_slug** `string` The unique slug identifier of the organization. **data.org\_display\_name** `string` The display name of the organization. **data.member\_email** `string` The email address of the organization member. **data.member\_phone\_number** `string` The phone number of the organization member. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": [ { "org_id": "d122b4cf-1614-4124-aa28-15f81a09988f", "user_id": "d6b149e1-f971-4641-8d28-64fdf78368af", "permissions": ["owner"], "is_owner": true, "is_org_creator": true, "joined_at": "2025-02-14T06:46:11.274Z", "first_name": "John", "last_name": "Smith", "combo_id": "d122b4cf-1614-4124-aa28-15f81a09988f::d6b149e1-f971-4641-8d28-64fdf78368af", "org_slug": "133906ea-d750-4a15-80fa-d6aef584dc58", "org_display_name": "Org Name", "member_email": "johnsmith@gmail.com", "member_phone_number": "+1234567890" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Organization Source: https://docs.bland.ai/api-v1/get/orgs GET https://api.bland.ai/v1/orgs/{org_id} Retrieve details of an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization to retrieve. ### Response **data** `object` The details of the organization. **data.id** `string` The unique identifier of the organization. **data.org\_slug** `string` The unique slug identifier of the organization. **data.org\_display\_name** `string` The display name of the organization. **data.org\_image\_url** `string | null` URL of the organization's image (if set). **data.org\_plan** `string` The organization's plan. Default: `"starter"`. **data.org\_creation\_date** `string (ISO 8601)` The timestamp of when the organization was created. **data.kyc\_level** `integer` The KYC (Know Your Customer) verification level. Default: `0`. **data.placement\_group** `string` The placement group of the organization. Default: `"blandshared"`. **data.is\_deleted** `boolean` Whether the organization is deleted. Default: `false`. **data.is\_stripe\_overdue** `boolean` Whether the organization has overdue Stripe payments. Default: `false`. **data.is\_suspended** `boolean` Whether the organization is suspended. Default: `false`. **data.org\_rate\_limit** `integer` The organization's request rate limit. Default: `5`. **data.org\_type** `string` The type of the organization. Default: `"normal"`. **data.entitlements** `array` A list of entitlements granted to the organization. Default: `[]`. **data.preferences.use\_bland\_url** `boolean` Whether the organization prefers to use the Bland URL. Default: `true`. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "id": "d122b4cf-1614-4124-aa28-15f81a09988f", "org_slug": "133906ea-d750-4a15-80fa-d6aef584dc58", "org_display_name": "Org Name", "org_image_url": null, "org_plan": "starter", "org_creation_date": "2025-02-14T06:46:09.818Z", "kyc_level": 0, "placement_group": "blandshared", "is_deleted": false, "is_stripe_overdue": false, "is_suspended": false, "org_rate_limit": 5, "org_type": "normal", "entitlements": [], "preferences": { "use_bland_url": true } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Single Pathway Information Source: https://docs.bland.ai/api-v1/get/pathway GET https://api.bland.ai/v1/pathway/{pathway_id} Returns a set of information about the conversational pathway in your account - including the name, description, nodes and edges. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The unique identifier of the conversational pathway for which you want to retrieve detailed information. ### Response **name** `string` The name of the conversational pathway. **description** `string` A description of the conversational pathway. **nodes** `array of objects` Data about all the nodes in the pathway. Examples of JSON objects for nodes (Horizontal scroll the tab bar to see more examples) ```json Start Node theme={null} { "id": "1", "type": "Default" "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, ``` ```json Default Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "New Node", "text": "Select a node or edge and press backspace to remove it", "globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM.", }, } ``` ```json End Node theme={null} { "id": "randomnode_1710288752186", "type": "End Call" "data": { "name": "End call", "prompt": "Say goodbye to the user", }, } ``` ```json Webhook Node theme={null} { "id": "randomnode_1710288752186", "type": "Webhook", "data": { "url": "https://api.bland.ai/reservation", "body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}", "name": "Reservation Booking", "text": "Please give me a moment as I check our bookings..", "method": "POST", "extractVars": [ [ "date", "string", "Desired Date of reservation, in MM/DD/YYYY format" ], [ "time", "string", "Desired Time of Reservation in 24HR Format e.g 13:30" ], [ "number_of_people", "integer", "Number of people for the reservation" ] ], "responseData": [ { "data": "$.reserved", "name": "reservation_success", "context": "" }, { "data": "$.available_slots", "name": "available_slots", "context": "Available slots for the date provided" } ], "responsePathways": [ [ "reservation_success", "==", "true", { "id": "randomnode_1710288752186", "name": "Reservation Successful" } ], [ "reservation_success", "==", "false", { "id": "randomnode_1712265110018", "name": "Find new timeslot" } ] ] } } ``` ```json Knowledge Base Node theme={null} { "id": "randomnode_1710288752186", "type": "Knowledge Base", "data": { "name": "Restaurant Questions", "prompt": "Answer any questions that the user may have regarding the restaurant, by referring to the knowledge base you have. \n\nAnswer the question in 1 line, and then ask if they have any more questions." "kb": "Opening Hours : 9am - 5pm\nStore Locations : \n426 Ivy Street San Francisco, \nSan Jose" } } ``` ```json Global Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "Answer any questions", "prompt": "You are to answer any questions the user has.", "isGlobal": true, "globalLabel": "user asks a question" }, } ``` ```json Transfer Call Node theme={null} { "id": "randomnode_1710288752186", "type": "Transfer Call", "data": { "name": "Transferring the call", "text": "Transferring the call now. Please hold.." "transferNumber": "+19547951234" } } ``` > [accordion] Node Data Object Parameters > > * `name` > — name of the node > * `isStart` > — whether the node is the start node. There can only be 1 start node in a pathway. Either `true` or `false`. > * `isGlobal` > — whether the node is a global node. Global nodes are nodes that can be used in multiple pathways. Either `true` or `false`. > * `globalLabel` > — the label of the global node. Should be present if `isGlobal` is true. > * `type` > — Type of the node. Can be `Default`, `End Call`, `Transfer Node`, `Knowledge Base`, or `Webhook`. > * `text` > — If static text is chosen, this is the text that will be said to the user. > * `prompt` > — If dynamic text is chosen, this is the prompt that will be shown to the user. > * `condition` > — The condition that needs to be met to proceed from this node. > * `transferNumber` > * If the node is a transfer node, this is the number to which the call will be transferred. > * `kb` > * If the node is a knowledge base node, this is the knowledge base item that will be used. > * `pathwayExamples` > * The fine-tuning examples for the agent at this node for the pathways chosen > * `conditionExamples` > * The fine-tuning examples for the condition at this node for the condition chosen > * `dialogueExamples` > * The fine-tuning examples for the dialogue at this node for the dialogue chosen. > * `modelOptions` > * `interruptionThreshold` > — The sensitivity to interruptions at this node > * `temperature` > — The temperature of the model. > * `extractVars` > * An array of array of strings. \[\[`varName`, `varType`, `varDescription`]] e.g `[["name", "string", "The name of the user"], ["age", "integer", "The age of the user"]]` **edges** `array of objects` Data about all the edges in the pathway. > [accordion] Edge Object Parameters > > * `id` > — unique id of the edge > * `source` > — id of the source node > * `target` > — id of the target node > * `label` > — Label for this edge. This is what the agent will use to decide which path to take. ```json Response theme={null} { "name": "Default Demo Pathway", "description": null, "nodes": [ { "id": "1", "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, "type": "Default" }, { "id": "randomnode_1710288752186", "data": { "name": "End call", "prompt": "Click 'Add New Node' on the right to add a new node", }, "type": "End Call" }, { "id": "randomnode_1710288871721", "data": { "name": "New Node", "text": "Select a node or edge and press backspace to remove it", }, "type": "Default" }, { "id": "randomnode_test123", "data": { "name": "Testing node", "text": "Hello there" }, "type": "Default" } ], "edges": [ { "id": "reactflow__edge-1-randomnode_1710288752186", "label": "greeted", "source": "1", "target": "randomnode_1710288752186" }, { "id": "reactflow__edge-1-randomnode_1710288871721", "label": "New Edge", "source": "1", "target": "randomnode_1710288871721" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Pathway Chat Source: https://docs.bland.ai/api-v1/get/pathway-chat GET https://us.api.bland.ai/v1/pathway/chat/{id} Get conversation history for a pathway chat. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `uuid` *required* The chat ID created from the /pathway/chat/create endpoint. ### Response **errors** `array` List of errors or null. **data** `array` Message objects for the conversation history. ```json Response theme={null} { data: [ { "role": "user", "content": "message" }, ... // more messages ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Pathway Generation Status Source: https://docs.bland.ai/api-v1/get/pathway-generate-status-job-id GET https://api.bland.ai/v1/pathway/generate/status/{job_id} Poll pathway generation status and retrieve the generated pathway ID when ready. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **job\_id** `string` *required* The `jobId` returned by `POST /v1/pathway/generate`. ### How polling works * The first status request can return `ready: false` while the server begins processing. * Continue polling until `data.ready` is `true`. * On success, the response includes `pathway_id`. * On failure, the response includes `error`. ### Response **data** `object` Generation state object. **data.ready** `boolean` `false` while generation is still in progress, `true` when processing is complete. **data.pathway\_id** `string` Present when generation succeeds and `ready` is `true`. **data.error** `string` Present when generation fails and `ready` is `true`. **errors** `null | array` `null` on success responses, or a list of errors for invalid/unauthorized requests. ```json Not Ready theme={null} { "data": { "ready": false }, "errors": null } ``` ```json Ready (Success) theme={null} { "data": { "ready": true, "pathway_id": "a6c24531-75b1-4334-95b2-2d0f11e8fe41" }, "errors": null } ``` ```json Ready (Failed) theme={null} { "data": { "ready": true, "error": "Prompt flagged for inappropriate content." }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "error": "PATHWAY_GENERATION_FAILED", "message": "Job not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Pathway Session Token Source: https://docs.bland.ai/api-v1/get/pathway-session GET https://api.bland.ai/v1/pathway/session Creates a new pathway session token for the authenticated user. This token can be used to access pathway chat and expires after 1 hour. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **token** `string` The generated pathway session token. **expires\_at** `string` ISO 8601 timestamp indicating when the token expires (1 hour from creation). ### Response Codes **201** `success` Token created successfully. **401** `error` Unauthorized - User authentication required. **500** `error` Internal server error - Token creation failed or unexpected error occurred. ```json Success Response theme={null} { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expires_at": "2024-01-15T15:30:00.000Z" } ``` ```json Error Response (401) theme={null} { "errors": [ { "error": "UNAUTHORIZED", "message": "User authentication required" } ] } ``` ```json Error Response (500) theme={null} { "errors": [ { "error": "TOKEN_CREATION_FAILED", "message": "Failed to create pathway session token" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Pathway Call Events Source: https://docs.bland.ai/api-v1/get/pathway_calls GET https://api.bland.ai/v1/pathway_calls/{call_id} Retrieve the pathway event timeline for a call — transcripts, node transitions, webhooks, tools, variable extraction, and every other side effect. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **call\_id** `string` *required* The unique identifier of the call whose pathway events you want to retrieve. ### Query Parameters **v** `string` *required* Set to `2` to receive the pathway events format documented here. Omitting it returns the deprecated legacy log format, which is being phased out — always pass `v=2`. ### Response The response is a JSON array of event objects, one per event in the call, ordered by `sequence`. See [Pathway Call Events](/tutorials/pathway-call-events) for the full catalog of event types and per-type payload shapes. **conversation\_id** `string` The call id. All events for one call share it. **sequence** `number` The ordering key within the call. Always sort by `sequence`, not `created_at`. Gaps are normal and do not indicate missing data. **event\_type** `string` What happened. Either a standalone event (`conversation.init`, `node.transition`, `transcript.user`, `transcript.assistant`, `node.tag`, `interrupt.early`, `interrupt.late`, `button.press`, `llm.action`) or an operation event of the form `operation.phase`, where the operation is one of `webhook`, `tool`, `kb`, `sms`, `scheduling`, `loop_condition`, `var_extraction`, `custom_code`, `transfer_pathway`, `transfer_call`, `unit_test` and the phase is `invoke`, `result`, `error`, or `warning` (plus `webhook.mapping` for variable-mapping outcomes). **node\_id** `string | null` The pathway node that was active when the event fired. `null` before the first node is entered. **operation\_id** `number | null` Correlation key for multi-event operations: a `result`, `error`, `warning`, or `mapping` event carries the `sequence` of the `invoke` event it belongs to. `null` when there's nothing to correlate. **payload** `object | null` Event-type-specific data. Payload shapes for every event type are documented in [Pathway Call Events](/tutorials/pathway-call-events). **created\_at** `string` ISO 8601 timestamp of the event. Use for timing display; use `sequence` for ordering. ```bash cURL theme={null} curl --request GET \ --url 'https://api.bland.ai/v1/pathway_calls/d2b58344-7fd1-4787-9bf9-1c23e82fd8ff?v=2' \ --header 'authorization: Bearer YOUR_API_KEY' ``` ```json Response theme={null} [ { "conversation_id": "d2b58344-7fd1-4787-9bf9-1c23e82fd8ff", "sequence": 0, "event_type": "conversation.init", "node_id": null, "operation_id": null, "payload": { "pathway_id": "pw_123", "start_node_id": "node_start", "version": "12", "initial_variables": { "customer_name": "Ada" } }, "created_at": "2026-08-03T17:04:01.120Z" }, { "conversation_id": "d2b58344-7fd1-4787-9bf9-1c23e82fd8ff", "sequence": 6, "event_type": "webhook.invoke", "node_id": "node_order_lookup", "operation_id": null, "payload": { "url": "https://api.example.com/orders/lookup", "method": "POST", "tool_name": "Lookup Order", "response_mappings": [ { "name": "order_status", "path": "$.status" } ] }, "created_at": "2026-08-03T17:04:09.100Z" }, { "conversation_id": "d2b58344-7fd1-4787-9bf9-1c23e82fd8ff", "sequence": 7, "event_type": "webhook.result", "node_id": "node_order_lookup", "operation_id": 6, "payload": { "url": "https://api.example.com/orders/lookup", "status": 200, "body": { "status": "shipped" }, "duration_ms": 412 }, "created_at": "2026-08-03T17:04:09.520Z" } ] ``` # Get All Folders Source: https://docs.bland.ai/api-v1/get/pathway_folders GET https://us.api.bland.ai/v1/pathway/folders Retrieves all folders for the authenticated user, including folder ID, name, and parent folder ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **folders** `array` An array of folder objects. **folders\[].id** `string` The unique identifier of the folder. **folders\[].name** `string` The name of the folder. **folders\[].parent\_folder\_id** `string` The ID of the parent folder, if applicable. ```json Response theme={null} { "folders": [ { "id": "folder_123", "name": "My Folder", "parent_folder_id": null }, { "id": "folder_456", "name": "Subfolder", "parent_folder_id": "folder_123" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Specific Pathway Version Source: https://docs.bland.ai/api-v1/get/pathway_version GET https://api.bland.ai/v1/pathway/{pathway_id}/version/{version_id} Retrieves a specific version of a pathway, including its name, nodes, edges, version number, and latest status. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The ID of the pathway. **version\_id** `string` *required* The ID of the version to retrieve. Use 0 for the live pathway. ### Response **name** `string` The name of the pathway version. **nodes** `array of objects` Data about all the nodes in the pathway version. > [accordion] Node Object Parameters > > * `id` — Unique identifier of the node > * `type` — Type of the node (e.g., "Default", "End Call", "Webhook") > * `data` — Object containing node-specific data > * `name` — Name of the node > * `text` or `prompt` — Text or prompt associated with the node > * Other properties specific to the node type **edges** `array of objects` Data about all the edges in the pathway version. > [accordion] Edge Object Parameters > > * `id` — Unique identifier of the edge > * `source` — ID of the source node > * `target` — ID of the target node > * `label` — Label for this edge **version\_number** `integer` The version number of this pathway version. **is\_latest** `boolean` Indicates whether this is the latest version of the pathway. ```json Response theme={null} { "name": "Customer Support Flow v2", "nodes": [ { "id": "1", "type": "Default", "data": { "name": "Start", "text": "Hello! How can I assist you today?", "isStart": true } }, { "id": "2", "type": "End Call", "data": { "name": "End call", "prompt": "Thank you for contacting us. Have a great day!" } } ], "edges": [ { "id": "edge-1-2", "source": "1", "target": "2", "label": "Issue resolved" } ], "version_number": 2, "is_latest": true } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Pathway Versions Source: https://docs.bland.ai/api-v1/get/pathway_versions GET https://api.bland.ai/v1/pathway/{pathway_id}/versions Retrieves all versions of a specific pathway, including version number, creation date, name, and latest status. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The ID of the pathway for which to retrieve versions. ### Response **id** `string` The unique identifier of the pathway version. **version\_number** `integer` The version number of this pathway version. **created\_at** `string` The timestamp when this version was created. **name** `string` The name of this pathway version. **is\_latest** `boolean` Indicates whether this is the latest version of the pathway. ```json Response theme={null} [ { "id": "v1_abc123", "version_number": 1, "created_at": "2024-03-05T12:00:00Z", "name": "Initial Version", "is_latest": false }, { "id": "v2_def456", "version_number": 2, "created_at": "2024-03-06T14:30:00Z", "name": "Updated Flow", "is_latest": true } ] ``` *** Docs for agents: [llms.txt](/llms.txt) # List Personas Source: https://docs.bland.ai/api-v1/get/personas GET https://api.bland.ai/v1/personas Retrieve a list of all personas in your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **page** `integer` (default: 1) Page number for pagination. **limit** `integer` (default: 20) Number of personas to return per page (max 100). ### Response **data** `array` Array of persona objects. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose. **tags** `array` Array of tags associated with the persona. **image\_url** `string` URL of the persona's profile image (null if none). **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **deleted\_at** `string` ISO 8601 timestamp of when the persona was deleted (null if active). **user\_id** `string` ID of the user who owns this persona. **current\_production\_version\_id** `string` ID of the current production version. **current\_draft\_version\_id** `string` ID of the current draft version. **inbound\_numbers** `array` Array of inbound phone numbers using this persona. **current\_production\_version** `object` Complete production version object. **version object** **id** `string` Version identifier. **persona\_id** `string` Parent persona identifier. **version\_type** `string` Type of version: `production` or `draft`. **version\_number** `integer` Sequential version number. **orchestration\_prompt** `string` Orchestration prompt (null if none). **personality\_prompt** `string` Personality and behavior prompt. **pathway\_conditions** `array` Array of pathway routing conditions. **kb\_ids** `array` Array of knowledge base item IDs. **call\_config** `object` Call configuration settings. **default\_tools** `array` Array of default tools enabled. **promoted\_from\_version\_id** `string` Version ID this was promoted from (null if initial). **promoted\_at** `string` When this version was promoted to production. **promoted\_by** `string` User who promoted this version (null if auto). **created\_at** `string` When this version was created. **updated\_at** `string` When this version was last updated. **current\_draft\_version** `object` Complete draft version object (same structure as production version). **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": [ { "id": "12345678-1234-1234-1234-123456789012", "name": "Customer Support Agent", "role": "Customer Support", "description": "A capable customer support agent", "tags": ["Customer Support"], "image_url": null, "created_at": "2025-09-16T23:54:44.420Z", "updated_at": "2025-09-16T23:54:59.896Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789012", "inbound_numbers": [], "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful customer support agent", "pathway_conditions": null, "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-16T23:54:44.441Z", "promoted_by": null, "created_at": "2025-09-16T23:54:44.442Z", "updated_at": "2025-09-16T23:54:44.442Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful customer support agent", "pathway_conditions": [ { "name": "", "prompt": "", "pathway_id": "", "start_node_id": "", "pathway_version": "" }, { "name": "", "prompt": "", "pathway_id": "", "start_node_id": "", "pathway_version": "" } ], "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-16T23:54:44.463Z", "updated_at": "2025-09-16T23:54:59.917Z" } }, { "id": "12345678-1234-1234-1234-123456789013", "name": "Sales Representative", "role": "Sales", "description": "A capable sales representative", "tags": ["Sales"], "image_url": null, "created_at": "2025-09-23T14:40:01.089Z", "updated_at": "2025-09-23T14:40:01.153Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789012", "inbound_numbers": [], "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789013", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful sales representative", "pathway_conditions": null, "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-23T14:40:01.109Z", "promoted_by": null, "created_at": "2025-09-23T14:40:01.110Z", "updated_at": "2025-09-23T14:40:01.110Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789013", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful sales representative", "pathway_conditions": null, "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-23T14:40:01.132Z", "updated_at": "2025-09-23T14:40:01.132Z" } } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Persona Source: https://docs.bland.ai/api-v1/get/personas-id GET https://api.bland.ai/v1/personas/{persona_id} Retrieve a specific persona. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona to retrieve. ### Response **data** `object` The persona object. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose. **tags** `array` Array of tags associated with the persona. **image\_url** `string` URL of the persona's profile image (null if none). **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **deleted\_at** `string` ISO 8601 timestamp of when the persona was deleted (null if active). **user\_id** `string` ID of the user who owns this persona. **current\_production\_version\_id** `string` ID of the current production version. **current\_draft\_version\_id** `string` ID of the current draft version. **inbound\_numbers** `array` Array of inbound phone numbers using this persona. **current\_production\_version** `object` Complete production version object. **version object** **id** `string` Version identifier. **persona\_id** `string` Parent persona identifier. **version\_type** `string` Type of version: `production` or `draft`. **version\_number** `integer` Sequential version number. **orchestration\_prompt** `string` Orchestration prompt (null if none). **personality\_prompt** `string` Personality and behavior prompt. **pathway\_conditions** `array` Array of pathway routing conditions. **kb\_ids** `array` Array of knowledge base item IDs. **call\_config** `object` Call configuration settings. **default\_tools** `array` Array of default tools enabled. **promoted\_from\_version\_id** `string` Version ID this was promoted from (null if initial). **promoted\_at** `string` When this version was promoted to production. **promoted\_by** `string` User who promoted this version (null if auto). **created\_at** `string` When this version was created. **updated\_at** `string` When this version was last updated. **current\_draft\_version** `object` Complete draft version object (same structure as production version). **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Customer Support Agent", "role": "Customer Support", "description": "A capable customer support agent", "tags": ["Customer Support"], "image_url": null, "created_at": "2025-09-16T23:54:44.420Z", "updated_at": "2025-09-16T23:54:59.896Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789012", "inbound_numbers": [], "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful customer support agent", "pathway_conditions": null, "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-16T23:54:44.441Z", "promoted_by": null, "created_at": "2025-09-16T23:54:44.442Z", "updated_at": "2025-09-16T23:54:44.442Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a friendly and helpful customer support agent", "pathway_conditions": [ { "name": "", "prompt": "", "pathway_id": "", "start_node_id": "", "pathway_version": "" }, { "name": "", "prompt": "", "pathway_id": "", "start_node_id": "", "pathway_version": "" } ], "kb_ids": [], "call_config": { "voice": "June", "record": true, "language": "en-US", "background": "office", "max_duration": 30, "wait_for_greeting": false, "interruption_threshold": 500 }, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-16T23:54:44.463Z", "updated_at": "2025-09-16T23:54:59.917Z" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Persona Versions Source: https://docs.bland.ai/api-v1/get/personas-id-versions GET https://api.bland.ai/v1/personas/{persona_id}/versions Retrieve all versions of a specific persona. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona whose versions to retrieve. ### Response **data** `array` Array of version objects ordered by version number (newest first). **version object** **id** `string` Unique identifier for this version. **persona\_id** `string` ID of the parent persona. **version\_type** `string` Version type: `production`, `draft`, or `archived`. **version\_number** `integer` Sequential version number. **orchestration\_prompt** `string` Orchestration prompt for this version (null if none). **personality\_prompt** `string` Personality and behavior prompt for this version. **pathway\_conditions** `array` Array of pathway routing conditions (null if none). **kb\_ids** `array` Array of knowledge base item IDs connected to this version. **call\_config** `object` Call configuration settings (null if none). **default\_tools** `array` Array of default tools enabled for this version. **promoted\_from\_version\_id** `string` Version ID this was promoted from (null if initial). **promoted\_at** `string` When this version was promoted to production (null if not promoted). **promoted\_by** `string` User who promoted this version (null if auto or not promoted). **created\_at** `string` When this version was created. **updated\_at** `string` When this version was last updated. **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": [ { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-23T15:13:36.390Z", "updated_at": "2025-09-23T15:13:36.390Z" }, { "id": "12345678-1234-1234-1234-123456789013", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-23T15:13:36.368Z", "promoted_by": null, "created_at": "2025-09-23T15:13:36.369Z", "updated_at": "2025-09-23T15:13:36.369Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Specific Persona Version Source: https://docs.bland.ai/api-v1/get/personas-id-versions-version-id GET https://api.bland.ai/v1/personas/{persona_id}/versions/{version_id} Retrieve a specific persona version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona. **version\_id** `string` *required* The specific version identifier to retrieve (e.g., "v1.2", "draft", "production"). ### Response **data** `object` The specific version object. **version object** **id** `string` Unique identifier for this version. **persona\_id** `string` ID of the parent persona. **version\_type** `string` Version type: `production`, `draft`, or `archived`. **version\_number** `integer` Sequential version number. **orchestration\_prompt** `string` Orchestration prompt for this version (null if none). **personality\_prompt** `string` Personality and behavior prompt for this version. **pathway\_conditions** `array` Array of pathway routing conditions (null if none). **kb\_ids** `array` Array of knowledge base item IDs connected to this version. **call\_config** `object` Call configuration settings (null if none). **default\_tools** `array` Array of default tools enabled for this version. **promoted\_from\_version\_id** `string` Version ID this was promoted from (null if initial). **promoted\_at** `string` When this version was promoted to production (null if not promoted). **promoted\_by** `string` User who promoted this version (null if auto or not promoted). **created\_at** `string` When this version was created. **updated\_at** `string` When this version was last updated. **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789013", "version_type": "archived", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-23T15:13:36.368Z", "promoted_by": null, "created_at": "2025-09-23T15:13:36.369Z", "updated_at": "2025-09-23T15:55:57.234Z" }, "errors": null } ``` ```json Error Response (Version Not Found) theme={null} { "error": { "code": "VERSION_NOT_FOUND", "message": "Version 'v2.0' not found for persona '12345678-1234-1234-1234-123456789012'", "details": { "persona_id": "12345678-1234-1234-1234-123456789012", "requested_version": "v2.0", "available_versions": ["v1.0", "v1.1", "v1.2", "v1.3-draft"], "current_production": "v1.2", "current_draft": "v1.3-draft" } } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Post Call Webhook Source: https://docs.bland.ai/api-v1/get/postcall-webhooks-get GET https://api.bland.ai/v1/postcall/webhooks/{call_id} Get the post call webhook data for a specific call. ## Overview Retrieve the post call webhook data for a specific call using its call ID. This endpoint returns the webhook data that was sent when the call completed. *** ## Headers **authorization** `string` *required* Your org API key for authentication. *** ## Path Parameters **call\_id** `string` *required* The unique identifier of the call to get the webhook data for. *** ## Response **data** `object` The post call webhook and send history for this call. **Properties** **payload** `object` The post call webhook payload, contains information about the call. **url** `string` The URL the payload inforamtion was sent to **created\_at** `string` Timestamp of when the webhook was first sent **call\_id** `string` The call ID associated with this webhook **user\_id** `string` The ID of the org this webhook was sent from **metadata** `array` Array of objects containing metadata about webhook spawns, creates, and resends. Each object has the following properties: **Array Item Properties** **sent\_at** `string` Timestamp of when this webhook attempt was sent **response\_code** `integer` HTTP response code received from the webhook endpoint **response\_time** `string` Time taken to receive a response from the webhook endpoint, appended with "ms" **send\_type** `string` How this webhook was triggered. Can be: * "resend": Webhook was manually resent * "create": Webhook was recreated outside normal flow * "spawn": Webhook was created by normal call flow **errors** `array` Array of error objects if returned. **Array Item Properties** **error** `string` The error code. **message** `string` The error message. *** Docs for agents: [llms.txt](/llms.txt) # List Prompts Source: https://docs.bland.ai/api-v1/get/prompts GET https://api.bland.ai/v1/prompts Retrieves all your saved prompts. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `string` Response status of the request. **prompts** `array` An array of prompt objects. ```json Response theme={null} { "status": "success", "prompts": [ { "prompt": "My Prompt", "last_updated": "2024-05-12T22:52:49.004987+00:00", "id": "PT-aa8fb0ac-0014-43c0-9268-543522ce7e27", "name": "My First Prompt" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Prompt Details Source: https://docs.bland.ai/api-v1/get/prompts-id GET https://api.bland.ai/v1/prompts/{prompt_id} Retrieves data for a specific prompt_id. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **prompt\_id** `string` *required* The unique identifier for the prompt you want to retrieve. ### Response **status** `string` Response status of the request. **prompt** `object` An object containing parameters for the prompt. **prompt.id** `string` The unique identifier of the prompt. **prompt.prompt** `string` The prompt of the specific prompt\_id. **prompt.name** `string` The name of the specific prompt\_id. **prompt.last\_updated** `string` The time of last update for the specific prompt\_id. ```json Response theme={null} { "status": "success", "prompt": { "id": "PT-aa8fb0ac-0014-43c0-9268-543522ce7e27", "prompt": "My Prompt", "name": "My First Prompt" "last_updated": "2024-05-12T22:52:49.004987+00:00", } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get SIP Call Logs Source: https://docs.bland.ai/api-v1/get/sip-calls GET https://api.bland.ai/v1/sip/calls Retrieve SIP call logs for a phone number with cursor-based pagination. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **phone\_number** `string` *required* The phone number to fetch call logs for. Must be in E.164 format. **limit** `number` Maximum number of calls to return. Default: 50. **before** `string` Cursor for pagination. Pass the `call_id` of the last call from the previous page to fetch the next page. ### Response **calls** `array` Array of call records. Each includes: * `call_id` (string) — Unique SIP Call-ID * `direction` (string) — `"inbound"` or `"outbound"` * `from` (string) — Caller number * `to` (string) — Callee number * `status` (string) — Final SIP status (e.g., `"200 OK"`, `"486 Busy"`) * `sip_code` (number) — SIP response code * `duration_seconds` (number) — Call duration * `started_at` (string) — ISO 8601 timestamp * `ended_at` (string) — ISO 8601 timestamp * `source_ip` (string) — Source IP address ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/calls?phone_number=%2B14150000000&limit=10' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "calls": [ { "call_id": "abc123@sip.bland.ai", "direction": "outbound", "from": "+14150000000", "to": "+15105551234", "status": "200 OK", "sip_code": 200, "duration_seconds": 45, "started_at": "2026-03-09T11:00:00Z", "ended_at": "2026-03-09T11:00:45Z", "source_ip": "35.80.235.26" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get SIP Config Source: https://docs.bland.ai/api-v1/get/sip-config GET https://api.bland.ai/v1/sip Retrieve the current SIP configuration for a phone number. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **phone\_number** `string` *required* The phone number to fetch SIP configuration for. Must be in E.164 format. ### Response **data.inbound** `object` Inbound SIP configuration, or `null` if not configured. Includes `number`, `id`, `org_id`, `direction`, `sip_endpoint`, `headers`, `options`, `created_at`, and `updated_at`. Sensitive fields (credentials) are redacted. **data.outbound** `object` Outbound SIP configuration, or `null` if not configured. Same fields as inbound. ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip?phone_number=%2B14150000000' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "inbound": { "number": "+14150000000", "id": "abc123", "org_id": "org_456", "direction": "inbound", "sip_endpoint": null, "created_at": "2026-03-09T12:00:00Z", "updated_at": "2026-03-09T12:00:00Z", "headers": null, "options": { "auth_mode": "ip" } }, "outbound": { "number": "+14150000000", "id": "def789", "org_id": "org_456", "direction": "outbound", "sip_endpoint": "sip:trunk.provider.com", "created_at": "2026-03-09T12:00:00Z", "updated_at": "2026-03-09T12:00:00Z", "headers": null, "options": { "port": 5061, "transport": "tls", "secure_media": true } } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Discovery Status Source: https://docs.bland.ai/api-v1/get/sip-discover-status GET https://api.bland.ai/v1/sip/discover/status Poll the status and results of a SIP endpoint discovery session. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **discovery\_id** `string` *required* The discovery session ID returned from `POST /v1/sip/discover`. ### Response Returns the same `DiscoveryResult` object as `POST /v1/sip/discover`. The `status` field indicates whether the discovery is still `"running"`, has `"completed"`, or has `"failed"`. Discovery results expire after 10 minutes. ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/discover/status?discovery_id=disc_abc123' \ -H "Authorization: Bearer " ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Firewall IPs Source: https://docs.bland.ai/api-v1/get/sip-firewall-ips GET https://api.bland.ai/v1/sip/firewall-ips Get Bland's static SIP signaling and media IP addresses and ports for your region. Use these to configure your firewall and SBC. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **ip\_addresses** `string[]` Array of static IP addresses for your region: the two signaling IPs first, then the four media IPs. Allow-list all of them and trust all of them as SIP peers. Calls you send to Bland go to the signaling IPs. Transfers and warm transfer consult calls that Bland sends to your SBC connect from the media IPs. See [Connection Endpoints](/agents/sip-network#connection-endpoints). **ports.sip** `string` SIP signaling port and transport (e.g., `"5061 TLS"`). **ports.rtp** `string` RTP media port range (e.g., `"16384-32768 UDP"`). ```json Example Request theme={null} curl -X GET https://api.bland.ai/v1/sip/firewall-ips \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "ip_addresses": [ "35.82.60.77", "52.27.163.2", "52.13.231.129", "35.160.144.213", "44.234.13.26", "54.218.96.252" ], "ports": { "sip": "5061 TLS", "rtp": "16384-32768 UDP" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Generate SIP Password Source: https://docs.bland.ai/api-v1/get/sip-generate-password GET https://api.bland.ai/v1/sip/generate-password Generate a strong, PBX-safe SIP password for register-based authentication, at a configurable length. Generates a cryptographically-random password suitable for a trunk's `register_auth.password`. The character set is unambiguous (no `0`/`O`/`1`/`l`/`I`) and avoids characters that need escaping in PBX configs or SIP URIs, so it pastes safely into Asterisk / FreeSWITCH / 3CX. The result always satisfies the 8–256 length bounds the [attach](/api-v1/post/sip-attach) schema enforces. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters Provide **either** `length` or `strength` (or neither, for the default). If both are given, `length` takes precedence. **length** `integer` Explicit password length, between **8 and 256**. Values outside the range are clamped. **strength** `string` A length preset instead of an explicit value: `"standard"` (16 characters) or `"long"` (32 characters). Defaults to `"standard"` when neither `length` nor `strength` is provided. ### Response **password** `string` The generated password. **length** `integer` The actual length of the generated password (after clamping / preset resolution). ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/generate-password?strength=long' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "password": "Kf7mQ2pXvR9nLs4T", "length": 16 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List SIP Numbers Source: https://docs.bland.ai/api-v1/get/sip-numbers GET https://api.bland.ai/v1/sip/numbers List all phone numbers with SIP configurations for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data.numbers** `array` Array of SIP number summaries. Each entry includes: * `phone_number` (string) — The phone number in E.164 format * `directions` (array) — List of configured directions (`"inbound"`, `"outbound"`) * `sip_endpoint` (string) — The SIP endpoint (for outbound) * `health_status` (string) — Current health: `"healthy"`, `"unreachable"`, or `"unchecked"` ```json Example Request theme={null} curl -X GET https://api.bland.ai/v1/sip/numbers \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "numbers": [ { "phone_number": "+14150000000", "directions": ["inbound", "outbound"], "sip_endpoint": "sip:trunk.provider.com", "health_status": "healthy" }, { "phone_number": "+14150000001", "directions": ["inbound"], "sip_endpoint": null, "health_status": "unchecked" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Outbound Setup Source: https://docs.bland.ai/api-v1/get/sip-outbound-setup GET https://api.bland.ai/v1/sip/outbound-setup Get Bland's SIP server details and PBX configuration instructions for outbound call routing. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **phone\_number** `string` Optional. If provided, includes per-number credentials (redacted) in the response. ### Response **sip\_server** `string` Bland's SIP server hostname for your region (e.g., `us1.sip.bland.ai`). **port** `number` SIP signaling port (e.g., `5061`). **instructions** `string` Human-readable setup instructions for configuring your PBX. **credentials** `object` Per-number registration credentials (only if `phone_number` is provided and registration auth is configured). Sensitive values are redacted. ```json Example Request theme={null} curl -X GET https://api.bland.ai/v1/sip/outbound-setup \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "sip_server": "us1.sip.bland.ai", "port": 5061, "instructions": "Configure your PBX to send SIP INVITE requests to us1.sip.bland.ai:5061 over TLS. Whitelist the IP addresses from /v1/sip/firewall-ips." }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Check Number Portability Source: https://docs.bland.ai/api-v1/get/sip-port-check GET https://api.bland.ai/v1/sip/port/check Check whether phone numbers are eligible for porting to Bland. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **phone\_numbers** `string[]` *required* Array of phone numbers to check. Must be in E.164 format. ### Response **results** `array` Array of portability check results. Each includes: * `phone_number` (string) — The phone number checked * `portable` (boolean) — Whether the number can be ported * `number_type` (string) — Type of number: `"mobile"`, `"landline"`, `"toll-free"`, etc. * `pin_required` (boolean) — Whether a PIN from the losing carrier is required ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/port/check?phone_numbers[]=%2B14150000000&phone_numbers[]=%2B14150000001' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "results": [ { "phone_number": "+14150000000", "portable": true, "number_type": "landline", "pin_required": false }, { "phone_number": "+14150000001", "portable": true, "number_type": "mobile", "pin_required": true } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Port Requests Source: https://docs.bland.ai/api-v1/get/sip-port-requests GET https://api.bland.ai/v1/sip/port List all number porting requests for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **port\_requests** `array` Array of port request objects. Each includes: * `id` (string) — Port request ID * `status` (string) — Current status: `"waiting_for_signature"`, `"submitted"`, `"in_progress"`, `"completed"`, `"canceled"`, `"failed"` * `phone_numbers` (array) — Numbers included in the port, each with individual status * `authorized_rep_email` (string) — Email of the authorized representative * `notification_emails` (array) — Notification email addresses * `created_at` (string) — ISO 8601 timestamp * `updated_at` (string) — ISO 8601 timestamp ```json Example Request theme={null} curl -X GET https://api.bland.ai/v1/sip/port \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "port_requests": [ { "id": "port_xyz789", "status": "in_progress", "phone_numbers": [ { "number": "+14150000000", "status": "in_progress" }, { "number": "+14150000001", "status": "in_progress" } ], "authorized_rep_email": "jane@acme.com", "notification_emails": ["it@acme.com"], "created_at": "2026-03-09T12:00:00Z", "updated_at": "2026-03-12T08:00:00Z" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Trunk Health Source: https://docs.bland.ai/api-v1/get/sip-status GET https://api.bland.ai/v1/sip/status Get the health status of a SIP trunk by probing the endpoint with SIP OPTIONS. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **phone\_number** `string` *required* The phone number to check health for. Must be in E.164 format. ### Response **status** `string` Health status: `"healthy"`, `"unreachable"`, or `"unchecked"`. Inbound-only trunks show `"unchecked"` since there is no outbound endpoint to probe. **response\_time\_ms** `number` Response time of the SIP OPTIONS probe in milliseconds. `null` if unreachable or unchecked. **checked\_at** `string` ISO 8601 timestamp of when the health check was performed. ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/status?phone_number=%2B14150000000' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "status": "healthy", "response_time_ms": 42, "checked_at": "2026-03-09T12:00:00Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Call Status Source: https://docs.bland.ai/api-v1/get/sip-test-call-status GET https://api.bland.ai/v1/sip/test-call/status Poll the status and trace of a SIP test call. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **call\_id** `string` *required* The call ID returned from `POST /v1/sip/test-call`. ### Response **status** `string` Call status: `"queued"`, `"initiated"`, `"ringing"`, `"in-progress"`, `"completed"`, `"failed"`, `"busy"`, `"no-answer"`. **result** `string` Final result enum: `"connected"`, `"failed"`, `"busy"`, `"no_answer"`, `"pending"`. **duration\_seconds** `number` Call duration in seconds. **timeline** `array` Array of timeline events with `event` (string), `at` (timestamp), and `detail` (string) fields. ```json Example Request theme={null} curl -X GET 'https://api.bland.ai/v1/sip/test-call/status?call_id=tc_abc123' \ -H "Authorization: Bearer " ``` ```json Response theme={null} { "data": { "status": "completed", "result": "connected", "duration_seconds": 8, "timeline": [ { "event": "initiated", "at": "2026-03-09T12:00:00Z", "detail": "Call initiated" }, { "event": "ringing", "at": "2026-03-09T12:00:01Z", "detail": "Endpoint ringing" }, { "event": "answered", "at": "2026-03-09T12:00:03Z", "detail": "Call answered" }, { "event": "completed", "at": "2026-03-09T12:00:08Z", "detail": "Call ended" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Conversations Source: https://docs.bland.ai/api-v1/get/sms-conversations GET https://api.bland.ai/v1/sms/conversations Retrieve a paginated list of SMS conversations for the authenticated user, with filtering, sorting, and metadata. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **page** `number` The page number to retrieve. Defaults to `1`. **pageSize** `number` The number of conversations per page. Defaults to `25`. **sortBy** `string` Field to sort by. Allowed values: `created_at`, `updated_at`, `user_number`, `agent_number`, `is_active`, `message_count`, `curr_pathway_id`, `curr_pathway_version`, `timed_out_at`. Defaults to `created_at`. **sortDir** `string` Direction of sorting. Either `asc` or `desc`. Defaults to `desc`. **filters** `object[]` A JSON-encoded array of filter objects. Each object should contain: * `field`: one of `created_at`, `updated_at`, `user_number`, `agent_number`, `is_active`, `message_count`, `variables`, `current_node_id`, `curr_pathway_id`, `curr_pathway_version`, `timed_out_at` * `operator`: one of `eq`, `contains`, `startsWith`, `endsWith`, `gt`, `gte`, `lt`, `lte` * `value`: the filter value ### Response **data** `array` A list of conversations matching the query. **data\[].id** `string` Unique ID of the conversation. **data\[].created\_at** `string` ISO timestamp when the conversation was created. **data\[].updated\_at** `string` ISO timestamp when the conversation was last updated. **data\[].user\_number** `string` The user-facing phone number in the conversation. **data\[].agent\_number** `string` The assistant's phone number in the conversation. **data\[].variables** `object` Arbitrary variables associated with the conversation. **data\[].current\_node\_id** `string` ID of the current node in the conversational pathway. **data\[].curr\_pathway\_id** `string|null` The UUID of the current pathway being used in this conversation. **data\[].is\_active** `boolean` Indicates whether the conversation is still active. **data\[].message\_count** `number` Number of messages in the conversation. **data\[].last\_message** `string|null` The content of the most recent message, if available. **data\[].last\_message\_at** `string|null` The timestamp of the most recent message. **data\[].pathway\_tags** `array|null` Tags from pathway nodes visited during the conversation. **data\[].effective\_channel** `string|null` The resolved delivery channel: `"sms"`, `"rcs"`, or `"whatsapp"`. **data\[].summary** `string|null` AI-generated conversation summary, if available. **data\[].citation\_variables** `object|null` Extracted citation variable values, if citation schemas were configured. **data\[].disposition\_tag** `string|null` The first successful outcome result tag, if outcomes were configured. **errors** `null|array` `null` on success, or a list of errors on failure. **extra.pagination.totalItems** `number` Total number of conversations matching the query. **extra.pagination.totalPages** `number` Total number of pages available. **extra.pagination.currentPage** `number` The current page of the response. **extra.pagination.pageSize** `number` Number of items per page in the current response. ```json Response theme={null} { "data": [ { "id": "convo_abc123", "created_at": "2024-11-20T14:01:00.000Z", "updated_at": "2024-11-21T09:12:00.000Z", "user_number": "+15550001111", "agent_number": "+15552223333", "variables": { "campaign_id": "xyz789" }, "current_node_id": "node_intro", "curr_pathway_id": "pathway_abc123", "is_active": true, "message_count": 5, "last_message": "Hi there, how can I help you?", "last_message_at": "2024-11-21T09:12:00.000Z", "pathway_tags": [{"name": "Greeting", "color": "#4287f5"}], "effective_channel": "sms", "summary": null, "citation_variables": null, "disposition_tag": null } ], "errors": null, "extra": { "pagination": { "totalItems": 42, "totalPages": 5, "currentPage": 1, "pageSize": 10 } } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Conversation by ID Source: https://docs.bland.ai/api-v1/get/sms-conversations-id GET https://api.bland.ai/v1/sms/conversations/{id} Retrieve a single SMS conversation and its messages by its ID > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication ### Path Parameters **id** `string` *required* The unique ID of the conversation to retrieve. ### Response **data** `object` The full conversation object, including its messages. **data.id** `string` The unique ID of the conversation. **data.created\_at** `string` ISO timestamp for when the conversation was created. **data.updated\_at** `string` ISO timestamp for when the conversation was last updated. **data.user\_number** `string` The user's phone number in the conversation. **data.agent\_number** `string` The assistant's phone number in the conversation. **data.variables** `object|null` Variables stored on the conversation, or `null` if none. **data.current\_node\_id** `string|null` The current node ID in the pathway, if any. **data.curr\_pathway\_id** `string|null` The UUID of the current pathway being used in this conversation. **data.curr\_pathway\_version** `string|null` The specific version of the pathway being used (e.g., "latest", "v1.0"). **data.timed\_out\_at** `string|null` ISO timestamp when the conversation timed out due to inactivity, if applicable. When set, the conversation will not respond to new user messages but will store them. **data.is\_active** `boolean` Whether the conversation is still active. **data.human\_handoff\_at** `string|null` ISO timestamp set while a human owns the thread. The agent does not reply until the conversation is [resumed](/api-v1/post/sms-conversations-resume). Messages sent by the rep have `sender: "HUMAN"`. **data.human\_handoff\_reason** `string|null` Reason supplied at handoff, if any. **data.human\_handoff\_metadata** `object|null` `source` (`"api"`, `"node"`, or `"dashboard"`), optional `actor`, plus any metadata passed at handoff. **data.effective\_channel** `string|null` The resolved delivery channel for this conversation: `"sms"`, `"rcs"`, or `"whatsapp"`. Determined based on the input channel and whether the messaging service supports RCS. **data.summary** `string|null` AI-generated conversation summary, produced when the conversation ends and a summary prompt is configured on the SMS number. **data.citation\_variables** `object|null` Extracted citation variable values from the conversation transcript. Keys are variable names, values are the extracted data. Only populated when citation schemas are configured. **data.disposition\_tag** `string|null` The first successful outcome result tag. Provides a quick classification of the conversation outcome without needing to inspect the full `disposition_logs`. **data.messages** `array` An array of message objects in the conversation, sorted chronologically. **data.messages\[].id** `string` Unique ID of the message. **data.messages\[].created\_at** `string` ISO timestamp of when the message was created. **data.messages\[].message** `string` The message body. **data.messages\[].from** `string` Sender phone number. **data.messages\[].to** `string` Receiver phone number. **data.messages\[].sender** `string` Either `"USER"` or `"AGENT"` to indicate who sent the message. **data.messages\[].status** `string` Delivery status of the message. Possible values: `"pending"`, `"queued"`, `"sent"`, `"delivered"`, `"read"`, `"failed"`, `"undelivered"`. The `"read"` status is available for RCS and WhatsApp channels. **data.messages\[].error\_code** `string|null` Twilio error code if the message failed, otherwise `null`. **data.disposition\_logs** `array` An array of outcome run results for this conversation. Each entry represents one outcome that was evaluated when the conversation ended. **data.disposition\_logs\[].disposition\_id** `string` The ID of the outcome that was run. **data.disposition\_logs\[].snippet\_version** `number` The version of the outcome's transformation code that was executed. **data.disposition\_logs\[].status** `string` The execution status. `"COMPLETE"` indicates the outcome ran successfully, `"ERROR"` indicates a failure. **data.disposition\_logs\[].result** `object|null` The extracted outcome values, or `null` if the run failed. **data.disposition\_logs\[].error** `string|null` Error message if the outcome run failed, otherwise `null`. **data.disposition\_logs\[].exec\_time** `number` Execution time in milliseconds. **errors** `null|array` `null` on success, or a list of error objects if a failure occurred. ```json Response theme={null} { "data": { "id": "convo_abc123", "created_at": "2025-05-13T20:50:59.233Z", "updated_at": "2025-05-13T20:50:59.233Z", "user_id": "user_abc123", "user_number": "+15550001111", "agent_number": "+15550002222", "inbound_id": 123456, "variables": null, "current_node_id": null, "curr_pathway_id": "pathway_abc123", "curr_pathway_version": "latest", "timed_out_at": null, "last_message_at": "2025-05-13T20:50:59.233Z", "is_active": true, "effective_channel": "sms", "summary": null, "citation_variables": null, "disposition_tag": null, "messages": [ { "created_at": "2025-05-13T20:50:59.708Z", "message": "", "from": "+15550002222", "to": "+15550001111", "sender": "USER", "id": 100001, "status": null, "error_code": null }, { "created_at": "2025-05-13T20:51:00.917Z", "message": "Hey, what's up?", "from": "+15550002222", "to": "+15550001111", "sender": "AGENT", "id": 100002, "status": "delivered", "error_code": null } ], "disposition_logs": [ { "disposition_id": "d1234567-abcd-1234-efgh-123456789012", "snippet_version": 1, "status": "COMPLETE", "result": { "appointmentBooked": true, "callDisposition": "confirmed" }, "error": null, "exec_time": 1234 } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Post Conversation Webhook Source: https://docs.bland.ai/api-v1/get/sms-conversations-webhook GET https://api.bland.ai/v1/sms/conversations/{conversationId}/webhook Retrieve the webhook delivery log for an SMS conversation, including the payload, URL, response codes, and timing. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **conversationId** `string` *required* The unique ID of the conversation to retrieve webhook logs for. ### Response **data** `object` The webhook log for this conversation, or `null` if no webhook has been sent. **data.conversation\_id** `string` The conversation this webhook log belongs to. **data.url** `string` The webhook URL that was called. **data.payload** `object` The full webhook payload that was sent. **data.created\_at** `string` ISO timestamp for when the webhook log was created. **data.user\_id** `string` The organization ID that owns this conversation. **data.metadata** `array` An array of delivery attempt records. Each entry contains: * `sent_at` — ISO timestamp of the delivery attempt * `response_code` — HTTP status code returned by your endpoint, or `null` if the request failed * `response_time` — how long the request took * `send_type` — delivery method (e.g. `"spawn"`) * `error_message` — error details if the delivery failed **errors** `null|array` `null` on success, or a list of error objects if a failure occurred. ```json Response theme={null} { "data": { "conversation_id": "convo_abc123", "url": "https://example.com/sms-webhook", "payload": { "type": "status", "conversation_id": "convo_abc123", "status": "ended", "phone_number": "+15550001111", "agent_number": "+15550002222", "channel": "sms", "message_count": 5 }, "created_at": "2026-04-13T20:50:59.233Z", "user_id": "user_abc123", "metadata": [ { "sent_at": "2026-04-13T20:50:59.000Z", "response_code": 200, "response_time": "142ms", "send_type": "spawn" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List SMS Numbers Source: https://docs.bland.ai/api-v1/get/sms-numbers GET https://api.bland.ai/v1/sms/numbers Retrieve all phone numbers configured for SMS, along with their configuration and conversation counts. Pass `?channel=whatsapp` or `?channel=imessage` to return WhatsApp or iMessage configurations instead of SMS. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data** `array` A list of phone numbers with SMS configurations. **data\[].phone\_number** `string` The E.164 formatted phone number assigned to the user. **data\[].sms\_config** `object` The configuration used when handling inbound SMS messages. **data\[].sms\_config.webhook** `string` When the agent sends a response, we’ll send the message details in a POST request to the URL you specify here, along with chat history. **data\[].sms\_config.request\_data** `object` Request data fields are available to the AI agent during the call when referenced in the associated pathway or task. **data\[].sms\_config.time\_out** `number` Maximum time to wait for a response. Default is no timeout. **data\[].sms\_config.timeout\_message** `string` Message sent when the timeout fires, if set. **data\[].sms\_config.warning\_time** `number` Seconds to wait before sending the warning message, if set. Always less than `time_out`. **data\[].sms\_config.warning\_message** `string` Message sent at `warning_time`, if set. **data\[].sms\_config.messaging\_service\_sid** `string` Twilio Messaging Service SID, if set. **data\[].sms\_config.objective** `string` The assistant’s objective or system instruction. **data\[].sms\_config.tools** `array` A list of tools available to the assistant. **data\[].sms\_config.temperature** `number` The model’s temperature setting, controlling creativity. **data\[].sms\_config.pathway\_id** `string` The ID of the linked conversational pathway (if any). **data\[].sms\_config.pathway\_version** `string` The specific version of the pathway to use. **data\[].sms\_config.start\_node\_id** `string` The ID of the first node to enter in the pathway. **data\[].sms\_config.restart\_after\_end\_call** `boolean` When `true`, a new conversation is automatically started if the user texts after the current conversation has ended. When `false`, subsequent messages are stored in the ended conversation without triggering a new reply. **data\[].sms\_config.timezone** `string` The timezone used for time-based variables in the conversation (e.g. `"America/New_York"`). **data\[].sms\_config.citation\_schema\_ids** `string[]` IDs of citation schemas configured for this number. Citations are extracted when conversations end. See [Citations](/enterprise-features/citations). **data\[].sms\_config.disposition\_ids** `string[]` IDs of outcomes configured for this number. Outcomes are evaluated when conversations end. See [Outcomes](/tutorials/outcomes). **data\[].sms\_config.summary\_prompt** `string` Custom prompt used to generate a conversation summary when the conversation ends. **data\[].conversation\_count** `integer` The number of SMS conversations handled by this number. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": [ { "phone_number": "+14155552671", "sms_config": { "webhook": "https://example.com/sms-webhook", "request_data": { "ref": "campaign_123" }, "time_out": 15, "timeout_message": "This conversation has ended due to inactivity.", "warning_time": 10, "warning_message": "Are you still there?", "messaging_service_sid": "MG1234567890abcdef", "objective": "Provide quick support to customers.", "tools": ["lookup", "escalate"], "temperature": 0.7, "pathway_id": "abc123", "pathway_version": "latest", "start_node_id": "entry-node", "restart_after_end_call": true, "timezone": "America/New_York", "citation_schema_ids": ["b0477cba-1c97-4105-8ac9-46cb8eae5cf1"], "disposition_ids": ["d1234567-abcd-1234-efgh-123456789012"], "summary_prompt": "Summarize the key points and outcome of this conversation." }, "conversation_count": 34 } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List TTS Generations Source: https://docs.bland.ai/api-v1/get/speak-samples GET https://api.bland.ai/v1/speak/samples List your stored text-to-speech generations. ## Headers **authorization** `string` *required* Your API key for authentication. ## Query Parameters **limit** `number` (default: 20) Number of generations to return. **offset** `number` (default: 0) Number of generations to skip for pagination. **voice\_id** `string` Filter results to a specific voice. ## Response **data** `array` List of stored TTS generation objects. **Generation object** **id** `string` Unique identifier for the generation. **org\_id** `string` The organization that created the generation. **user\_id** `string` The user that created the generation. **text** `string` The text that was synthesized. **voice\_id** `string` The voice used for synthesis. **output\_format** `string` The audio format of the generation (e.g. `pcm_44100`). **latency\_ms** `number` Time in milliseconds from request to first audio. **cost** `number` Cost in USD for this generation. **created\_at** `string` ISO 8601 timestamp of when the generation was created. **total** `number` Total number of generations matching the query. **limit** `number` The limit applied to this request. **offset** `number` The offset applied to this request. **errors** `null | array` Any errors encountered, or `null` if successful. ```json Response theme={null} { "data": [ { "id": "a3f8c2d1-4b5e-6789-0abc-def012345678", "org_id": "9e1d2c3b-4a5f-6780-bcde-f01234567890", "user_id": "5c6d7e8f-9012-3456-789a-bcdef0123456", "text": "Hello, this is a test of the text-to-speech system.", "voice_id": "2b3c4d5e-6f70-8901-2345-6789abcdef01", "output_format": "pcm_44100", "latency_ms": 1261, "cost": 0.011, "created_at": "2026-03-16T01:44:56.673Z" } ], "errors": null, "total": 1, "limit": 20, "offset": 0 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get TTS Generation Source: https://docs.bland.ai/api-v1/get/speak-samples-id GET https://api.bland.ai/v1/speak/samples/{id} Retrieve a single stored text-to-speech generation. ## Headers **authorization** `string` *required* Your API key for authentication. ## Path Parameters **id** `string` *required* The ID of the generation to retrieve. ## Query Parameters **format** `string` Pass `audio` to receive the raw WAV binary instead of the metadata JSON. ## Response Without `?format=audio`, returns the generation metadata: **id** `string` Unique identifier for the generation. **org\_id** `string` The organization that created the generation. **user\_id** `string` The user that created the generation. **text** `string` The text that was synthesized. **voice\_id** `string` The voice used for synthesis. **output\_format** `string` The audio format of the generation (e.g. `pcm_44100`). **audio\_data** `string` Base64-encoded audio data. Only present in the JSON response (not when using `?format=audio`). **latency\_ms** `number` Time in milliseconds from request to first audio. **cost** `number` Cost in USD for this generation. **created\_at** `string` ISO 8601 timestamp of when the generation was created. With `?format=audio`, returns a raw WAV audio binary (same as the original `POST /v1/speak` response). ```json Metadata response theme={null} { "data": { "id": "a3f8c2d1-4b5e-6789-0abc-def012345678", "org_id": "9e1d2c3b-4a5f-6780-bcde-f01234567890", "user_id": "5c6d7e8f-9012-3456-789a-bcdef0123456", "text": "Hello, this is a test of the text-to-speech system.", "voice_id": "2b3c4d5e-6f70-8901-2345-6789abcdef01", "output_format": "pcm_44100", "audio_data": "base64-encoded-audio-data", "latency_ms": 1261, "cost": 0.011, "created_at": "2026-03-16T01:44:56.673Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Custom Tools Source: https://docs.bland.ai/api-v1/get/tools GET https://api.bland.ai/v1/tools Retrieve Custom Tools you've created. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `string` Whether the requet succeeded or failed. **tools** `array` An array of your available tools. ```json Response theme={null} { "status": "success", "tools": [ { "tool_id": "TL-5da8347d-0ab7-415d-b156-a7fc5c6074dc", "label": null, "tool": { "name": "BookAppointment", "description": "Books the appointment. Can only be used once.", "speech": "Please wait while I book that appointment for you", "method": "POST", "timeout": 99999999, "url": "https://...", "body": { "slot": "{{input}}" }, "input_schema": { "type": "object", "example": { "date": "2024-03-16", "time": "5:00 PM" }, "required": [ "date", "time" ], "properties": { "date": "YYYY-MM-DD", "time": "HH:MM (AM|PM)" } }, "response": { "confirmation_message": "$.message" } }, "public": false }, ... ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Custom Tool Details Source: https://docs.bland.ai/api-v1/get/tools-tool-id GET https://api.bland.ai/v1/tools/{tool_id} Retrieve a Custom Tool you've created. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **tool\_id** `string` *required* The ID of the tool you want to retrieve (starting with `TL-`). ### Response **status** `string` Whether the requet succeeded or failed. **tool** `array` The tool you've created. ```json Response theme={null} { "status": "success", "tool": { "tool_id": "TL-5da8347d-0ab7-415d-b156-a7fc5c6074dc", "label": null, "tool": { "name": "BookAppointment", "description": "Books the appointment. Can only be used once.", "speech": "Please wait while I book that appointment for you", "method": "POST", "timeout": 99999999, "url": "https://...", "body": { "slot": "{{input}}" }, "input_schema": { "type": "object", "example": { "date": "2024-03-16", "time": "5:00 PM" }, "required": [ "date", "time" ], "properties": { "date": "YYYY-MM-DD", "time": "HH:MM (AM|PM)" } }, "response": { "confirmation_message": "$.message" } }, "public": false } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Translation Session Source: https://docs.bland.ai/api-v1/get/translation-sessions-id GET https://api.bland.ai/v1/translation/sessions/{session_id} Retrieve the status, duration, and billing details of a translation session Returns the current state of a translation session — useful for checking whether a session connected, how long it ran, and how many minutes were billed. ## Authentication **authorization** `string` *required* Your API key for authentication ## Path Parameters **session\_id** `string` *required* The session UUID returned by `POST /v1/translation/sessions` ## Response **data** `object` **data properties** **session\_id** `string` Unique identifier for the session **status** `string` One of `PENDING` (created, WebSocket not yet connected), `ACTIVE` (audio flowing), `ENDED`, `FAILED`, `EXPIRED` (hit max duration), `ABANDONED` (never connected before token expiry) **source\_language** `string` Source language code **target\_language** `string` Target language code **voice\_id** `string` Voice used for translated speech, or `null` for the default **audio\_protocol** `string` `pcm16` or `twilio_ulaw` **sample\_rate** `integer` Inbound sample rate for `pcm16` sessions; `null` for `twilio_ulaw` **max\_duration\_seconds** `integer` Configured maximum session length **end\_reason** `string` Why the session ended: `client_disconnect`, `max_duration`, `error`, or `api_terminated`. `null` while the session is pending or active. **session\_seconds** `number` Connected duration in seconds. `null` until the session ends. **billable\_minutes** `integer` Billed minutes (`session_seconds` rounded up to the next minute). `null` until the session ends. **created\_at** `string` ISO timestamp of session creation **started\_at** `string` ISO timestamp of the WebSocket connection, or `null` if it never connected **ended\_at** `string` ISO timestamp of session end, or `null` while pending or active **errors** `array` (default: null) Array of error objects if the request failed ```bash cURL theme={null} curl "https://api.bland.ai/v1/translation/sessions/9592342c-0ed2-4c5e-8ceb-16aa55c804a7" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```python Python theme={null} import requests response = requests.get( "https://api.bland.ai/v1/translation/sessions/9592342c-0ed2-4c5e-8ceb-16aa55c804a7", headers={"Authorization": "Bearer YOUR_API_KEY"}, ) print(response.json()["data"]["status"]) ``` ```json Ended Session theme={null} { "data": { "session_id": "9592342c-0ed2-4c5e-8ceb-16aa55c804a7", "status": "ENDED", "source_language": "en", "target_language": "es", "voice_id": null, "audio_protocol": "pcm16", "sample_rate": 16000, "max_duration_seconds": 1800, "end_reason": "client_disconnect", "session_seconds": 19.712, "billable_minutes": 1, "created_at": "2026-06-04T18:05:07.885Z", "started_at": "2026-06-04T18:05:08.861Z", "ended_at": "2026-06-04T18:05:28.573Z" }, "errors": null } ``` # List Agents Source: https://docs.bland.ai/api-v1/get/triage-agents GET https://api.bland.ai/v1/triage/agents List triage agent profiles. ## Overview Returns the triage agent profiles available to your org. Today this is a single built-in profile, **Norm**. The endpoint exists for forward compatibility. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Query Parameters **limit** `integer` (default: 50) Number of agents to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Array of agent profiles. **Agent profile fields** **id** `string` Internal UUID of the agent profile. Sessions on an issue carry this ID as `agent_profile_id`. **provider\_type** `string` Backing provider for this agent. Currently `blandcode` for Norm. **display\_name** `string` Human-readable name shown in the dashboard. Always `Norm` for the built-in profile. **description** `string | null` **is\_active** `boolean` Whether this agent is available for new sessions. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "items": [ { "id": "66720f06-f492-4ce6-a2f2-cd84fd54613e", "provider_type": "blandcode", "display_name": "Norm", "description": "Default triage agent", "is_active": true } ], "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Categories Source: https://docs.bland.ai/api-v1/get/triage-categories GET https://api.bland.ai/v1/triage/categories List issue categories. ## Overview Returns the org's category catalog. Built-in defaults (Transcription, Speech, Dialogue, Routing, Tools, Latency, Telephony, Bug) use IDs like `built-in:`. Custom categories created with [Create Category](/api-v1/post/triage-categories) use a UUID. Sorted alphabetically, so `next_cursor` is the name of the last item. Issue `category` is free-form on creation, this catalog is just used for autocomplete and faceted filters in the dashboard. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Query Parameters **limit** `integer` (default: 50) Number of categories to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. For categories, this is the name of the last item from the previous page. *** ## Response **data.items** `array` Array of categories. **Category fields** **id** `string` `built-in:` for default categories, UUID for custom categories. **org\_id** `string` **name** `string` Display name. 1-64 characters. **created\_at** `string` **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "items": [ { "id": "built-in:bug", "org_id": "5fa6dc9e-ec4d-4f94-9e0e-21f6f6a1e8f1", "name": "Bug", "created_at": "2026-05-07T05:25:56.034Z" }, { "id": "built-in:dialogue", "org_id": "5fa6dc9e-ec4d-4f94-9e0e-21f6f6a1e8f1", "name": "Dialogue", "created_at": "2026-05-07T05:26:21.855Z" }, { "id": "built-in:latency", "org_id": "5fa6dc9e-ec4d-4f94-9e0e-21f6f6a1e8f1", "name": "Latency", "created_at": "2026-05-07T05:26:21.855Z" } ], "next_cursor": "Latency" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Flag Types Source: https://docs.bland.ai/api-v1/get/triage-flag-types GET https://api.bland.ai/v1/triage/flag-types List reusable flag types in your org. ## Overview Catalog of flag types your org has used, with usage counts and the most recent note for each. Use it to render a flag-type picker. Types are normalized to lower\_snake\_case before storage. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Query Parameters **limit** `integer` (default: 50) Number of types to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Array of flag types. **Flag type fields** **type** `string` The normalized flag type (lower\_snake\_case). **description** `string` The note from the most recently filed flag of this type. Empty string if none of the flags carried a note. **usage\_count** `number` How many flags of this type currently exist in your org. **last\_used\_at** `string | null` ISO 8601 timestamp of the most recent flag of this type. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "items": [ { "type": "missed_handoff", "description": "Agent transferred without confirming the email.", "usage_count": 4, "last_used_at": "2026-05-07T05:26:11.327Z" }, { "type": "wrong_pathway_node", "description": "Agent jumped to closing without verifying.", "usage_count": 2, "last_used_at": "2026-05-05T22:14:01.117Z" } ], "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Issues Source: https://docs.bland.ai/api-v1/get/triage-issues GET https://api.bland.ai/v1/triage/issues List triage issues with filters and keyset pagination. ## Overview Lists triage issues for your org. Items have the same shape as [Create Issue](/api-v1/post/triage-issues). The same filters power the [Triage dashboard](https://app.bland.ai/dashboard/monitor/triage) sidebar. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Query Parameters ### Pagination **limit** `integer` (default: 50) Number of issues to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. Omit on the first request. ### Sorting **sort** `string` (default: last\_activity\_at) Field to sort by. Must be one of: * `last_activity_at` (default) * `created_at` * `severity` * `status` All sorts include a stable secondary sort by `id` so keyset pagination is deterministic. **order** `string` (default: desc) Sort direction. `asc` or `desc`. ### Search **search** `string` Free-text search across issue title and description. ### Faceted filters **status** `string | string[]` Filter by status. Pass a single value, or repeat the parameter for multiple. Allowed values: `backlog`, `todo`, `in_progress`, `in_review`, `done`, `closed`. ``` ?status=todo&status=in_progress ``` **severity** `string | string[]` Filter by severity. Allowed values: `critical`, `high`, `medium`, `low`. Repeatable. **category** `string | string[]` Filter by category name. Repeatable. **resource\_type** `string` Only return issues that have at least one resource of this type. One of `call`, `sms_conversation`, `file`. ### Scope filters **owner\_id** `string` Only return issues with this owner. **assignee\_id** `string` Only return issues with this assignee. ### Date range **date\_field** `string` (default: last\_activity\_at) Which date field the `date_range` filter applies to. One of `last_activity_at` or `created_at`. **date\_range** `string` Relative window from now. One of: * `24h` * `7d` * `30d` * `90d` *** ## Response **data.items** `array` Array of issues. Each issue has the same shape as the response from [Create Issue](/api-v1/post/triage-issues). **data.next\_cursor** `string | null` Cursor to pass back as the `cursor` query parameter for the next page. `null` when there are no more pages. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "items": [ { "id": "1aec670c-08d1-42dd-933b-b939508e6693", "triage_id": "T-1042", "org_id": "4edcdd57-4b33-4d1f-a905-e6859ed8cca9", "number": 1042, "title": "Agent skipped the verification step", "description": "On the Aug 12 demo flow the agent jumped to the closing node...", "status": "in_progress", "severity": "high", "source": "manual", "category": "Routing", "owner_id": null, "assignee_id": "6e6c4e2f-ec3f-4582-bd95-6fa2d6375234", "author_id": "4fa8878d-4091-4c19-849a-1c64a79609da", "external_link": null, "created_at": "2026-05-04T18:24:11.482Z", "updated_at": "2026-05-06T02:11:08.901Z", "last_activity_at": "2026-05-06T02:11:08.901Z", "resource_count": 3, "flag_count": 1, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": true }, { "id": "822508a1-4e77-498b-892a-01cf6f9b1801", "triage_id": "T-1039", "org_id": "4edcdd57-4b33-4d1f-a905-e6859ed8cca9", "number": 1039, "title": "Caller transferred to wrong queue", "description": "", "status": "todo", "severity": "high", "source": "automated", "category": "Routing", "owner_id": null, "assignee_id": null, "author_id": "4fa8878d-4091-4c19-849a-1c64a79609da", "external_link": null, "created_at": "2026-05-03T22:14:01.117Z", "updated_at": "2026-05-03T22:14:01.117Z", "last_activity_at": "2026-05-03T22:14:01.117Z", "resource_count": 1, "flag_count": 0, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": false } ], "next_cursor": "822508a1-4e77-498b-892a-01cf6f9b1801" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Issue Source: https://docs.bland.ai/api-v1/get/triage-issues-id GET https://api.bland.ai/v1/triage/issues/{id} Get a triage issue by ID. ## Overview Returns a single issue. Same shape as [Create Issue](/api-v1/post/triage-issues). Sub-resources (resources, flags, relations, alert bindings, activity) are fetched via their own paginated endpoints. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. This is the `id` field returned from [Create Issue](/api-v1/post/triage-issues), not the `triage_id` short code. *** ## Response **data** `object` The issue. See [Create Issue](/api-v1/post/triage-issues#response) for the full field list. **errors** `null | array` `null` on success. Returns 404 with `{ error: "not_found", message: "Issue not found" }` if the ID does not exist or is not in your org. ```json Response theme={null} { "data": { "id": "e0c4d12b-34b6-4f9f-b12a-5249a351ccc8", "triage_id": "T-1042", "org_id": "dc899c63-277f-4bd2-8b6a-950bbb88dc15", "number": 1042, "title": "Agent skipped the verification step", "description": "On the Aug 12 demo flow the agent jumped to the closing node without asking for the email confirmation.", "status": "in_progress", "severity": "high", "source": "manual", "category": "Routing", "owner_id": null, "assignee_id": "51007876-c89e-4ca0-b719-390dc4cf4f72", "author_id": "9a184d67-2ee4-4959-b42d-28cd80343388", "external_link": null, "created_at": "2026-05-04T18:24:11.482Z", "updated_at": "2026-05-06T02:11:08.901Z", "last_activity_at": "2026-05-06T02:11:08.901Z", "resource_count": 3, "flag_count": 1, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": false }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "not_found", "message": "Issue not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Activity Source: https://docs.bland.ai/api-v1/get/triage-issues-id-activity GET https://api.bland.ai/v1/triage/issues/{id}/activity Activity feed for an issue. ## Overview Reverse-chronological feed of issue events and Norm session events. Each entry is either `entry_kind: "issue"` (status changes, attachments, flags, comments, etc.) or `entry_kind: "agent"` (Norm session events with optional artifacts). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Query Parameters **limit** `integer` (default: 50) Number of entries to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Mixed array of `IssueTimelineEntry` and `AgentTimelineEntry` objects. **Common fields** **entry\_kind** `string` `issue` or `agent`. **id** `string` **issue\_id** `string` **type** `string` Specific event type. For `issue` entries, one of: `created`, `status_changed`, `severity_changed`, `category_changed`, `assignee_changed`, `owner_changed`, `comment`, `resource_added`, `resource_removed`, `flag_added`, `flag_removed`, `relation_added`, `relation_removed`, `alert_transition`, `accepted`, `declined`, `merged`. For `agent` entries, one of: `session_started`, `prompt`, `thought`, `action`, `response`, `artifact`, `error`, `session_stopped`. **actor** `object | null` Who or what produced the event. `actor.kind` is `user`, `system`, or `agent`. For agent entries, `actor.label` is normalized to `Norm` even when the underlying record stores `blandcode`. **detail** `string` Short, human-readable description rendered in the UI. **metadata** `object | null` Optional structured metadata for this entry. Shape varies by `type`. **created\_at** `string` **Issue entry only fields** **from\_status** `string | null` Previous status, when the entry is `status_changed`. **to\_status** `string | null` New status, when the entry is `status_changed`. **resources** `array` Resource link snapshots referenced by this entry, for example the resource that was attached or removed. **referenced\_issues** `array` Other issues referenced by this entry, for example the related issue when a relation was added. **Agent entry only fields** **agent\_session** `object` Reference to the Norm session this entry belongs to. * `id` (string) * `agent_profile_id` (string) * `agent_name` (string), always `Norm` * `status` (string) **artifact** `object | null` An artifact Norm produced (for example a draft pathway version, a snippet, or a verification report). Contains `id`, `type`, `title`, `renderer`, `status` (`pending`, `ready`, or `error`), `payload`, and `external_urls` for deep-linking. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "items": [ { "entry_kind": "issue", "id": "0d10c1a4-8f27-4e91-a1b3-3fa7a7f3f58e", "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "type": "comment", "actor": { "kind": "user", "id": "1f4cabe4-5f9b-4b30-bc4f-fcd3e94a5b15", "label": "John Bland", "avatar_url": null }, "detail": "Pinged the on-call eng to look at the routing rule.", "from_status": null, "to_status": null, "metadata": null, "resources": [], "referenced_issues": [], "created_at": "2026-05-07T05:26:21.449Z" }, { "entry_kind": "issue", "id": "f8c3d1c3-6c9e-4ebf-bf0a-2a8b5b2e3d31", "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "type": "flag_added", "actor": { "kind": "user", "id": "1f4cabe4-5f9b-4b30-bc4f-fcd3e94a5b15", "label": "John Bland", "avatar_url": null }, "detail": "Added a flag.", "from_status": null, "to_status": null, "metadata": null, "resources": [ { "id": "0a9d6b23-3e0f-4f3b-9d5e-2bfa3ddbd86c", "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "org_id": "8a73d4d5-d9a0-4c01-9b1a-0e5d3a3b4e2c", "resource_type": "call", "resource_id": "0c9b2cc5-3f4e-4057-8ad3-546e5d33a6d1", "title": "Caller asked to be transferred to billing after the agent failed to verify their account.", "status": "available", "metadata": { "created_at": "2026-04-30T14:11:08.000Z" }, "attached_by_id": "1f4cabe4-5f9b-4b30-bc4f-fcd3e94a5b15", "created_at": "2026-05-07T05:25:56.361Z" } ], "referenced_issues": [], "created_at": "2026-05-07T05:26:11.327Z" } ], "next_cursor": "f8c3d1c3-6c9e-4ebf-bf0a-2a8b5b2e3d31" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Affected Context Source: https://docs.bland.ai/api-v1/get/triage-issues-id-affected GET https://api.bland.ai/v1/triage/issues/{id}/affected Calls, pathways, and personas affected by an issue. ## Overview Derived rollup of every call attached to an issue, grouped by pathway and persona. Powers the dashboard's Affected panel. Not paginated. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Response **data.issue\_id** `string` The issue this context belongs to. **data.calls** `array` Every attached call, with the pathway and persona it ran against. **Call fields** **call\_id** `string` **title** `string` Display title for the call. Falls back to a short ID if no pathway or persona name is available. **started\_at** `string | null` ISO 8601 timestamp. **pathway\_id** `string | null` **pathway\_name** `string | null` **pathway\_version\_id** `string | null` **version\_number** `number | null` **version\_label** `string | null` **persona\_id** `string | null` **persona\_name** `string | null` **data.pathways** `array` One entry per distinct pathway across the attached calls, with `call_count` and `call_ids` so you can deep-link. **Pathway fields** **pathway\_id** `string` **pathway\_name** `string` **pathway\_version\_id** `string | null` **version\_number** `number | null` **version\_label** `string | null` **call\_count** `number` **call\_ids** `string[]` **data.personas** `array` One entry per distinct persona, with `call_count` and `call_ids`. **Persona fields** **persona\_id** `string` **persona\_name** `string` **call\_count** `number` **call\_ids** `string[]` **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "issue_id": "db49f7b8-3214-4cb2-9f80-9d04379a9b8a", "calls": [ { "call_id": "95330a0e-d441-4586-96f8-28ea60677296", "title": "Sales demo flow", "started_at": "2026-04-30T14:11:08.000Z", "pathway_id": "8b2bb517-94d3-4cf6-9c7b-8c8ab9f8c4a1", "pathway_name": "Sales demo flow", "pathway_version_id": "f3ad7b24-8ab2-4f01-b04e-2c9f96d0d124", "version_number": 12, "version_label": "production", "persona_id": null, "persona_name": null } ], "pathways": [ { "pathway_id": "8b2bb517-94d3-4cf6-9c7b-8c8ab9f8c4a1", "pathway_name": "Sales demo flow", "pathway_version_id": "f3ad7b24-8ab2-4f01-b04e-2c9f96d0d124", "version_number": 12, "version_label": "production", "call_count": 1, "call_ids": ["95330a0e-d441-4586-96f8-28ea60677296"] } ], "personas": [] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Flags Source: https://docs.bland.ai/api-v1/get/triage-issues-id-flags GET https://api.bland.ai/v1/triage/issues/{id}/flags List flags on an issue. ## Overview Returns the flags filed on this issue. Same shape as [Add Flag](/api-v1/post/triage-issues-id-flags). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Query Parameters **limit** `integer` (default: 50) Number of flags to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Array of flags. See [Add Flag](/api-v1/post/triage-issues-id-flags#response) for the field list. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "items": [ { "id": "8ce11a7a-1a30-4c2c-9d3a-3e9aa56d2f02", "org_id": "5fa6dc9e-ec4d-4f94-9e0e-21f6f6a1e8f1", "issue_id": "cd4e1b6a-9a4c-4ec7-9c91-aa8b8aef0c89", "call_id": "02d77f64-342d-4c41-b2f6-02621eb94fc3", "type": "missed_handoff", "note": "Agent transferred without confirming the email.", "node_id": null, "node_name": null, "message_index": 12, "message_text": "OK, transferring you now.", "author_id": "32c10b62-0a4e-4ad8-bd4e-9b6e2a6e0a4f", "created_at": "2026-05-07T05:26:11.327Z" } ], "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Relations Source: https://docs.bland.ai/api-v1/get/triage-issues-id-relations GET https://api.bland.ai/v1/triage/issues/{id}/relations List relations on an issue. ## Overview Returns the relations to and from this issue. Each item carries `direction` (`outgoing` or `incoming`) and the related issue's `triage_id` and `title` denormalized for display. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Query Parameters **limit** `integer` (default: 50) Number of relations to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Array of relations. See [Link Related Issue](/api-v1/post/triage-issues-id-relations#response) for the field list. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "items": [ { "id": "172c839b-130d-4712-a09c-b767a78542ea", "org_id": "f5b40b9e-bc05-4b8a-9af1-d8f6a8a3a201", "issue_id": "9bbe5547-d5b1-4b83-9f80-87c4af7c6b34", "related_issue_id": "849ee9ce-be6b-4f9c-8e55-2736aeeb579f", "related_triage_id": "T-1004", "related_title": "Caller transferred to wrong queue", "relation_type": "duplicate_of", "direction": "outgoing", "created_by_id": "75c5c7da-a5d6-4e26-a51e-1ae8ef2bfa4a", "created_at": "2026-05-07T05:28:29.358Z" } ], "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Resources Source: https://docs.bland.ai/api-v1/get/triage-issues-id-resources GET https://api.bland.ai/v1/triage/issues/{id}/resources List resources attached to an issue. ## Overview Returns the resources currently attached. Same shape as [Attach Resource](/api-v1/post/triage-issues-id-resources). For a rollup of calls, pathways, and personas, use [Get Affected Context](/api-v1/get/triage-issues-id-affected). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Query Parameters **limit** `integer` (default: 50) Number of resources to return. Minimum 1, maximum 100. **cursor** `string` Opaque cursor returned as `next_cursor` from a previous page. *** ## Response **data.items** `array` Array of resource links. See [Attach Resource](/api-v1/post/triage-issues-id-resources#response) for the field list. **data.next\_cursor** `string | null` Cursor for the next page, or `null`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "items": [ { "id": "0a9d6b23-3e0f-4f3b-9d5e-2bfa3ddbd86c", "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "org_id": "8a73d4d5-d9a0-4c01-9b1a-0e5d3a3b4e2c", "resource_type": "call", "resource_id": "4d6e79af-13ad-4c85-8c6d-7e696d6b6380", "title": "Caller asked to be transferred to billing after the agent failed to verify their account.", "status": "available", "metadata": { "created_at": "2026-04-30T14:11:08.000Z" }, "attached_by_id": "1f4cabe4-5f9b-4b30-bc4f-fcd3e94a5b15", "created_at": "2026-05-07T05:25:56.361Z" } ], "next_cursor": null }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Knowledge Base Items Source: https://docs.bland.ai/api-v1/get/vectors GET https://api.bland.ai/v1/knowledgebases List all knowledge base items in your account. ### Headers **authorization** `string` *required* Your API key for authentication. **include-text** `boolean` (default: false) Include the full text of the documents stored in the knowledge base item. This can be useful for debugging, but may return large amounts of data. ### Response **vectors** `array` An array of objects, for each knowledge base item in your account. **vectors\[].vector\_id** `string` The unique identifier for the knowledge base item. **vectors\[].name** `string` The name of the knowledge base item. **vectors\[].description** `string` A description of the knowledge base item. ```json Response theme={null} { "vectors": [ { "vector_id": "KB-55e64dae-1585-4632-bc97-c909c288c6bc", "name": "Bland AI FAQs", "description": "Business facts, policies, and frequently asked questions for Bland AI." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Knowledge Base Item Details Source: https://docs.bland.ai/api-v1/get/vectors-id GET https://api.bland.ai/v1/knowledgebases/{vector_id} View the details for a specific knowledge base item. ### Headers **authorization** `string` *required* Your API key for authentication. **include-text** `boolean` (default: false) Include the full text of the documents stored in the knowledge base item. This can be useful for debugging, but may return large amounts of data. ### Path Parameters **vector\_id** `string` *required* The `vector_id` of the knowledge base item to view. ### Response **vector\_id** `string` The unique identifier for the knowledge base item. **name** `string` The name of the knowledge base item. **description** `string` A description of the knowledge base item. ```json Response theme={null} { { "vector_id": "KB-55e64dae-1585-4632-ae97-c909c288c6bc", "name": "Bland AI FAQs", "description": "Business facts, policies, and frequently asked questions for Bland AI." } } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Voices Source: https://docs.bland.ai/api-v1/get/voices GET https://api.bland.ai/v1/voices List all voices available to your account. ## Overview Returns every voice your account can use: Bland's curated default voices, voices you have cloned, voices you have added to your library from the public catalog, and voices owned by your org. For just the publicly-shared library, use [List Shared Voices](/api-v1/get/voices-shared) instead. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Response **voices** `array` Array of voices. **Voice fields** **id** `string` UUID of the voice. Pass this as `voice_id` to [Speak](/api-v2/post/tts) or any voice management endpoint. **name** `string` Display name. For curated default voices this can also be used in the `voice` field when sending calls. **description** `string | null` Short human-readable description of the voice. **public** `boolean` `true` for shared library voices and Bland curated voices, `false` for voices private to your org. **tags** `string[]` Labels describing the voice (language, style, source). Bland's recommended curated voices carry the `"Bland Curated"` tag. **user\_id** `string | null` Owner UUID. `null` for curated default voices. **voice\_id** `string` Underlying model identifier. Format varies by engine; treat as opaque. **service** `string` Engine identifier. One of `BTTS`, `BTTS_V2`, `BTTS_V3`, or `LEGACY`. **finetuned** `boolean` `true` if the voice has been fine-tuned past the base clone. **is\_creator\_voice** `boolean` `true` for voices in the Bland creator program. Creator voices may carry a per-character fee in addition to synthesis cost. **ratings** `number` Total number of ratings the voice has received. **total\_ratings** `number` Alias of `ratings` returned for backwards compatibility. **average\_rating** `number` Average rating, 0-5. **my\_rating** `number | null` The calling user's rating for this voice, if any. `null` when the caller has not rated it. Submit via [Rate Voice](/api-v1/post/voices-id-rate). **creator\_display\_name** `string | null` Creator name for voices in the creator program. `null` otherwise. ```json Response theme={null} { "voices": [ { "id": "d4610ec1-933d-44c9-a05f-53df2437808d", "name": "Karen", "description": "A mature female with a General American accent, nasal and deadpan, with a moderate pace, for customer support and IVR prompts.", "public": true, "tags": ["English", "Female", "General American", "customer support", "Bland Curated"], "user_id": null, "voice_id": "5134ee24-7d14-49a4-8aff-2215d295b6cc", "service": "BTTS_V3", "finetuned": false, "is_creator_voice": false, "ratings": 1234, "total_ratings": 1234, "average_rating": 4.6, "my_rating": null, "creator_display_name": null }, { "id": "5f29c646-1881-4882-8d8c-8616a2d5ce9c", "name": "MyClone", "description": null, "public": false, "tags": ["Beige Clone V3", "cloned", "female"], "user_id": "ffcf63aa-6298-471f-91ad-5d2653812042", "voice_id": "c18a1cd5-91ef-4b06-841a-e58b8b487e8c", "service": "BTTS_V3", "finetuned": false, "is_creator_voice": false, "ratings": 0, "total_ratings": 0, "average_rating": 0, "my_rating": null, "creator_display_name": null } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Voice Source: https://docs.bland.ai/api-v1/get/voices-id GET https://api.bland.ai/v1/voices/{id} Get details on a single voice. ## Overview Returns the full record for a single voice. Same field shape as [List Voices](/api-v1/get/voices). The `id` path parameter accepts either the voice's UUID or its `name` (for curated default voices like `Karen` and `Willow`). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Voice UUID or curated voice name. For example: * `GET /v1/voices/d4610ec1-933d-44c9-a05f-53df2437808d` * `GET /v1/voices/Karen` *** ## Response **voice** `object` The voice record. See [List Voices](/api-v1/get/voices#response) for the full field list. ```json Response theme={null} { "voice": { "id": "d4610ec1-933d-44c9-a05f-53df2437808d", "name": "Karen", "description": "A mature female with a General American accent, nasal and deadpan, with a moderate pace, for customer support and IVR prompts.", "public": true, "tags": ["English", "Female", "General American", "customer support", "Bland Curated"], "user_id": null, "voice_id": "5134ee24-7d14-49a4-8aff-2215d295b6cc", "service": "BTTS_V3", "finetuned": false, "is_creator_voice": false, "ratings": 1234, "total_ratings": 1234, "average_rating": 4.6, "my_rating": null, "creator_display_name": null } } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Voice Samples Source: https://docs.bland.ai/api-v1/get/voices-id-samples GET https://api.bland.ai/v1/voices/{id}/samples List the training samples attached to a voice clone you own. ## Overview Returns the training samples used to create a voice clone. Only voices owned by your org return samples; default voices and shared library voices return `400 VOICE_SAMPLES_ERROR` with the message `"Voice is a default voice and not owned by the user."` Retrievable samples are only present for V1 (`BTTS`) voices. **V2 and V3 voices both return `[]`** even though they were cloned from a sample, because the underlying single source clip is not exposed via this endpoint. Use the source audio of your original clone for those. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice. *** ## Query Parameters **include\_audio** `boolean` (default: false) When `true`, includes base64-encoded audio data with each sample. Increases response size significantly. Use [Get Voice Sample](/api-v1/get/voices-id-samples-sample-id) for a single sample with audio instead. *** ## Response **samples** `array` Array of training sample records. Empty array for V3 voices. **Sample fields** **id** `string` UUID of the sample. **voice\_id** `string` UUID of the parent voice. **transcription** `string | null` Transcribed text for the sample. `null` if transcription has not been generated yet. **duration\_seconds** `number` Length of the sample audio. **audio\_data** `string` Base64-encoded audio. Only present when `include_audio=true`. **created\_at** `string` ISO 8601 timestamp. ```json Response theme={null} { "samples": [] } ``` ```json Not Owned theme={null} { "data": null, "errors": [ { "error": "VOICE_SAMPLES_ERROR", "message": "Voice is a default voice and not owned by the user." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Voice Sample Source: https://docs.bland.ai/api-v1/get/voices-id-samples-sample-id GET https://api.bland.ai/v1/voices/{id}/samples/{sample_id} Download a single training sample as audio or JSON metadata. ## Overview Returns a single training sample for a voice you own. By default the response is the raw WAV audio. Pass `?format=json` to get the metadata plus base64-encoded audio instead. Only voices owned by your org return samples. Default voices and shared-library voices return `400 VOICE_SAMPLE_ERROR`. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the parent voice. **sample\_id** `string` *required* UUID of the sample to fetch. *** ## Query Parameters **format** `string` (default: audio) Response format. `audio` returns the raw WAV binary, `json` returns sample metadata with base64-encoded audio under `data`. *** ## Response With `format=audio` (default), returns the WAV binary with: * `Content-Type: audio/wav` * `Content-Disposition: attachment; filename="sample-.wav"` With `format=json`, returns sample metadata. **sample** `object` Only present in JSON mode. **Sample fields** **id** `string` **voice\_id** `string` **transcription** `string | null` **duration\_seconds** `number` **audio\_data** `string` Base64-encoded WAV audio. **created\_at** `string` ```http Audio Response theme={null} HTTP/1.1 200 OK Content-Type: audio/wav Content-Length: 245318 Content-Disposition: attachment; filename="sample-d15b199a.wav" ``` ```json JSON Response theme={null} { "sample": { "id": "d15b199a-1b79-4664-9a9a-b149ee3b136a", "voice_id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9", "transcription": "Hello and welcome to Bland.", "duration_seconds": 11.4, "audio_data": "", "created_at": "2026-06-22T21:34:31.347Z" } } ``` ```json Audio Not Found theme={null} { "data": null, "errors": [ { "error": "AUDIO_NOT_FOUND", "message": "No audio data found for this sample" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Voice Settings Source: https://docs.bland.ai/api-v1/get/voices-id-settings GET https://api.bland.ai/v1/voices/{id}/settings Get the current consistency/expressiveness defaults on a voice you own. ## Overview Returns the current synthesis defaults stored on a voice you own, plus the valid range for each tunable so callers do not have to discover the bounds by trial and error. Different engines expose different settings: * **BTTS V1**: `consistency` (0-1 float) and `expressiveness` (0-1 float). * **BTTS V2**: `consistency` (0-64 integer, lower is more consistent) and `expressiveness` (0-1 float). * **BTTS V3**: a single boolean `boost_language_consistency`. To update these settings, use [Update Voice Settings](/api-v1/post/voices-id-settings). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice. *** ## Response For V1 and V2 voices: **consistency** `number` **expressiveness** `number` **service** `string` The engine identifier, e.g. `BTTS_V2`. **limits** `object` Valid ranges for the tunables. **limits fields** **consistency.min** `number` **consistency.max** `number` `1` for V1, `64` for V2. **expressiveness.min** `number` **expressiveness.max** `number` For V3 voices: **boost\_language\_consistency** `boolean` **service** `string` `BTTS_V3`. ```json V2 Response theme={null} { "consistency": 8, "expressiveness": 1, "service": "BTTS_V2", "limits": { "consistency": { "min": 0, "max": 64 }, "expressiveness": { "min": 0, "max": 1 } } } ``` ```json V3 Response theme={null} { "boost_language_consistency": true, "service": "BTTS_V3" } ``` ```json Not Owned theme={null} { "data": null, "errors": [ { "error": "VOICE_SETTINGS_ERROR", "message": "Voice is a default voice and not owned by the user." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Shared Voices Source: https://docs.bland.ai/api-v1/get/voices-shared GET https://api.bland.ai/v1/voices/shared Browse the public Bland voice library. ## Overview Returns the catalog of publicly-shared voices in the Bland library. These are voices that other creators have published for everyone to use; they are not in your org's library until you call [Add Library Voice](/api-v1/post/voices-library-add-id). Use this endpoint to power voice-picker UIs and discovery flows. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Query Parameters **limit** `integer` (default: 50) Number of voices to return. **offset** `integer` (default: 0) Pagination offset. **search** `string` Free-text search across voice name, description, and tags. **language** `string` Filter to voices tagged for a specific language (for example `en`, `es`, `ja`). *** ## Response **voices** `array` Array of shared voices. **Voice fields** **id** `string` UUID of the shared voice. Pass to [Add Library Voice](/api-v1/post/voices-library-add-id) to add it to your org. **name** `string` Display name in the public library. **description** `string | null` **service** `string` The voice's underlying TTS service. Examples: `BTTS_V2`, `BTTS_V3`. **is\_creator\_voice** `boolean` `true` if the voice is part of the creator program. Creator voices may carry a per-character fee in addition to the synthesis cost. **ratings** `number` Total number of ratings the voice has received. **rating\_count** `number` Alias of `ratings` returned for backwards compatibility. **rating\_avg** `number` Average rating, 0-5. **trending\_score** `number` Internal score used to surface trending voices in the dashboard. **tags** `string[]` **created\_at** `string` ISO 8601 timestamp. **public** `boolean` Always `true` for entries in the shared library. **creator\_display\_name** `string | null` Name of the creator who published the voice, if applicable. **creator\_fee\_cents\_per\_1k** `number | null` Per-character creator fee in cents per 1,000 characters. `null` for non-creator voices. **creator\_fee\_cents\_per\_10k** `number | null` Per-character creator fee in cents per 10,000 characters. `null` for non-creator voices. ```json Response theme={null} { "voices": [ { "id": "e657b253-ca1f-41cc-b25f-7267ae644519", "name": "StephenD", "description": null, "service": "BTTS_V2", "is_creator_voice": false, "ratings": 12, "rating_count": 12, "rating_avg": 4.5, "trending_score": 0, "tags": ["english", "male", "cloned"], "created_at": "2026-04-16T09:14:25.232Z", "public": true, "creator_display_name": null, "creator_fee_cents_per_1k": null, "creator_fee_cents_per_10k": null } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Custom Components Source: https://docs.bland.ai/api-v1/get/widget-custom-components GET https://api.bland.ai/v1/widget/custom_components Retrieves a specific custom component by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `number` HTTP status code (200 for success). **data** `object` * `id` (string): Custom component UUID * `org_id` (string): Organization UUID * `widget_id` (string): Widget identifier UUID * `pathway_id` (string): Associated pathway UUID * `pathway_node` (string): Pathway node ID to display the custom component on * `width` (string): Widget width dimension * `height` (string): Widget height dimension * `variables` (string\[]): Array of variable names to pass into the custom component iframe URL as query params * `iframe_url` (string): URL for the iframe source * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "data": [ { "created_at": "2025-10-02T21:45:27.633Z", "updated_at": "2025-10-02T21:45:27.633Z", "id": "70b56282-8db5-4e26-aad9-098c099fb1db", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "widget_id": "7d1a8c0d-5346-4f96-9f5c-d888e273eaf0", "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad", "pathway_node": "1", "width": "100%", "height": "300px", "variables": [ "firstName" ], "iframe_url": "https://widget-custom-components.vercel.app" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Widget by ID Source: https://docs.bland.ai/api-v1/get/widget-id GET https://api.bland.ai/v1/widget/{id} Retrieves a specific widget by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* UUID of the widget to retrieve. ### Response **status** `number` HTTP status code (200 for success). **data** `object` The widget object containing: * `id` (string): Widget UUID * `pathway_id` (string | null): Associated pathway UUID * `agent_id` (string | null): Associated agent UUID or null * `agent_prompt` (string | null): Agent prompt used instead of pathway * `allowed_domains` (string\[]): Array of allowed domains * `messages_per_minute` (number): Rate limit for messages * `config` (object): Widget configuration object * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "status": 200, "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7", "agent_id": "46f37229-7d12-44be-b343-6e68274cfbea", "allowed_domains": ["example.com", "subdomain.example.com"], "messages_per_minute": 10, "config": { "theme": "light", "position": "bottom-right", "greeting": "Hello! How can I help you today?" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T12:45:00Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Widget Threads Source: https://docs.bland.ai/api-v1/get/widget-id-threads GET https://api.bland.ai/v1/widget/{id}/threads Retrieves all conversation threads for a specific widget. Returns threads ordered by creation date (newest first) with associated messages ordered chronologically. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* UUID of the widget to retrieve threads for. ### Query Parameters **page** `number` (default: 1) Page number for pagination (minimum 1). **limit** `number` (default: 20) Number of threads per page (minimum 1, maximum 100). **thread\_id** `string` Filter results to a specific thread by its UUID. ### Response **status** `number` HTTP status code (200 for success). **data** `object` * `threads` (array): Array of thread objects, each containing: * `id` (string): Thread UUID * `created_at` (string): ISO timestamp * `ended_at` (string | null): ISO timestamp of when the thread ended * `live_agent_handoff_at` (string | null): ISO timestamp of when the thread was handed off to a live agent * `visitor_id` (string | null): UUID of visitor (if available) * `messages` (array): Array of message objects, each containing: * `id` (string): Message UUID * `sender_type` (string): Either "USER" or "ASSISTANT" * `created_at` (string): ISO timestamp * `content` (string): Message content * `original_content` (string | null): Original message content before any modifications * `total` (number): Total number of threads matching the query (useful for calculating total pages) > [!NOTE] > > This endpoint does not return 404 if no threads exist; it returns an empty array instead. ```json Response theme={null} { "status": 200, "data": { "threads": [ { "id": "thread_550e8400-e29b-41d4-a716-446655440000", "created_at": "2024-01-15T14:30:00Z", "ended_at": null, "live_agent_handoff_at": null, "visitor_id": "visitor_123456789", "messages": [ { "id": "msg_001", "sender_type": "USER", "created_at": "2024-01-15T14:30:00Z", "content": "Hello, I need help with my order", "original_content": null }, { "id": "msg_002", "sender_type": "ASSISTANT", "created_at": "2024-01-15T14:30:15Z", "content": "I'd be happy to help you with your order! Can you please provide your order number?", "original_content": null }, { "id": "msg_003", "sender_type": "USER", "created_at": "2024-01-15T14:30:45Z", "content": "It's order #12345", "original_content": null } ] }, { "id": "thread_660f9511-f3ac-52e5-b827-557766551111", "created_at": "2024-01-15T13:15:00Z", "ended_at": "2024-01-15T13:20:00Z", "live_agent_handoff_at": null, "visitor_id": null, "messages": [ { "id": "msg_101", "sender_type": "USER", "created_at": "2024-01-15T13:15:00Z", "content": "What are your business hours?", "original_content": null }, { "id": "msg_102", "sender_type": "ASSISTANT", "created_at": "2024-01-15T13:15:05Z", "content": "Our business hours are Monday through Friday, 9 AM to 6 PM EST.", "original_content": null } ] } ], "total": 2 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Widgets Source: https://docs.bland.ai/api-v1/get/widgets GET https://api.bland.ai/v1/widgets Retrieves all widgets associated with your account. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `number` HTTP status code (200 for success). **data** `object[]` The widget object containing: * `id` (string): Widget UUID * `pathway_id` (string | null): Associated pathway UUID * `agent_id` (string | null): Associated agent UUID or null * `agent_prompt` (string | null): Agent prompt used instead of pathway * `allowed_domains` (string\[]): Array of allowed domains * `messages_per_minute` (number): Rate limit for messages * `config` (object): Widget configuration object * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "status": 200, "data": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7", "agent_id": "46f37229-7d12-44be-b343-6e68274cfbea", "allowed_domains": ["example.com", "subdomain.example.com"], "messages_per_minute": 10, "config": { "theme": "light", "position": "bottom-right", "greeting": "Hello! How can I help you today?" }, "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T12:45:00Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # OAuth client credentials Source: https://docs.bland.ai/api-v1/oauth-client-credentials Send server-to-server requests to the Bland API with access tokens that expire after one hour, instead of a long-lived API key. An OAuth client lets your server request an access token from Bland and use that token to call the API. The token lasts one hour. The client's credentials stay on your server and go only to the token endpoint, never with an API request. Use OAuth clients when your security policy asks for short-lived tokens, or when you want a long-lived secret to stay out of every request. Use an API key when you don't need that. | | API key | OAuth client | | - | - | - | | What you send to the API | The key, with every request | An access token that expires after 1 hour | | How long it works | Until you delete the key | The token for 1 hour. The client until you disable or delete it | | What it can reach | Everything, or the permissions you pick for a [restricted key](/api-v1/post/keys-create#restricted-keys) | The permissions you pick for the client | A token reaches the same routes as a restricted API key with the same permissions. ## Before you start * You must be an owner or admin of your organization. * You need access to OAuth clients. If you don't see **OAuth clients** on Settings > API keys, contact Bland support. * You create and manage clients in the dashboard only. API keys and access tokens can't create or manage them. * OAuth clients are in the V2 dashboard, at the addresses in the table below. Create the client in the dashboard for your organization's region, and use that region's API host. A client works only in the region where you created it. | Region | Dashboard | API host | Token endpoint | | - | - | - | - | | US | `https://v2.app.bland.ai` | `https://api.bland.ai` | `https://api.bland.ai/authorization/oauth2/token` | | EU | `https://v2.eu.app.bland.ai` | `https://eu.api.bland.ai` | `https://eu.api.bland.ai/authorization/oauth2/token` | | Canada | `https://v2.ca.app.bland.ai` | `https://ca.api.bland.ai` | `https://ca.api.bland.ai/authorization/oauth2/token` | | Asia | `https://v2.asia.app.bland.ai` | `https://asia.api.bland.ai` | `https://asia.api.bland.ai/authorization/oauth2/token` | The examples below use the EU host. Replace it with yours. ## Create a client **1. Open the page** Go to Settings > API keys and find **OAuth clients**. Select **Create OAuth client**. **2. Name the client and pick permissions** Enter a name of up to 64 characters. Under **Permissions**, pick at least one. A token can never reach more than the client's permissions. See [Permissions](#permissions). **3. Choose how the client signs in** Pick **Client secret** or **Private key JWT**. With **Client secret**, Bland generates a secret and shows it once. With **Private key JWT**, you sign each token request with your own private key, and you paste the matching public keys as a JWK Set. Each key needs a `kid`. Use RSA keys of at least 2048 bits, or EC keys on P-256, P-384, or P-521, with no private parameters. **4. Save the credentials** Select **Create OAuth client**. Copy the client ID and, for a client secret, the secret. Bland shows the secret only once. If you lose it, rotate the secret to get a new one. You can't change a client's permissions or keys in the dashboard. To change them, create a new client, switch your integration to it, and delete the old one. ## Get an access token Send a `POST` request to your region's token endpoint with `grant_type=client_credentials`. The endpoint accepts form-encoded bodies. | Parameter | Required | Value | | - | - | - | | `grant_type` | Yes | `client_credentials` | | `scope` | No | Space-separated scopes, each one of the client's permissions. If you leave it out, the token carries all of the client's permissions. | | `resource` | No | Your region's API host with no path and no trailing slash, for example `https://eu.api.bland.ai`. If you leave it out, it defaults to that value. Any other value is refused. | Authenticate the request in one of two ways, matching how you created the client. A client can use only the method it was created with. ### Client secret Send the client ID and secret in the HTTP `Authorization` header, using Basic authentication. Don't put the secret in the request body. ```bash theme={null} curl -u "$CLIENT_ID:$CLIENT_SECRET" \ -d grant_type=client_credentials \ --data-urlencode 'scope=calls:read agents:write' \ https://eu.api.bland.ai/authorization/oauth2/token ``` The response looks like this. There is no refresh token. ```json theme={null} { "access_token": "eyJhbGciOiJSUzI1NiIs...", "token_type": "Bearer", "expires_in": 3600, "scope": "calls:read agents:write" } ``` ### Private key JWT Sign a short-lived JWT (a client assertion) with your private key, and send it instead of a secret. The assertion needs these claims: | Claim or header | Value | | - | - | | `alg` (header) | For an RSA key, `RS256`, `RS384`, `RS512`, `PS256`, `PS384`, or `PS512`. For an EC key, `ES256`, `ES384`, or `ES512`, matching the key's curve | | `kid` (header) | The `kid` of the matching public key in your JWK Set | | `iss` | Your client ID | | `sub` | Your client ID | | `aud` | The token endpoint you are posting to, for example `https://eu.api.bland.ai/authorization/oauth2/token` | | `jti` | A unique ID for this assertion. Bland refuses an assertion it has already seen | | `exp` | No more than 5 minutes in the future | Build a new assertion for each token request. Send these fields, and don't send an `Authorization` header: * `grant_type=client_credentials` * `client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer` * `client_assertion=` * `scope`, if you want fewer than all of the client's permissions To make a key pair and a JWK Set to paste into the dashboard, run this once. It writes the private key to `private-key.pem` and prints the public JWK Set. ```js theme={null} import { writeFile } from "node:fs/promises"; import { exportJWK, exportPKCS8, generateKeyPair } from "jose"; const { publicKey, privateKey } = await generateKeyPair("RS256", { extractable: true, }); const jwk = { ...(await exportJWK(publicKey)), kid: "my-key-1", alg: "RS256", use: "sig", }; await writeFile("private-key.pem", await exportPKCS8(privateKey)); console.log(JSON.stringify({ keys: [jwk] }, null, 2)); ``` ```js Node.js theme={null} import { randomUUID } from "node:crypto"; import { readFileSync } from "node:fs"; import { importPKCS8, SignJWT } from "jose"; const tokenEndpoint = "https://eu.api.bland.ai/authorization/oauth2/token"; const clientId = process.env.BLAND_CLIENT_ID; const keyId = process.env.BLAND_KEY_ID; // the kid in your JWK Set const privateKey = await importPKCS8( readFileSync("private-key.pem", "utf8"), "RS256", ); const assertion = await new SignJWT({}) .setProtectedHeader({ alg: "RS256", kid: keyId }) .setIssuer(clientId) .setSubject(clientId) .setAudience(tokenEndpoint) .setJti(randomUUID()) .setIssuedAt() .setExpirationTime("2m") .sign(privateKey); const response = await fetch(tokenEndpoint, { method: "POST", body: new URLSearchParams({ grant_type: "client_credentials", client_assertion_type: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", client_assertion: assertion, scope: "calls:read", }), }); if (!response.ok) { throw new Error( `Token request failed: ${response.status} ${await response.text()}`, ); } const { access_token, expires_in } = await response.json(); ``` ```python Python theme={null} import os import time import uuid import jwt # PyJWT, with the cryptography package installed import requests TOKEN_ENDPOINT = "https://eu.api.bland.ai/authorization/oauth2/token" CLIENT_ID = os.environ["BLAND_CLIENT_ID"] KEY_ID = os.environ["BLAND_KEY_ID"] # the kid in your JWK Set with open("private-key.pem") as key_file: private_key = key_file.read() now = int(time.time()) assertion = jwt.encode( { "iss": CLIENT_ID, "sub": CLIENT_ID, "aud": TOKEN_ENDPOINT, "jti": str(uuid.uuid4()), "iat": now, "exp": now + 120, }, private_key, algorithm="RS256", headers={"kid": KEY_ID}, ) response = requests.post( TOKEN_ENDPOINT, data={ "grant_type": "client_credentials", "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", "client_assertion": assertion, "scope": "calls:read", }, timeout=10, ) response.raise_for_status() token = response.json() access_token = token["access_token"] expires_in = token["expires_in"] ``` ## Call the API Send the access token in the `Authorization` header as a bearer token. ```bash theme={null} curl 'https://eu.api.bland.ai/v1/calls?limit=1' \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` > [!WARNING] > > Don't send the `x-bland-org-id` header. The token already names your > organization, and a request with that header is refused with a 400. ### Token lifetime A token lasts 1 hour (`expires_in` is in seconds), and there are no refresh tokens. Cache the token and request a new one a few minutes before it expires. Don't request a token for every API call: the token endpoint allows 60 requests a minute from one IP address. If an API call returns `401`, request a new token and retry once. If the token request fails with `invalid_client`, the client was disabled or deleted, or its secret was rotated. ## Permissions A client's permissions are scopes in the form `resource:action`, the same scopes a [restricted API key](/api-v1/post/keys-create#restricted-keys) uses. In the dashboard, a resource and an action together make a scope. For example, **Calls** and **Read** is `calls:read`, and **Evals** and **Manage** is `evals:run`. Use the scope names in the `scope` parameter. A scope can include others. If you pick `agents:write`, the client also holds `agents:read`, and you can request either. A token reaches only the routes its scopes allow. A route outside them returns `403` with the error `INSUFFICIENT_SCOPE`. When some scope opens the route, the response's `required_scope` names the scopes the token is missing, separated by spaces. | Scope | What it allows | Also includes | | - | - | - | | `agents:read` | Read agent and pathway definitions, versions, folders, and branches | None | | `agents:write` | Create, edit, publish, and roll back agents and pathways. Can use your organization's stored secrets and connected credentials in webhooks, tools, and dynamic data | `agents:read` | | `calls:read` | Read call details, transcripts, recordings, analysis, and batch logs | None | | `calls:create` | Place phone calls (billed to this org). Can use your organization's stored secrets and connected credentials in webhooks, tools, and dynamic data | `calls:stop` | | `knowledge:read` | Read knowledge base sources, versions, gaps, and caller questions | None | | `knowledge:write` | Add, edit, sync, and delete knowledge bases, and answer gaps | `knowledge:read` | | `dispositions:read` | Read dispositions, extractors, versions, and test results | None | | `dispositions:write` | Create, edit, publish, and delete dispositions and extractors. Published dispositions run on every call, billed to this org, and their custom code can use your organization's stored secrets and connected credentials | `dispositions:read` | | `evals:read` | Read evaluation call sets, setups, templates, and status. Reading judges, runs, and results needs a full-access API key | None | | `evals:run` | Create, edit, and delete evaluation call sets, setups, and templates. Running evaluations and editing judges need a full-access API key | `evals:read` | | `voices:read` | Read voices, clone transcripts and source audio, generation history, and usage | None | | `voices:generate` | Generate speech from text (billed to this org) | `voices:read` | | `sms:read` | List SMS conversations, and read each number's messaging channel settings | None | | `sms:send` | Send SMS messages, start conversations, and hand them to or back from a human (billed to this org). Sending as a persona can change the number's persona binding | `sms:read` | | `analytics:read` | Read call summaries, caller geography, pathway flow, citations, saved boards, and conversation selections. Some analytics routes need a full-access API key | None | | `tests:read` | Read agent test scenarios, runs, and results | None | | `tests:run` | Create, edit, and run agent tests (simulated conversations that run the agent's webhook and tool nodes for real, billed to this org) | `tests:read` | For the endpoints each scope opens, and what stays closed to every scope, see [Restricted keys](/api-v1/post/keys-create#restricted-keys). > [!NOTE] > > Some permissions let a token use credentials stored in your organization. A token with `agents:write`, `calls:create`, or `dispositions:write` can use stored secrets and connected credentials, the same as a restricted API key with those permissions. Pick these permissions only for a client you trust with those credentials. ## Rotate, disable, and delete A client belongs to your organization, not to the person who created it. It keeps working if that person leaves. An owner or admin disables or deletes it. Open the menu on the client's row in Settings > API keys > OAuth clients. * **Rotate secret.** Available for Client secret clients. The old secret stops working at once. Tokens you already received keep working until they expire, up to 1 hour. Private key JWT clients have no secret to rotate. To replace a key, create a new client with the new key set and delete the old one. * **Disable client.** New token requests fail with `invalid_client` right away, and tokens the client already holds stop working on their next request. Select **Enable client** to turn it back on. * **Delete client.** The same effect as disabling, and it can't be undone. The **Last used** column shows when the client last received a token. It doesn't show API calls made with a token you already hold. ## Limits * A token lasts 1 hour, and there are no refresh tokens. * The token endpoint allows 60 requests a minute from one IP address, shared by every client behind it. * A client assertion can't expire more than 5 minutes in the future. * A client name has 1 to 64 characters. ## Errors The token endpoint returns JSON with an `error` code and an `error_description`. | Error | Meaning | What to do | | - | - | - | | `invalid_client` | The client ID is unknown, the client is disabled or deleted, the secret is wrong or was rotated, the secret was sent in the request body, or the assertion is expired, replayed, or has a bad signature. A wrong secret returns `401`. | Check the client in Settings > API keys. Send a secret with Basic authentication, or build a new assertion. | | `unauthorized_client` | The client ID isn't one of your OAuth clients. It belongs to an application that can't use this grant. | Use the client ID shown in Settings > API keys > OAuth clients. | | `invalid_scope` | A scope is outside the client's permissions, or isn't an API scope (for example `openid`). | Request only scopes the client holds, or leave `scope` out. | | `invalid_target` | `resource` isn't exactly your region's API host, or you sent more than one `resource`. | Leave `resource` out, or send the host with no path and no trailing slash. | | `unsupported_grant_type` | OAuth clients are not turned on for your region. | Contact Bland support. | A token request over the rate limit returns `429` in the standard Bland error format, with the error `TOO_MANY_REQUESTS` in the `errors` array. Wait a minute, and cache your token. The API returns these errors when you use a token: | Status | Error | Meaning | | - | - | - | | 400 | `AUTH_FAILURE` | You sent the `x-bland-org-id` header. | | 401 | `AUTH_FAILURE` | The token is expired or invalid, or the client was disabled or deleted. Request a new token. | | 403 | `INSUFFICIENT_SCOPE` | The token's scopes don't allow this route. When some scope opens the route, `required_scope` names the scopes the token is missing. | *** Docs for agents: [llms.txt](/llms.txt) # Update Alarm Source: https://docs.bland.ai/api-v1/patch/alarms-id PATCH https://api.bland.ai/v1/alarms/{id} Update an alarm configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Body Parameters **threshold** `number` Updated positive numeric threshold. Notes: * `threshold` is a sensitivity scalar (higher values are less sensitive; lower values are more sensitive). * The Dashboard may display an approximate "% change" visualization for this value. Treat that UI percentage as a directional aid, not an exact conversion. Dashboard sensitivity presets map to these threshold values: * `Sensitive` → `0.5` * `Normal` → `1.0` * `Relaxed` → `2.0` * `Critical` → `2.5` **enabled** `boolean` Controls whether this alarm is actively evaluated. * `true`: Alarm is active. The system will evaluate this metric on scheduled runs and can generate alarm/recovery events and notifications. * `false`: Alarm is paused. The config is retained, but scheduled evaluation and notifications for this alarm are disabled until re-enabled. **webhook\_config** `object|null` Updated webhook settings. Set to `null` to clear. `webhook_config` should be a JSON object with: * `url` (string, required when object is provided) * `headers` (object, optional) Example: ```json theme={null} { "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "application/json" } } } ``` **email\_addresses** `string[]` Updated email recipients. **sms\_numbers** `string[]` Updated SMS recipients. ### Response **data.alarm** `object` Updated alarm configuration object. **data.alarm.webhook\_config** `object|null` Updated webhook settings object. Header values may be masked in API responses. **data.alarm.email\_addresses** `string[]` Updated email recipients. Can be an empty array if none are configured. **data.alarm.sms\_numbers** `string[]` Updated SMS recipients. Can be an empty array if none are configured. **errors** `null|array` `null` on success, otherwise an array of error objects. ```json Success theme={null} { "data": { "alarm": { "id": "d4cfd8aa-7df4-4fd7-a5cf-8c5d2871a1f8", "metric_type": "latency", "enabled": true, "threshold": 0.5, "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "appl***" } }, "email_addresses": ["alerts@example.com"], "sms_numbers": [], "created_at": "2026-03-12T16:13:02.694Z", "updated_at": "2026-03-12T16:45:52.721Z" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Citation Schema Source: https://docs.bland.ai/api-v1/patch/citation-schemas PATCH https://api.bland.ai/v1/citation_schemas/ Update an existing citation schema's name, description, or schema configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **id** `string` *required* The unique identifier of the citation schema to update. ### Body Parameters **name** `string` The updated name for the citation schema. **description** `string` The updated description for the citation schema. **schema** `object` 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 extraction * `groupings`: Array of related variable collections * `conditions`: Array of conditional logic rules Example structure: ```json theme={null} { "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": [] } ``` > [!NOTE] > > At least one field (name, description, or schema) must be provided in the request body. ### Response **status** `integer` HTTP status code (200 for success). **data** `object` The updated citation schema object. **id** `string` The unique identifier for the citation schema (UUID format). **name** `string` The updated name of the citation schema. **description** `string` The updated description of the citation schema. **org\_id** `string` The organization ID that owns this schema. **schema** `object` The updated JSON schema configuration for citation extraction. **created\_at** `string` The timestamp when the citation schema was originally created (ISO 8601 format). **errors** `null` Will be null for successful requests. ### Error Responses **400 Bad Request** Returned when: * The schema ID parameter is missing * No update fields are provided in the request body **404 Not Found** Returned when the specified citation schema is not found or doesn't belong to your organization. ```json Response theme={null} { "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](/llms.txt) # Update Contact Source: https://docs.bland.ai/api-v1/patch/contacts-id PATCH https://api.bland.ai/v1/contacts/{contact_id} Update an existing contact's information. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **contact\_id** `string` *required* The unique identifier of the contact to update. ### Body Parameters **name** `string` Updated name for the contact. **email** `string` Email address to add or update for the contact. **external\_id** `string` External ID to add or update for the contact. **metadata** `object` Custom metadata to merge with existing metadata. New keys are added, existing keys are updated. ### Response **data** `object` The updated contact object. **data.id** `string` Unique identifier for the contact. **data.org\_id** `string` Organization ID the contact belongs to. **data.name** `string` Contact's name. **data.metadata** `object` Custom metadata associated with the contact. **data.created\_at** `string` ISO timestamp when the contact was created. **data.updated\_at** `string` ISO timestamp when the contact was last updated. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "John Smith", "metadata": { "source": "web_signup", "preferences": { "language": "en" }, "verified": true }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T16:00:00.000Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Contact not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Outcome Source: https://docs.bland.ai/api-v1/patch/dispositions-id PATCH https://api.bland.ai/v1/dispositions/{id} Rename an outcome, replace its script or change its metadata. Send only the fields you want to change. Updating `script` saves a new version and increases `snippet_version` by 1. Runs after that use the new version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. ### Body Parameters **name** `string` A new name. 1 to 100 characters, letters and underscores only. **script** `string` The new JavaScript source, up to 200,000 characters. It follows the same rules as [Create Outcome](/api-v1/post/dispositions). **metadata** `object` Replaces the stored metadata. ### Response **data** `object` The updated outcome, with the same fields as [Create Outcome](/api-v1/post/dispositions) returns. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "id": "59627e31-6ec8-4d03-9bfc-11c2e6c8910c", "org_id": "5c96ed8c-6bba-4c56-93f6-08a04e08ca47", "name": "appointment_outcome", "metadata": {}, "snippet_id": "85352170-a09d-4557-9112-643bb8425577", "snippet_version": 4, "created_at": "2026-10-20T18:22:05.117Z", "updated_at": "2026-10-26T15:12:48.250Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Eval Agent Source: https://docs.bland.ai/api-v1/patch/evals-agents-id PATCH https://api.bland.ai/v1/evals/agents/{eval_agent_id} Update an eval agent's metadata or repoint its active version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent to update. ### Body Parameters **name** `string` New display name for the eval agent. Between 1 and 200 characters. **description** `string | null` Updated description, or `null` to clear it. **active\_version\_id** `string | null` Repoint the published version to this version ID. Pass `null` to unpublish the agent. **metadata** `object` Key-value metadata to associate with the eval agent. Values must be strings. Replaces the existing metadata object. > [!NOTE] > > This endpoint updates agent-level fields only. To edit prompts, levels, or targets, update the agent's draft version using the Update Eval Agent Version endpoint. ### Response **data.agent** `object` The updated eval agent. **data.agent.id** `string` Unique identifier for the eval agent. **data.agent.org\_id** `string` ID of the organization that owns this eval agent. **data.agent.key** `string` Unique slug key for the eval agent within the organization. **data.agent.name** `string` Display name of the eval agent. **data.agent.description** `string | null` Description of what the eval agent grades, or `null`. **data.agent.current\_version\_id** `string` ID of the current editable draft version. **data.agent.active\_version\_id** `string | null` ID of the published version, or `null` if unpublished. **data.agent.metadata** `object` Updated key-value metadata. Values are strings. **data.agent.created\_at** `string` ISO 8601 timestamp for when the eval agent was created. **data.agent.updated\_at** `string` ISO 8601 timestamp for when the eval agent was last updated. **data.agent.deleted\_at** `string | null` ISO 8601 timestamp if the eval agent has been soft-deleted, otherwise `null`. **data.current\_version** `object` The current editable draft version of the eval agent. **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.eval\_agent\_id** `string` ID of the parent eval agent. **data.current\_version.version\_number** `integer` Sequential version number. **data.current\_version.name** `string` Name of this version. **data.current\_version.description** `string | null` Optional description of this version. **data.current\_version.state** `string` State of this version. One of `editable` or `archived`. **data.current\_version.modality** `string` One of `text` or `audio`. **data.current\_version.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.current\_version.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.current\_version.levels** `array of objects` Verdict levels for graded mode. Empty array for pass/fail mode. **data.current\_version.target\_level\_keys** `array of strings` Which level keys count as a target match. **data.current\_version.weight** `number` Relative weight of this agent in aggregate scoring. Between 0 and 100. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null`. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "agent": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "key": "empathy-check", "name": "Empathy Check (Updated)", "description": "Grades how empathetic the agent sounds during difficult conversations.", "current_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "active_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "metadata": { "team": "cx-quality" }, "created_at": "2026-03-01T09:00:00.000Z", "updated_at": "2026-05-27T11:00:00.000Z", "deleted_at": null }, "current_version": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Empathy Check v3", "description": "Refined grading criteria based on feedback.", "state": "editable", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer.", "prompt_md": "Did the agent express empathy when the caller described their problem?", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent clearly and warmly acknowledged the caller's feelings.", "color": "emerald" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored or dismissed the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 10, "created_from_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" } } } ``` # Update Eval Agent Version Source: https://docs.bland.ai/api-v1/patch/evals-agents-id-versions-id PATCH https://api.bland.ai/v1/evals/agents/{eval_agent_id}/versions/{version_id} Edit a draft version's prompt, levels, targets, or weight. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent. **version\_id** `string` *required* The unique identifier of the version to update. Must be in the `editable` state. ### Body Parameters **name** `string` Updated display name for this version. Between 1 and 200 characters. **description** `string | null` Updated description, or `null` to clear it. **modality** `string` The modality for this version. One of `text` or `audio`. **system\_prompt\_md** `string` Updated system prompt for the judge LLM, in Markdown. Maximum 8000 characters. **prompt\_md** `string` Updated grading prompt for the judge LLM, in Markdown. Maximum 8000 characters. **levels** `array of objects` Verdict levels for graded mode. Pass an empty array for pass/fail mode. Maximum 5 levels. Each level object requires: * `level_key` (string, 1-64 characters): unique key within this version. * `label` (string, 1-80 characters): display label shown in results. * `prompt_md` (string): description used in the grading prompt. * `color` (string, optional): one of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, `fog`. **target\_level\_keys** `array of strings` Which level keys count as a target match. Must be empty for pass/fail agents. Every key listed must match a defined level. **weight** `number` Relative weight of this agent in aggregate scoring. Between 0 and 100. ### Response **data.id** `string` Unique identifier for this version. **data.org\_id** `string` ID of the organization that owns this version. **data.eval\_agent\_id** `string` ID of the parent eval agent. **data.version\_number** `integer` Sequential version number. **data.name** `string` Name of this version. **data.description** `string | null` Description of this version, or `null`. **data.state** `string` State of this version. One of `editable` or `archived`. **data.modality** `string` One of `text` or `audio`. **data.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.levels** `array of objects` Updated verdict levels. Each level contains `level_key`, `label`, `prompt_md`, and optionally `color`. **data.target\_level\_keys** `array of strings` Updated target level keys. **data.weight** `number` Updated weight. Between 0 and 100. **data.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null`. **data.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Empathy Check v3", "description": "Refined grading criteria with clearer level descriptions.", "state": "editable", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer specializing in empathy.", "prompt_md": "Did the agent acknowledge and validate the caller's feelings? Review the full transcript and select the most appropriate verdict.", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent proactively acknowledged the caller's feelings with warmth and specificity.", "color": "emerald" }, { "level_key": "adequate", "label": "Adequate", "prompt_md": "The agent showed some empathy but responses were generic or brief.", "color": "amber" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored, dismissed, or failed to acknowledge the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 15, "created_from_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "updated_at": "2026-05-27T12:00:00.000Z" } } ``` # Update User Template Source: https://docs.bland.ai/api-v1/patch/evals-user-templates-id PATCH https://api.bland.ai/v1/evals/user-templates/{id} Update a saved eval agent template. The source pointers cannot be changed. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The UUID of the user template to update. ### Body Parameters **name** `string` Display name for the template. Maximum 120 characters. **description** `string` Description of the template. Maximum 4000 characters. Pass `null` to clear. **category** `string` Category label for the template. Maximum 64 characters. Pass `null` to clear. **system\_prompt\_md** `string` System prompt for the eval agent, in Markdown. Maximum 50000 characters. **prompt\_md** `string` Evaluation prompt, in Markdown. Maximum 50000 characters. **levels** `array` Ordered scoring levels. Each level object requires `level_key` (string, 1-64 chars), `label` (string, 1-80 chars), and `prompt_md` (string). The `color` field is optional: one of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold. **visibility** `string` Access scope for the template. One of `private`, `org`, or `public`. ### Response **id** `string` Unique identifier (UUID) for the template. **org\_id** `string` UUID of the organization that owns this template. **key** `string` Short key used to reference the template. **name** `string` Display name of the template. **description** `string` Description of the template, or `null`. **category** `string` Category of the template, or `null`. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` System prompt for the eval agent, in Markdown. **prompt\_md** `string` Evaluation prompt, in Markdown. **levels** `array` Ordered scoring levels. **level object** **level\_key** `string` Short identifier for the level, 1-64 characters. **label** `string` Display label for the level, 1-80 characters. **prompt\_md** `string` Prompt describing this level's criteria, in Markdown. **color** `string` Optional display color. One of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold. **visibility** `string` Access scope. One of `private`, `org`, or `public`. **source\_agent\_id** `string` UUID of the eval agent this template was snapshotted from, or `null`. **source\_version\_id** `string` UUID of the specific version snapshotted, or `null`. **created\_by** `string` UUID of the user who created the template, or `null`. **created\_at** `string` ISO 8601 timestamp of when the template was created. **updated\_at** `string` ISO 8601 timestamp of when the template was last updated. ```json Response theme={null} { "data": { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "key": "my_hallucination_check", "name": "My Hallucination Check (Updated)", "description": "Updated description for our product domain.", "category": "quality", "modality": "text", "system_prompt_md": "You are an expert evaluator assessing whether an AI agent fabricated information.", "prompt_md": "Review the conversation and identify any claims that were factually incorrect or unsupported.", "levels": [ { "level_key": "no_hallucination", "label": "No Hallucination", "prompt_md": "The agent made no factually incorrect or unsupported claims.", "color": "emerald" }, { "level_key": "minor_hallucination", "label": "Minor Hallucination", "prompt_md": "The agent made one or more small inaccuracies that did not materially mislead the user.", "color": "amber" }, { "level_key": "major_hallucination", "label": "Major Hallucination", "prompt_md": "The agent stated clearly false or fabricated information.", "color": "rose" } ], "target_level_keys": ["no_hallucination"], "visibility": "org", "source_agent_id": null, "source_version_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T15:45:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Workbench Setup Source: https://docs.bland.ai/api-v1/patch/evals-workbench-setups-id PATCH https://api.bland.ai/v1/evals/workbench-setups/{setup_id} Update a workbench setup's metadata or repoint its active version. > [!NOTE] > > This endpoint updates setup-level fields only. To edit attached agents, the pass threshold, or run mode, update the setup's draft version using the Update Workbench Setup Version endpoint. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup to update. ### Body Parameters All fields are optional. Only include fields you want to update. **name** `string` Updated display name for the setup. Between 1 and 200 characters. **description** `string | null` Updated description, or `null` to clear it. **active\_version\_id** `string | null` Repoint the published version to a different archived version ID. Set to `null` to unpublish the setup. **metadata** `object` Key-value metadata to associate with the setup. Values must be strings. ### Response **data** `object` An object containing the updated setup and its current draft version. **setup** **data.setup.id** `string` Unique identifier for the workbench setup. **data.setup.org\_id** `string` ID of the organization that owns this setup. **data.setup.key** `string` Stable slug key for the setup. **data.setup.name** `string` Display name of the setup. **data.setup.description** `string | null` Description of the setup, or `null` if not set. **data.setup.current\_version\_id** `string` ID of the current editable draft version. **data.setup.active\_version\_id** `string | null` ID of the published version, or `null` if unpublished. **data.setup.metadata** `object` Key-value metadata. Values are strings. **data.setup.created\_at** `string` ISO 8601 timestamp for when the setup was created. **data.setup.updated\_at** `string` ISO 8601 timestamp for when the setup was last updated. **data.setup.deleted\_at** `string | null` ISO 8601 timestamp for when the setup was deleted, or `null` if not deleted. **current\_version** **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.workbench\_setup\_id** `string` ID of the parent workbench setup. **data.current\_version.version\_number** `integer` Monotonically increasing version number. **data.current\_version.name** `string` Display name of this version. **data.current\_version.description** `string | null` Description of this version, or `null` if not set. **data.current\_version.state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **data.current\_version.attached\_agents** `array` Eval agents attached to this version. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **data.current\_version.pass\_threshold\_pct** `integer | null` Percentage of calls that must pass for a run to be considered passing (0-100), or `null` if not set. **data.current\_version.run\_mode** `string` How calls are evaluated. One of `text`, `audio`, or `full`. **data.current\_version.default\_test\_config\_id** `string | null` ID of the default test configuration, or `null` if not set. **data.current\_version.default\_call\_ids** `array of strings` Default call IDs to evaluate against. Up to 5000 entries. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if it is the first version. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "setup": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "key": "onboarding-quality-check", "name": "Onboarding Quality Check v2", "description": "Updated evaluation suite for Q2 onboarding calls.", "current_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "active_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "metadata": { "team": "cx" }, "created_at": "2026-03-15T08:00:00.000Z", "updated_at": "2026-05-27T11:30:00.000Z", "deleted_at": null }, "current_version": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 4, "name": "Onboarding Quality Check v2", "description": "Updated evaluation suite for Q2 onboarding calls.", "state": "editable", "attached_agents": [ { "eval_agent_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_version_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "weight": 50, "target_level_keys": ["good", "excellent"] } ], "pass_threshold_pct": 80, "run_mode": "audio", "default_test_config_id": null, "default_call_ids": [], "created_from_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-20T14:00:00.000Z", "updated_at": "2026-05-27T11:30:00.000Z" } } } ``` # Update Workbench Setup Version Source: https://docs.bland.ai/api-v1/patch/evals-workbench-setups-id-versions-id PATCH https://api.bland.ai/v1/evals/workbench-setups/{setup_id}/versions/{version_id} Edit a draft version's attached agents, threshold, run mode, or default calls. > [!NOTE] > > Only versions in the `editable` state can be updated. To make changes to a published (`archived`) version, fork a new draft from it first using the Create Workbench Setup Version endpoint. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup. **version\_id** `string` *required* The ID of the draft version to update. ### Body Parameters All fields are optional. Only include fields you want to update. **name** `string` Updated display name for the version. Between 1 and 200 characters. **description** `string | null` Updated description, or `null` to clear it. **attached\_agents** `array` Replaces the full list of attached eval agents. Up to 20 agents. Each item requires: * `eval_agent_id` (string, required) - ID of the eval agent to attach. * `eval_agent_version_id` (string, required) - Version of the eval agent to use. * `weight` (number, required) - Relative weight for this agent in scoring (0-100). * `target_level_keys` (array of strings, required) - One or more target level keys this agent evaluates against. **pass\_threshold\_pct** `integer | null` Percentage of calls that must pass for a run to be considered passing. Between 0 and 100, or `null` to clear. **run\_mode** `string` How calls are evaluated. One of `text`, `audio`, or `full`. **default\_test\_config\_id** `string | null` ID of the default test configuration to use for runs, or `null` to clear. **default\_call\_ids** `array of strings` Default call IDs to evaluate against when no explicit call list is provided at run time. Replaces the existing list. Up to 5000 entries. ### Response **data** `object` The full updated version object. **version fields** **id** `string` Unique identifier for this version. **org\_id** `string` ID of the organization that owns this version. **workbench\_setup\_id** `string` ID of the parent workbench setup. **version\_number** `integer` Monotonically increasing version number. **name** `string` Display name of this version. **description** `string | null` Description of this version, or `null` if not set. **state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **attached\_agents** `array` Updated list of eval agents. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **pass\_threshold\_pct** `integer | null` Updated pass threshold percentage (0-100), or `null` if not set. **run\_mode** `string` Updated run mode. One of `text`, `audio`, or `full`. **default\_test\_config\_id** `string | null` Updated default test configuration ID, or `null` if not set. **default\_call\_ids** `array of strings` Updated default call IDs. Up to 5000 entries. **created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if it is the first version. **created\_by** `string | null` Identifier of the user who created this version, or `null`. **created\_at** `string` ISO 8601 timestamp for when this version was created. **updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 4, "name": "Onboarding Quality Check", "description": "Updated to include empathy grading.", "state": "editable", "attached_agents": [ { "eval_agent_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_version_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "weight": 40, "target_level_keys": ["good", "excellent"] }, { "eval_agent_id": "a0b1c2d3-e4f5-6789-abcd-ef0123456789", "eval_agent_version_id": "b1c2d3e4-f5a6-7890-bcde-f01234567890", "weight": 60, "target_level_keys": ["acceptable", "good"] } ], "pass_threshold_pct": 80, "run_mode": "full", "default_test_config_id": null, "default_call_ids": [ "call_abc123", "call_def456", "call_ghi789" ], "created_from_version_id": "d4e5f6a7-b8c9-0123-defa-234567890123", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-20T14:00:00.000Z", "updated_at": "2026-05-27T12:00:00.000Z" } } ``` # Update Guard Rail Source: https://docs.bland.ai/api-v1/patch/guard-rails-id PATCH https://api.bland.ai/v1/guard_rails/{guard_rail_id} Update an existing guard rail configuration. > [!NOTE] > > The `type` field cannot be changed after creation. To change the type, delete the guard rail and create a new one. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **guard\_rail\_id** `string` *required* The unique identifier of the guard rail to update. ### Body Parameters All fields are optional. Only include fields you want to update. **name** `string` Updated name for the guard rail (custom guard rails only). **description** `string` Updated description (custom guard rails only). **prompt** `string` Updated detection prompt (custom guard rails only). **config** `object` Updated configuration object. For TCPA time-based guard rails, set `end_seconds` to change the time window. **attachments** `array` Updated array of sources to attach this guard rail to. This replaces all existing attachments. Each attachment requires: * `source_type` (string) - Type of source: `PERSONA`, `PATHWAY`, or `INBOUND` * `source_id` (string) - ID of the source to attach to * `actions` (array) - Actions to take when the guard rail triggers ### Response **data** `object` The updated guard rail object containing `id`, `org_id`, `type`, `name`, `description`, `prompt`, `config`, `attachments`, `created_at`, and `updated_at`. **errors** `array` Any errors that occurred (null if none). ```json Update config theme={null} { "config": { "end_seconds": 45 } } ``` ```json Update prompt theme={null} { "prompt": "Flag if the agent provides any medical advice, diagnosis, treatment recommendations, or medication suggestions" } ``` ```json Update attachments theme={null} { "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "end_call" } ] }, { "source_type": "PATHWAY", "source_id": "11111111-2222-3333-4444-555555555555", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ] } ``` ```json Response theme={null} { "data": { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "org_id": "12345678-1234-1234-1234-123456789012", "type": "tcpa:ai_disclosure", "name": null, "description": null, "prompt": null, "config": { "end_seconds": 45 }, "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "end_call" } ] } ], "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-16T14:20:00.000Z" }, "errors": null } ``` ```json Error Response (Cannot Update Type) theme={null} { "data": null, "errors": [ { "error": "INVALID_PARAMETER", "message": "Cannot update type of guard rail" } ] } ``` ```json Error Response (Not Found) theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Guard rail not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Rename API Key Source: https://docs.bland.ai/api-v1/patch/keys-rename PATCH https://api.bland.ai/keys/rename Change the name of an API key. ### Headers **authorization** `string` *required* Your API key for authentication. Restricted keys cannot rename keys. ### Body **key** `string` *required* The first 14 characters of the key, as returned by [List API Keys](/api-v1/post/keys-list). Works for full-access and restricted keys. **name** `string` *required* The new name, up to 64 characters after trimming whitespace. It cannot be blank. ### Response **data** `null` `null` on success. **errors** `null | array` `null` on success. Returns `404` when the key is not found and `403` when you are not allowed to rename it. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Contact Facts Source: https://docs.bland.ai/api-v1/patch/memory-contact-id-facts PATCH https://api.bland.ai/v1/memory/contact/{memory_id}/facts Merge new facts into a contact's memory record. Existing keys are updated and new keys are added, but no keys are deleted. Facts are structured key-value pairs (e.g. name, plan, timezone) that persist across all conversations. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the contact memory record. ### Body Parameters **facts** `object` *required* Key-value pairs to merge with existing facts. New keys are added, existing keys are updated. ### Response **data** `object` The updated contact memory object. **data.id** `string` Unique identifier for the contact memory. **data.facts** `object` The merged facts object. **errors** `null` Error array (null on success). ### Facts Examples Facts can store any structured information about the contact: ```json theme={null} { "facts": { "name": "John Doe", "company": "Acme Corp", "role": "CTO", "preferred_contact": "phone", "timezone": "America/New_York", "plan": "premium", "account_number": "ACC-12345" } } ``` ```json Response theme={null} { "data": { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer is a premium plan subscriber.", "facts": { "name": "John Doe", "company": "Acme Corp", "role": "CTO", "preferred_contact": "phone", "timezone": "America/New_York" }, "recent_messages": [...], "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T16:00:00.000Z" }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "facts is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Conversation Summary Source: https://docs.bland.ai/api-v1/patch/memory-contact-id-summary PATCH https://api.bland.ai/v1/memory/contact/{memory_id}/summary Overwrite the conversation summary for a contact memory. The summary is a plain-text overview of past interactions that the agent uses for context at the start of each conversation. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the contact memory record. ### Body Parameters **summary** `string` *required* The new summary text. This replaces the existing summary. ### Response **data** `object` The updated contact memory object. **data.id** `string` Unique identifier for the contact memory. **data.summary** `string` The updated summary. **data.summary\_updated\_at** `string` ISO timestamp when the summary was last updated. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer is a premium plan subscriber. Recently inquired about order #12345 which is in transit. Preferred contact method is phone. Located in EST timezone.", "summary_updated_at": "2025-07-22T16:00:00.000Z", "facts": { "name": "John Doe" }, "recent_messages": [...], "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T16:00:00.000Z" }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "summary is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Organization Member Permissions Source: https://docs.bland.ai/api-v1/patch/org_member_permissions PATCH https://api.bland.ai/v1/orgs/{org_id}/members/permissions Modify the permissions of an existing member within an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. ### Body **action** `string` *required* The action to perform on the member's permissions.\ \ Valid values: `"add"`, `"remove"`, `"reset"`, `"set"` **target** `string` *required* The user ID of the member whose permissions are being modified. **permissions** `string[]` *required* A list of permissions to update.\ \ Valid values: `"owner"`, `"admin"`, `"operator"`, `"viewer"` ### Response **data** `object` Contains the updated permissions for the user. **data.newPermissions** `string[]` The updated list of permissions assigned to the user. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "newPermissions": ["viewer", "operator"] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Organization Members Source: https://docs.bland.ai/api-v1/patch/org_members PATCH https://api.bland.ai/v1/orgs/{org_id}/members Add or remove members from an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. ### Body **action** `string` *required* The action to perform.\ \ Valid values: `"add"`, `"remove"` **target** `string` *required* Who to add or remove. Accepts an existing user ID, a phone number (E.164 format, e.g. `+14155550123`), or an email address.\ \ When you pass a phone number or email that doesn't match an existing user, an invitation is created. Phone number invitees receive an SMS, and email invitees receive a sign-up link. Invitees are automatically added to the organization when they sign up with the same phone number or email. **permissions** `string[]` A list of permissions to assign when adding a member.\ \ Required only when `action` is `"add"`.\ \ Valid values: `"owner"`, `"admin"`, `"operator"`, `"viewer"` **is\_invite** `boolean` Whether the removal applies to an invite instead of a full member.\ \ Required only when `action` is `"remove"`. ### Response **data** `null` Always `null` upon successful update. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Organization Properties Source: https://docs.bland.ai/api-v1/patch/org_properties PATCH https://api.bland.ai/v1/orgs/{org_id}/properties Modify specific properties of an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. ### Body **updates** `object` *required* An object containing the properties to update.\ \ \ **Valid keys:** * `"org_display_name"` (string) - The display name of the organization. Must be between **1 and 30 characters**. * `"preferences"` (object) - Preference settings for the organization: * `"use_bland_url"` (boolean) - Whether the organization prefers to use the Bland URL. * `"recording_lifespan_days"` (integer) - The lifespan of recordings in days. Must be between **1 and 1825** (inclusive) or `-1` to disable retention. ### Response **data** `object` The updated organization properties. **data.id** `string` The unique identifier of the organization. **data.org\_slug** `string` The unique slug identifier of the organization. **data.org\_display\_name** `string` The updated display name of the organization. **data.org\_image\_url** `string | null` URL of the organization's image (if set). **data.org\_plan** `string` The organization's plan. Default: `"starter"`. **data.org\_creation\_date** `string (ISO 8601)` The timestamp of when the organization was created. **data.kyc\_level** `integer` The KYC (Know Your Customer) verification level. Default: `0`. **data.placement\_group** `string` The placement group of the organization. Default: `"blandshared"`. **data.is\_deleted** `boolean` Whether the organization is deleted. Default: `false`. **data.is\_stripe\_overdue** `boolean` Whether the organization has overdue Stripe payments. Default: `false`. **data.is\_suspended** `boolean` Whether the organization is suspended. Default: `false`. **data.org\_rate\_limit** `integer` The organization's request rate limit. Default: `5`. **data.org\_type** `string` The type of the organization. Default: `"normal"`. **data.entitlements** `array` A list of entitlements granted to the organization. Default: `[]`. **data.preferences** `object` The updated preferences for the organization. **data.preferences.use\_bland\_url** `boolean` Whether the organization prefers to use the Bland URL. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "id": "d122b4cf-1614-4124-aa28-15f81a09988f", "org_slug": "133906ea-d750-4a15-80fa-d6aef584dc58", "org_display_name": "Org Name", "org_image_url": null, "org_plan": "starter", "org_creation_date": "2025-02-14T06:46:09.818Z", "kyc_level": 0, "placement_group": "blandshared", "is_deleted": false, "is_stripe_overdue": false, "is_suspended": false, "org_rate_limit": 5, "org_type": "normal", "entitlements": [], "preferences": { "use_bland_url": false } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Organization's Service Version Source: https://docs.bland.ai/api-v1/patch/org_version PATCH https://api.bland.ai/v1/orgs/{org_id}/versions/{service} Update the current version of a specified service for an organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **org\_id** `string` *required* The unique identifier of the organization. **service** `string` *required* The name of the service whose version you want to update.\ \ Valid values: `"api_server"`, `"ws_server"` ### Body **version** `string` *required* The new version identifier to set for the specified service. ### Response **data** `null` Always `null` upon successful update. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Persona Source: https://docs.bland.ai/api-v1/patch/personas-id PATCH https://api.bland.ai/v1/personas/{persona_id} Update an existing persona configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona to update. ### Body Parameters **name** `string` *required* Updated display name for the persona. **role** `string` Updated role assigned to the persona. **description** `string` Updated description of the persona's purpose and use case. **tags** `array` Updated array of tags to associate with the persona. **image\_url** `string` Updated URL of the persona's profile image. **call\_config** `object` Updated call configuration settings for the persona. **call\_config** **voice** `string` Voice identifier to use for calls. **record** `boolean` Whether to record calls. **language** `string` Language code for the persona. **background** `string` Background audio setting. **max\_duration** `number` Maximum call duration in minutes. **wait\_for\_greeting** `boolean` Whether to wait for greeting before starting. **interruption\_threshold** `number` Interruption sensitivity threshold. **orchestration\_prompt** `string` Updated orchestration prompt for the persona. **personality\_prompt** `string` Updated personality and behavior prompt for the persona. **default\_tools** `array` Updated array of default tools enabled for the persona. **pathway\_conditions** `array` Updated array of pathway routing conditions for the persona. **pathway condition** **name** `string` *required* Name of the pathway condition. **prompt** `string` *required* Prompt that triggers this pathway condition. **pathway\_id** `string` *required* ID of the pathway to route to. **pathway\_version** `string` *required* Version of the pathway to use. **start\_node\_id** `string` *required* Starting node ID within the pathway. **kb\_ids** `array` Updated array of knowledge base item IDs to connect to the persona. ### Response **data** `object` The updated persona object. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose. **tags** `array` Array of tags associated with the persona. **image\_url** `string` URL of the persona's profile image (null if none). **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **deleted\_at** `string` ISO 8601 timestamp of when the persona was deleted (null if active). **user\_id** `string` ID of the user who owns this persona. **current\_production\_version\_id** `string` ID of the current production version. **current\_draft\_version\_id** `string` ID of the current draft version. **inbound\_numbers** `array` Array of inbound phone numbers using this persona. **current\_production\_version** `object` Complete production version object. **current\_draft\_version** `object` Complete draft version object with updated configuration. **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Blandy", "role": null, "description": "Helpful Agent for Bland Documentation", "tags": [], "image_url": null, "created_at": "2025-09-23T15:13:36.348Z", "updated_at": "2025-09-23T15:43:49.257Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789012", "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-23T15:13:36.368Z", "promoted_by": null, "created_at": "2025-09-23T15:13:36.369Z", "updated_at": "2025-09-23T15:13:36.369Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-23T15:13:36.390Z", "updated_at": "2025-09-23T15:13:36.390Z" }, "inbound_numbers": [] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Persona Number Settings Source: https://docs.bland.ai/api-v1/patch/personas-id-inbound-phone-settings PATCH https://api.bland.ai/v1/personas/{persona_id}/inbound/{phone_number}/settings Update persona-specific settings for a phone number attached to a persona. Use this to configure per-number pathway overrides while still using the persona's base configuration. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona the phone number is attached to. **phone\_number** `string` *required* The E.164 formatted phone number to update settings for. This number must currently be attached to the specified persona. ### Body Parameters **persona\_settings** `object | null` *required* Persona-specific settings for this phone number. Pass `null` to clear all per-number settings and fall back to the persona's defaults. **persona\_settings object** **pathway\_id** `string` Override the persona's default pathway with a specific pathway for calls/messages on this number. **pathway\_version** `number` Specific version of the pathway to use. **start\_node\_id** `string` Specific node within the pathway to start from. ### Response **data** `object` The updated inbound number record. **inbound number object** **id** `number` Internal ID of the inbound number record. **phone\_number** `string` The E.164 formatted phone number. **persona\_id** `string` The persona this number is attached to. **persona\_settings** `object` The updated persona settings for this number, or `null` if cleared. **updated\_at** `string` ISO 8601 timestamp of when the record was last modified. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Request (Set pathway override) theme={null} { "persona_settings": { "pathway_id": "pathway_abc123", "pathway_version": 2, "start_node_id": "node_xyz" } } ``` ```json Response (Success) theme={null} { "data": { "id": 42, "phone_number": "+14155551234", "persona_id": "12345678-1234-1234-1234-123456789012", "persona_settings": { "pathway_id": "pathway_abc123", "pathway_version": 2, "start_node_id": "node_xyz" }, "updated_at": "2025-09-23T16:00:00.000Z" }, "errors": null } ``` ```json Request (Clear settings) theme={null} { "persona_settings": null } ``` ```json Error Response (Number not attached to persona) theme={null} { "data": null, "errors": [ { "error": "INBOUND_NOT_FOUND", "message": "Inbound number not found or not attached to this persona" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Advanced Config Source: https://docs.bland.ai/api-v1/patch/sip-config PATCH https://api.bland.ai/v1/sip/config Update advanced SIP configuration including failover, codecs, and alerts. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The phone number to update configuration for. Must be in E.164 format. **direction** `string` *required* The direction to update: `"inbound"` or `"outbound"`. **failover\_config** `object` Failover configuration: * `enabled` (boolean) — Enable/disable failover * `endpoints` (array) — Failover SIP servers, each with `host`, `port`, `transport`, and `priority` * `triggers` (array) — Conditions that trigger failover: `"unreachable"`, `"auth_failure"`, `"timeout"` * `failback` (string) — `"auto"` or `"manual"` **codec\_config** `object` Codec configuration: * `codecs` (array) — Ordered list of codec names: `"PCMU"`, `"PCMA"`, `"G.729"`, `"Opus"`, `"G.722"` * `transcode` (boolean) — Enable transcoding between codecs **alert\_config** `object` Alert configuration: * `enabled` (boolean) — Enable/disable alerts * `thresholds` — `unreachable_minutes` (number), `failure_rate_percent` (number), `failure_rate_window_minutes` (number), `response_time_ms` (number) * `channels` — `email` (boolean), `sms` (boolean), `webhook` (string, URL) ```json Example Request theme={null} curl -X PATCH https://api.bland.ai/v1/sip/config \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14150000000", "direction": "outbound", "failover_config": { "enabled": true, "endpoints": [ { "host": "backup1.sip.provider.com", "port": 5061, "transport": "tls", "priority": 1 }, { "host": "backup2.sip.provider.com", "port": 5061, "transport": "tls", "priority": 2 } ], "triggers": ["unreachable", "timeout"], "failback": "auto" }, "codec_config": { "codecs": ["PCMU", "PCMA", "Opus"], "transcode": true }, "alert_config": { "enabled": true, "thresholds": { "unreachable_minutes": 5, "failure_rate_percent": 20, "failure_rate_window_minutes": 30, "response_time_ms": 500 }, "channels": { "email": true, "sms": false, "webhook": "https://hooks.example.com/sip-alerts" } } }' ``` *** Docs for agents: [llms.txt](/llms.txt) # Update SMS Conversation Source: https://docs.bland.ai/api-v1/patch/sms-conversations-id PATCH https://api.bland.ai/v1/sms/conversations/{conversation_id} Updates properties of an existing SMS conversation. > [!NOTE] > > **Enterprise Feature** - This endpoint is available for enterprise customers only. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **conversation\_id** `string` *required* The unique identifier of the SMS conversation to update. ### Body Parameters **is\_active** `boolean` Sets the active status of the conversation. When set to `false`, the conversation will be marked as inactive. ### Response **message** `string` Confirmation message indicating the conversation was updated successfully. **conversation** `object` The updated conversation object containing the new values. **conversation.id** `string` The unique identifier of the conversation. **conversation.is\_active** `boolean` The current active status of the conversation. **conversation.updated\_at** `string` ISO 8601 timestamp of when the conversation was last updated. ```json Success Response theme={null} { "message": "Conversation updated successfully", "conversation": { "id": "conv_1234567890", "is_active": false, "updated_at": "2024-01-15T10:30:00.000Z" } } ``` ```json 400 Error Response theme={null} { "data": null, "errors": [ { "message": "Conversation ID is required", "error": "CONVERSATION_ID_REQUIRED" } ] } ``` ```json 404 Error Response theme={null} { "data": null, "errors": [ { "message": "Conversation not found", "error": "CONVERSATION_NOT_FOUND" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Issue Source: https://docs.bland.ai/api-v1/patch/triage-issues-id PATCH https://api.bland.ai/v1/triage/issues/{id} Update a triage issue. All fields optional. ## Overview Partial update. Send only the fields you want to change. Pass `null` for `owner_id` or `assignee_id` to clear them. Returns the full updated issue. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Body Parameters Send any combination of the fields below. Sending an empty body is allowed but a no-op. **title** `string` New title. 1-200 characters. **description** `string` New description. Maximum 10,000 characters. **status** `string` New status. One of `backlog`, `todo`, `in_progress`, `in_review`, `done`, `closed`. **severity** `string` New severity. One of `critical`, `high`, `medium`, `low`. **category** `string` New category. 1-64 characters. The category does not need to exist in the [Categories](/api-v1/get/triage-categories) catalog beforehand, freely-typed values are accepted. **owner\_id** `string | null` New owner. Pass a user ID to assign, or `null` to clear. **assignee\_id** `string | null` New assignee. Pass a user ID to assign, or `null` to clear. *** ## Response **data** `object` The updated issue. See [Create Issue](/api-v1/post/triage-issues#response) for the full field list. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist or is not in your org. Returns 400 with `{ error: "bad_request" }` if any field fails validation, the message lists each invalid path. ```json Response theme={null} { "data": { "id": "b4f022b0-e47e-4c8e-b67c-b763db7b4ba4", "triage_id": "T-1042", "org_id": "f038cd1d-aa49-4127-ab2d-90c3fce669f3", "number": 1042, "title": "Agent skipped the verification step (confirmed)", "description": "On the Aug 12 demo flow the agent jumped to the closing node without asking for the email confirmation.", "status": "in_progress", "severity": "high", "source": "manual", "category": "Routing", "owner_id": null, "assignee_id": "d8dddfff-cc75-4e31-8056-cf3521e8055b", "author_id": "df480553-8bf8-4327-917d-402c33282a2e", "external_link": null, "created_at": "2026-05-04T18:24:11.482Z", "updated_at": "2026-05-07T02:29:25.744Z", "last_activity_at": "2026-05-07T02:29:25.744Z", "resource_count": 3, "flag_count": 1, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Knowledge Base Item Source: https://docs.bland.ai/api-v1/patch/vectors-id PATCH https://api.bland.ai/v1/knowledgebases/{vector_id} Update a knowledge base item. Usage: Pass the `vector_id` into your agent's `tools` to enable the agent to use the knowledge base item. ```json theme={null} "tools": [ "KB-55e64dae-1585-4632-ae97-c909c288c6bc" ] ``` ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **vector\_id** `string` *required* The `vector_id` of the knowledge base item to update. ### Body **name** `string` *required* The name of the knowledge base item. Make this a clear name that describes the contents of the store. **description** `string` *required* A description of the knowledge base item. This can be a longer description of the contents of the knowledge base item, or what terms to use to search for vectors in the knowledge base item. This is visible to the AI, so making it descriptive can help the AI understand when to use it or not. **text** `string` *required* The full text document to be stored and vectorized. ### Response **vector\_id** `string` The unique identifier for the knowledge base item. Will start with "KB-". ```json theme={null} { "vector_id": "KB-55e64dae-1585-4632-ae97-c909c288c6bc" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Voice Config Source: https://docs.bland.ai/api-v1/patch/voices-id-config PATCH https://api.bland.ai/v1/voices/{id}/config Update default synthesis settings on a voice you own. ## Overview Updates the default consistency and expressiveness settings on a voice clone. These defaults are applied when [Speak](/api-v2/post/tts) is called without per-request overrides. Equivalent to [Update Voice Settings](/api-v1/post/voices-id-settings) (`POST /v1/voices/{id}/settings`). Both share the same write path; `POST /settings` is the canonical form and returns a lighter response envelope. This `PATCH /config` route is kept for backwards compatibility. The accepted parameters depend on the voice's engine: * **BTTS V1** voices accept `consistency` (0.0-1.0 float) and `expressiveness` (0.0-1.0 float). * **BTTS V2 / V3** voices accept `consistency` (1-32 integer, lower is more consistent) and `boost` (0 or 1). Only voices owned by your org can be configured. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice to configure. *** ## Body Parameters **consistency** `number` Default consistency for this voice. Float 0.0-1.0 for V1 voices; integer 1-32 for V2/V3 voices (lower is more consistent). **expressiveness** `number` Default expressiveness for V1 voices only. Float 0.0-1.0. **boost** `integer` Expressiveness boost for V2 and V3 voices only. `0` or `1`. *** ## Response Returns the full updated voice. **status** `string` `success` on success. **message** `string` Human-readable confirmation, for example `"Voice configuration updated successfully"`. **voice** `object` The updated voice. See [Get Voice](/api-v1/get/voices-id#response) for the full field list. ```json Response theme={null} { "status": "success", "message": "Voice configuration updated successfully", "voice": { "id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9", "name": "DocTestRename", "description": null, "public": false, "ratings": 0, "tags": ["Beige Clone V2", "male"], "user_id": "fea2a74f-9bd7-4b5d-a52e-c3c1a3f58bb0", "voice_id": "ff595c98-da38-4617-ada3-df42561a2379", "service": "BTTS_V2", "finetuned": false, "consistency": 8, "expressiveness": null, "voice_meta": { "per_decode": 8 }, "is_creator_voice": false } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Rename Voice Source: https://docs.bland.ai/api-v1/patch/voices-id-rename PATCH https://api.bland.ai/v1/voices/{id}/rename Change the display name of a cloned voice you own. ## Overview Renames a voice clone in your library. Only voices owned by your org can be renamed; default and shared-library voices return `403`. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice to rename. *** ## Body Parameters **name** `string` *required* New display name. 1-30 characters. Must be unique within your library. *** ## Response **data.name** `string` The updated display name. **data.voice\_id** `string` UUID of the renamed voice. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "name": "DocTestRename", "voice_id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9" }, "errors": null } ``` ```json Name Taken theme={null} { "data": null, "errors": [ { "error": "Validation Error", "message": "Voice name is already taken" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Voice Sample Transcriptions Source: https://docs.bland.ai/api-v1/patch/voices-id-samples PATCH https://api.bland.ai/v1/voices/{id}/samples Update the transcription text on one or more training samples. ## Overview Updates the transcribed text for one or more samples on a voice clone you own. Useful when auto-transcription has errors that you want to correct before the voice is used. The samples themselves and their audio are not modified. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the parent voice. *** ## Body Parameters **samples** `array` *required* Array of sample updates. Each entry must include `id` and `transcription`. ```json theme={null} { "samples": [ { "id": "d15b199a-1b79-4664-9a9a-b149ee3b136a", "transcription": "Hello and welcome to Bland." } ] } ``` *** ## Response **status** `string` `success` on success. **samples** `array` The updated samples. See [List Voice Samples](/api-v1/get/voices-id-samples#response) for field shape. ```json Response theme={null} { "status": "success", "samples": [ { "id": "d15b199a-1b79-4664-9a9a-b149ee3b136a", "voice_id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9", "transcription": "Hello and welcome to Bland.", "duration_seconds": 11.4, "created_at": "2026-06-22T21:34:31.347Z" } ] } ``` ```json Invalid Request theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Missing or invalid samples array" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Custom Component Source: https://docs.bland.ai/api-v1/patch/widget-custom-components-id PATCH https://api.bland.ai/v1/widget/custom_components/{id} Retrieves a specific custom component by ID. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* UUID of the custom component to update. ### Body **widget\_id** `string` Widget identifier UUID to associate with the custom component. **pathway\_id** `string` Pathway UUID to associate with the custom component. **pathway\_node** `string` Pathway node ID to display the custom component on. **width** `string` Widget width dimension (e.g., "100%", "500px"). **height** `string` Widget height dimension (e.g., "300px", "100%"). **variables** `string[]` Array of available agent variable names to pass into the custom component iframe URL as query params. **iframe\_url** `string` URL for the iframe source. ### Response **status** `number` HTTP status code (200 for success). **data** `object` * `id` (string): Custom component UUID * `org_id` (string): Organization UUID * `widget_id` (string): Widget identifier UUID * `pathway_id` (string): Associated pathway UUID * `pathway_node` (string): Pathway node ID to display the custom component on * `width` (string): Widget width dimension * `height` (string): Widget height dimension * `variables` (string\[]): Array of variable names to pass into the custom component iframe URL as query params * `iframe_url` (string): URL for the iframe source * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "data": [ { "created_at": "2025-10-02T21:45:27.633Z", "updated_at": "2025-10-02T21:45:27.633Z", "id": "70b56282-8db5-4e26-aad9-098c099fb1db", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "widget_id": "7d1a8c0d-5346-4f96-9f5c-d888e273eaf0", "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad", "pathway_node": "1", "width": "100%", "height": "300px", "variables": [ "firstName" ], "iframe_url": "https://widget-custom-components.vercel.app" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Widget Source: https://docs.bland.ai/api-v1/patch/widget-id PATCH https://api.bland.ai/v1/widget/{id} Updates an existing widget. All fields in the request body are optional. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* UUID of the widget to update. ### Body **pathway\_id** `string` New pathway UUID to associate with the widget. Must be defined if `agent_prompt` is null. **agent\_prompt** `string` New pathway UUID to associate with the widget. Must be defined if `pathway_id` is null. **allowed\_domains** `string[]` New array of allowed domains where the widget can be embedded. **messages\_per\_minute** `number` New rate limit for messages (minimum: 0). **config** `any` New widget configuration object (flexible JSON). Supports `timeoutSeconds` to configure conversation timeout (default: 86400 seconds / 24 hours). **agent\_id** `string` New agent UUID to associate with the widget. **webhook\_url** `string` New URL to receive post-conversation webhook payloads when conversations end. See [Post-Conversation Webhooks](/tutorials/chat-widget#post-conversation-webhooks) for payload details. ### Response **status** `number` HTTP status code (200 for success). **data** `object` The updated widget object containing: * `id` (string): Widget UUID * `pathway_id` (string): Associated pathway UUID * `agent_id` (string | null): Associated agent UUID or null * `allowed_domains` (string\[]): Array of allowed domains * `messages_per_minute` (number): Rate limit for messages * `config` (object): Widget configuration object * `webhook_url` (string | null): Post-conversation webhook URL or null * `created_at` (string): ISO timestamp * `updated_at` (string): Updated ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "status": 200, "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7", "agent_id": "46f37229-7d12-44be-b343-6e68274cfbea", "allowed_domains": ["newdomain.com", "anotherdomain.com"], "messages_per_minute": 15, "config": { "theme": "dark", "position": "bottom-left", "greeting": "Hi there! What can I do for you?", "timeoutSeconds": 7200 }, "webhook_url": "https://example.com/conversation-webhook", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T14:22:30Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Encrypted Key Source: https://docs.bland.ai/api-v1/post/accounts POST https://api.bland.ai/v1/accounts Integrate your own Twilio account with Bland. See [Custom Twilio Integration](/tutorials/custom-twilio) for more information. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **account\_sid** `string` *required* Your Twilio account SID. **auth\_token** `string` *required* Your Twilio auth token. ### Response Your `encrypted_key` to store and use in future requests. ```json theme={null} { "status": "success", "encrypted_key": "YOUR_ENCRYPTED_KEY" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Encrypted Key Source: https://docs.bland.ai/api-v1/post/accounts-delete POST https://api.bland.ai/v1/accounts/delete Disable an encrypted key for a Twilio account integration. See [Custom Twilio Integration](/tutorials/custom-twilio) for more information. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` *required* The `encrypted_key` to delete. Learn more about BYOT [here](/tutorials/custom-twilio). ### Response The status of the request. * `success` - The encrypted key was successfully deleted. * `error` - There was an error deleting the encrypted key. Special messages: * `Error deleting Twilio credentials` - The encrypted key could not be deleted or already has been deleted. * `Missing encrypted key` - The `encrypted_key` parameter is missing. * none - The encrypted key was successfully deleted. ```json theme={null} { "status": "success" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Approve Agent Onboarding Source: https://docs.bland.ai/api-v1/post/agent-onboarding-approve POST https://api.bland.ai/v1/agent/onboarding/approve Claim a device-authorization code after the owner signs up in the browser. Called by the Bland dashboard, not by the bot. ### Overview This endpoint is called from the browser by the dashboard during the [agent onboarding](/platform/connect-your-agent) flow, after the owner signs up (or logs in) and either starts the [Agent Phone Plan](/platform/agent-phone-plan) or chooses to connect the bot on the org's free credits. It isn't called directly by the bot, the bot only ever sees its effect through `/v1/agent/onboarding/poll`. > [!NOTE] > > Requires an authenticated dashboard session for an org (not a personal account, and not an API key). The response never includes the `api_key`, only the bot's later `poll` call receives it. ### Body Parameters **user\_code** `string` *required* The short code shown to the owner by `/v1/agent/onboarding/start`. **skip\_plan** `boolean` Pass `true` to connect the bot without an Agent Phone Plan, on the org's free credits. Strictly a boolean; `"true"` as a string is rejected. Without it, an org that has no active plan gets `402 PLAN_REQUIRED`. An org that already has an active plan ignores `skip_plan` entirely: the plan payload is returned as usual, including the `PLAN_NUMBER_PENDING` wait while its number is provisioned. ### Response **data** `object` Confirmation that the code was claimed for this org. **data.status** `string` `approved`. **data.org\_id** `string` The org the code was claimed for. **data.phone\_number** `string | null` The number provisioned for this org's Agent Phone Plan, or `null` when the code was approved with `skip_plan: true` and the org has no plan. **data.client\_name** `string` The `client_name` the bot passed to `/start`, if any. **data.key\_prefix** `string` The first 14 characters of the API key that will be issued to the bot, the same handle Settings > API Keys shows. Display only, never the key itself. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "status": "approved", "org_id": "...", "phone_number": "+15551234567", "client_name": "my-bot", "key_prefix": "org_3f9a1c7e2b" }, "errors": null } ``` ```json Response with skip_plan theme={null} { "data": { "status": "approved", "org_id": "...", "phone_number": null, "client_name": "my-bot", "key_prefix": "org_3f9a1c7e2b" }, "errors": null } ``` ```json Invalid code (400) theme={null} { "data": null, "errors": [ { "error": "INVALID_USER_CODE", "message": "Enter the code your agent gave you." } ] } ``` ```json Plan required (402) theme={null} { "data": null, "errors": [ { "error": "PLAN_REQUIRED", "message": "Start the Agent Phone Plan to connect your agent." } ] } ``` ```json Number pending (409) theme={null} { "data": null, "errors": [ { "error": "PLAN_NUMBER_PENDING", "message": "Your number is still being set up. Try again in a moment." } ] } ``` ```json Code not found (404) theme={null} { "data": null, "errors": [ { "error": "CODE_NOT_FOUND", "message": "That code is not valid. Ask your agent for a new one." } ] } ``` ```json Code already used (409) theme={null} { "data": null, "errors": [ { "error": "CODE_ALREADY_USED", "message": "That code has already been used. Ask your agent for a new one." } ] } ``` ```json Org context required (403) theme={null} { "data": null, "errors": [ { "error": "ORG_CONTEXT_REQUIRED", "message": "Switch to an organization to connect an agent." } ] } ``` ```json Invalid origin (403) theme={null} { "data": null, "errors": [ { "error": "INVALID_ORIGIN", "message": "Approve this code from the Bland dashboard. This request did not come from it." } ] } ``` ```json Too many requests (429) theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many attempts. Wait a few minutes and try again." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Poll Agent Onboarding Source: https://docs.bland.ai/api-v1/post/agent-onboarding-poll POST https://api.bland.ai/v1/agent/onboarding/poll Poll for the result of a device-authorization flow started with /v1/agent/onboarding/start. No API key required. ### Overview No authentication is required for this endpoint. Call it with the `device_code` from `/v1/agent/onboarding/start`, waiting at least the returned `interval` seconds between calls. See the [Agent onboarding API](/platform/connect-your-agent) for the full flow. > [!NOTE] > > This endpoint has two independent `429` responses: `SLOW_DOWN` when you poll faster than the per-device `interval`, and `TOO_MANY_REQUESTS` from the per-IP rate limit (600 requests per minute per IP, since a hosting platform's shared egress address can carry many bots), which carries a `Retry-After` header instead of `interval`. ### Body Parameters **device\_code** `string` *required* The `device_code` returned by `/v1/agent/onboarding/start`. ### Response **data** `object` Current state of the flow. **data.status** `string` One of `pending`, `approved`, `expired`. **data.interval** `number` Present when `status` is `pending`. Minimum seconds to wait before polling again. **data.expires\_in** `number` Present when `status` is `pending`. Seconds remaining before the codes expire. **data.api\_key** `string` Present only when `status` is `approved`. A dedicated API key for the org, returned exactly once. **data.org\_id** `string` Present when `status` is `approved`. The org the key belongs to. **data.phone\_number** `string | null` Present when `status` is `approved`. The number provisioned for this org, or `null` when the owner connected the bot without the Agent Phone Plan. Without the plan, calls go out from Bland's shared pool of numbers and texting is not included. **data.plan** `object` Present when `status` is `approved`. The org's Agent Phone Plan subscription. When the owner connected the bot on free credits instead, `plan.status` is `none` and every other `plan` field is `null`. The same object is returned by `GET /billing/agent_phone` (as `data`) and by `GET /v1/me` (as `plan`). **data.plan.name** `string | null` Internal plan identifier, `agent_phone_basic`. `null` when there is no plan. **data.plan.display\_name** `string | null` Human-readable plan name, `Agent Phone Plan`. `null` when there is no plan. **data.plan.status** `string` Subscription status: `active`, or `none` when the org has no Agent Phone Plan. **data.plan.phone\_number** `string | null` The number provisioned for this org's Agent Phone Plan. `null` when there is no plan. **data.plan.concurrency** `number | null` Maximum concurrent calls, `1`. `null` when there is no plan. **data.plan.max\_call\_duration\_minutes** `number | null` Maximum call length in minutes, `60`. `null` when there is no plan. **data.plan.allowed\_countries** `array | null` Country codes calls, transfers, and SMS are allowed to, `["US", "CA"]`. `null` when there is no plan. **data.plan.current\_period\_end** `string | null` ISO 8601 timestamp for the end of the current billing period. `null` when there is no plan. **data.client\_name** `string` Present when `status` is `approved`, if a `client_name` was given to `/start`. **errors** `null | array` `null` unless polling too fast. ```json Pending theme={null} { "data": { "status": "pending", "interval": 5, "expires_in": 823 }, "errors": null } ``` ```json Approved with the plan theme={null} { "data": { "status": "approved", "api_key": "org_...", "org_id": "...", "phone_number": "+14155550123", "plan": { "name": "agent_phone_basic", "display_name": "Agent Phone Plan", "status": "active", "phone_number": "+14155550123", "concurrency": 1, "max_call_duration_minutes": 60, "allowed_countries": ["US", "CA"], "current_period_end": "2026-10-07T00:00:00.000Z" }, "client_name": "my-bot" }, "errors": null } ``` ```json Approved with free credits theme={null} { "data": { "status": "approved", "api_key": "org_...", "org_id": "...", "phone_number": null, "plan": { "name": null, "display_name": null, "status": "none", "phone_number": null, "concurrency": null, "max_call_duration_minutes": null, "allowed_countries": null, "current_period_end": null }, "client_name": "my-bot" }, "errors": null } ``` ```json Expired theme={null} { "data": { "status": "expired" }, "errors": null } ``` ```json Too fast (429) theme={null} { "data": null, "errors": [ { "error": "SLOW_DOWN", "message": "Poll more slowly.", "interval": 10 } ] } ``` ```json Too many requests (429) theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many requests. Try again later." } ] } ``` > [!NOTE] > > An `expired` status covers both an expired code and a `device_code` that was never valid. The two aren't distinguished, so don't rely on this response to debug a mistyped code, start over with a new `/start` call instead. *** Docs for agents: [llms.txt](/llms.txt) # Start Agent Onboarding Source: https://docs.bland.ai/api-v1/post/agent-onboarding-start POST https://api.bland.ai/v1/agent/onboarding/start Start the device-authorization flow a bot uses to get its own Bland API key, plus a phone number if its owner starts the Agent Phone Plan. No API key required. ### Overview No authentication is required for this endpoint, it's how a bot gets an API key in the first place. See the [Agent onboarding API](/platform/connect-your-agent) for the full flow. > [!NOTE] > > Requests are rate-limited globally and per IP. A `429` includes a `Retry-After` header in seconds. ### Body Parameters **client\_name** `string` A name for the bot starting the flow, shown to the owner during signup so they know what's asking. Max length `64`. Allowed characters: letters, numbers, spaces, and `._/-`. **prefill** `object` Values to pre-fill the owner's sign-up form. Pass what the bot already knows. Invalid values are dropped silently, never a `400`. Values that survive validation are appended to `verification_url_complete` as a URL fragment, form-encoded the way `URLSearchParams` does it (`@` becomes `%40`, `+` becomes `%2B`, a space becomes `+`). The fragment stays in the owner's browser; Bland never stores or logs pre-fill values. **prefill.name** `string` Full name, up to 128 characters. Split on its first space into first and last name when `first_name` and `last_name` are absent. **prefill.first\_name** `string` First name, up to 128 characters. **prefill.last\_name** `string` Last name, up to 128 characters. **prefill.email** `string` Email address, up to 128 characters. Dropped unless it has the shape `x@y.z`. **prefill.phone** `string` Phone number, up to 128 characters, normalized to E.164 with US as the default region. Dropped when it can't be normalized. ### Response **data** `object` Device and user codes for the flow. **data.device\_code** `string` Opaque code your bot polls with at `/v1/agent/onboarding/poll`. Keep this private. **data.user\_code** `string` Short code to show the owner. They enter this at `verification_url` if it isn't already pre-filled. **data.verification\_url** `string` The page where the owner completes signup, without the code embedded. **data.verification\_url\_complete** `string` The same page with `user_code` pre-filled. When `prefill` values survive validation, they are appended as a URL fragment, for example `...?code=BQPL-7VXR#first_name=Sam&last_name=Lee&email=sam%40example.com&phone=%2B14155550123`. Prefer this when you can show a clickable link. **data.expires\_in** `number` Seconds until the codes expire (`900`, 15 minutes). **data.interval** `number` Minimum seconds to wait between calls to `/poll`. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "device_code": "Xk9pQ2mZ...", "user_code": "BQPL-7VXR", "verification_url": "https://app.bland.ai/agent-setup", "verification_url_complete": "https://app.bland.ai/agent-setup?code=BQPL-7VXR", "expires_in": 900, "interval": 5 }, "errors": null } ``` ```json Response with prefill theme={null} { "data": { "device_code": "Xk9pQ2mZ...", "user_code": "BQPL-7VXR", "verification_url": "https://app.bland.ai/agent-setup", "verification_url_complete": "https://app.bland.ai/agent-setup?code=BQPL-7VXR#first_name=Sam&last_name=Lee&email=sam%40example.com&phone=%2B14155550123", "expires_in": 900, "interval": 5 }, "errors": null } ``` ```json Feature disabled (503) theme={null} { "data": null, "errors": [ { "error": "FEATURE_DISABLED", "message": "Agent onboarding is temporarily unavailable." } ] } ``` ```json Too many requests (429) theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many requests. Try again later." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Cancel Agent Phone Plan Source: https://docs.bland.ai/api-v1/post/agent-phone-plan-cancel POST https://api.bland.ai/billing/cancel_agent_phone Cancel your organization's Agent Phone Plan at the end of its billing period, with an optional offboarding survey. ### Overview Cancels your organization's [Agent Phone Plan](/platform/agent-phone-plan) at the end of the current billing period. The plan doesn't renew, it stays active until the month or year you've paid for ends, and there's no refund for the rest of that period. Your included phone number stays on your account. You can answer a short, optional offboarding survey in the same request with `feedback`. If you leave it out, the response includes `cancellation_survey`, which lists the questions and their allowed answers. You can send your answers afterwards with [Submit Cancellation Feedback](/api-v1/post/agent-phone-plan-cancel-feedback). The survey never affects the cancel. > [!NOTE] > > Requires an organization API key that belongs to an admin or owner of the organization. A personal account key gets `403 FORBIDDEN`. > [!TIP] > > If you're an agent canceling for a person, ask them the survey questions and pass their answers through. Don't answer on their behalf. ### Headers **authorization** `string` *required* Your organization API key. ### Body Parameters **feedback** `object` Optional answers to the offboarding survey. Every field is optional, and blank answers count as no answer. An invalid survey gets `400 BAD_REQUEST` and nothing is canceled. **properties** **use\_cases** `string[]` What the plan was mainly used for. Any of `answering_calls`, `booking_appointments`, `outbound_calls`, `texting`, `testing`, `other`. **use\_case\_other** `string` What else it was used for, when `use_cases` includes `other`. Up to 500 characters. **reason** `string` The main reason for canceling. One of `too_expensive`, `not_used_enough`, `did_not_work`, `switching_service`, `short_term`, `other`. **reason\_detail** `string` The service you're switching to (with `switching_service`), or the reason (with `other`). Up to 500 characters. **stay\_suggestion** `string` What would have made you stay. Up to 500 characters. ### Response **data** `object` Your plan after the cancel. `status` stays `active` until the period ends, at `current_period_end`, and then becomes `canceled`. `phone_number` is the number you keep. **data.cancellation\_survey** `object` Present only when you canceled without `feedback`. It lists the survey questions (`questions[]`, each with a `field`, `type`, `question`, and `options` for the select questions) and where to send the answers (`submit`). Text answers can be up to 500 characters. **errors** `null | array` `null` on success. ```bash With feedback theme={null} curl -X POST https://api.bland.ai/billing/cancel_agent_phone \ -H "authorization: " \ -H "Content-Type: application/json" \ -d '{ "feedback": { "use_cases": ["answering_calls"], "reason": "switching_service", "reason_detail": "Another voice provider", "stay_suggestion": "A cheaper tier" } }' ``` ```bash Without feedback theme={null} curl -X POST https://api.bland.ai/billing/cancel_agent_phone \ -H "authorization: " ``` ```json Response without feedback theme={null} { "data": { "name": "agent_phone_basic", "display_name": "Agent Phone Plan", "status": "active", "phone_number": "+15551234567", "current_period_end": "2026-12-01T00:00:00.000Z", "cancellation_survey": { "submit": { "method": "POST", "path": "/billing/cancel_agent_phone/feedback" }, "questions": [ { "field": "use_cases", "type": "multi_select", "question": "What did you mainly use your Agent Phone plan for?", "options": [ { "value": "answering_calls", "label": "Answering my business calls" }, { "value": "booking_appointments", "label": "Booking appointments or reservations" }, { "value": "outbound_calls", "label": "Making errand or outbound calls for me" }, { "value": "texting", "label": "Texting" }, { "value": "testing", "label": "Just testing it out" }, { "value": "other", "label": "Other" } ] }, { "field": "use_case_other", "type": "text", "question": "If other, what else did you use it for?" }, { "field": "reason", "type": "single_select", "question": "What's the main reason you're canceling?", "options": [ { "value": "too_expensive", "label": "Too expensive for what I got" }, { "value": "not_used_enough", "label": "I didn't use it enough" }, { "value": "did_not_work", "label": "It didn't work the way I expected" }, { "value": "switching_service", "label": "Switching to a different service" }, { "value": "short_term", "label": "I only needed it for a short-term project" }, { "value": "other", "label": "Other" } ] }, { "field": "reason_detail", "type": "text", "question": "Which service are you switching to, or what's the reason?" }, { "field": "stay_suggestion", "type": "text", "question": "What would have made you stay?" } ] } }, "errors": null } ``` ```json No plan to cancel (409) theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "This organization does not have an Agent Phone Plan to cancel." } ] } ``` # Submit Cancellation Feedback Source: https://docs.bland.ai/api-v1/post/agent-phone-plan-cancel-feedback POST https://api.bland.ai/billing/cancel_agent_phone/feedback Answer the optional Agent Phone Plan offboarding survey after you've canceled. ### Overview Sends answers to the offboarding survey after you've [canceled the Agent Phone Plan](/api-v1/post/agent-phone-plan-cancel) without them. The questions and allowed answers are the same ones the cancel returns as `cancellation_survey`. Sending answers again replaces your earlier ones. This works only after a cancel. An organization whose plan is still active, or that never had one, gets `409 CONFLICT`. > [!NOTE] > > Requires an organization API key that belongs to an admin or owner of the organization. ### Headers **authorization** `string` *required* Your organization API key. ### Body Parameters **feedback** `object` *required* Your answers. Every field is optional, but at least one must have an answer. **properties** **use\_cases** `string[]` What the plan was mainly used for. Any of `answering_calls`, `booking_appointments`, `outbound_calls`, `texting`, `testing`, `other`. **use\_case\_other** `string` What else it was used for, when `use_cases` includes `other`. Up to 500 characters. **reason** `string` The main reason for canceling. One of `too_expensive`, `not_used_enough`, `did_not_work`, `switching_service`, `short_term`, `other`. **reason\_detail** `string` The service you're switching to (with `switching_service`), or the reason (with `other`). Up to 500 characters. **stay\_suggestion** `string` What would have made you stay. Up to 500 characters. ### Response **data.submitted** `boolean` `true` once your answers are saved. **errors** `null | array` `null` on success. ```bash cURL theme={null} curl -X POST https://api.bland.ai/billing/cancel_agent_phone/feedback \ -H "authorization: " \ -H "Content-Type: application/json" \ -d '{ "feedback": { "use_cases": ["texting", "other"], "use_case_other": "Screening spam calls", "reason": "short_term", "stay_suggestion": "A way to pause the plan" } }' ``` ```json Response theme={null} { "data": { "submitted": true }, "errors": null } ``` ```json No answers (400) theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "feedback must answer at least one question." } ] } ``` ```json Plan not canceled (409) theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "This organization has no canceled Agent Phone Plan to leave feedback on." } ] } ``` # Batch Run Scenarios Source: https://docs.bland.ai/api-v1/post/agent-testing-batch-run POST https://api.bland.ai/v1/agent-testing/batch-run Execute multiple test scenarios as a batch. Returns immediately with a batch ID while tests execute asynchronously. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **scenario\_ids** `array of strings` *required* Array of scenario IDs to run. All scenario IDs must belong to your organization. **version\_number** `integer` Pathway version to test. Defaults to the current production version. **webhook\_url** `string` URL to receive a webhook when the entire batch completes. The webhook payload will include the batch result summary. ### Response **batch\_id** `string` The unique identifier for the test batch. **runs** `array of objects` An array of run entries, one per scenario. Each entry contains: * `run_id` - The unique identifier for the individual test run. * `scenario_id` - The scenario ID associated with this run. ```json Response theme={null} { "batch_id": "e7a2c3d4-8f9b-4a1e-b5c6-d7e8f9a0b1c2", "runs": [ { "run_id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c", "scenario_id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d" }, { "run_id": "b4c2d3e5-6f7a-8b9c-0d1e-2f3a4b5c6d7e", "scenario_id": "2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e" } ] } ``` > [!NOTE] > > This endpoint is rate limited per organization. All `scenario_ids` must belong to your organization or the request will be rejected. *** Docs for agents: [llms.txt](/llms.txt) # Analyze Failed Run Source: https://docs.bland.ai/api-v1/post/agent-testing-runs-analyze POST https://api.bland.ai/v1/agent-testing/runs/{id}/analyze Run AI-powered analysis on a failed test run to get root cause and fix suggestions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The run ID to analyze. ### Response **analysis** `object` The AI-generated analysis of the failed test run. **analysis object** **root\_cause** `string` Description of why the test failed. **suggestions** `array` An array of suggested fixes for the failure. **suggestion object** **type** `string` The type of suggested change. One of: `prompt_change`, `node_config`, `flow_change`, `tone_improvement`. **target\_node\_id** `string` The ID of the node the suggestion applies to. **target\_node\_name** `string` The display name of the node the suggestion applies to. **description** `string` A human-readable description of the issue and what should change. **suggested\_change** `string` The specific change to make (e.g., updated prompt text or configuration value). **confidence** `number` Confidence score for this suggestion, from 0 to 1. **node\_id\_to\_name** `object` A map of node IDs to their display names, covering all nodes referenced in the analysis. ```json Response theme={null} { "analysis": { "root_cause": "The agent failed to transfer the caller to a live representative when the caller explicitly requested to speak with a manager. The 'Escalation Handler' node's prompt does not include instructions for handling direct manager requests, causing the agent to loop back to the main menu instead.", "suggestions": [ { "type": "prompt_change", "target_node_id": "node_8f3a2b1c", "target_node_name": "Escalation Handler", "description": "The escalation node's prompt does not account for explicit manager requests. Adding a condition to detect phrases like 'speak to a manager' or 'talk to someone' would allow the agent to route correctly.", "suggested_change": "Add the following to the node prompt: 'If the caller asks to speak with a manager, supervisor, or live person, immediately transfer them to the manager queue without further qualification.'", "confidence": 0.92 }, { "type": "flow_change", "target_node_id": "node_4d7e9f0a", "target_node_name": "Main Menu", "description": "The Main Menu node has a fallback edge that loops back to itself when no intent is matched. This creates an infinite loop when the escalation path fails to trigger.", "suggested_change": "Add a new edge from 'Main Menu' to 'Escalation Handler' that triggers when the caller's intent is classified as 'escalation' or 'transfer_request'.", "confidence": 0.78 } ], "node_id_to_name": { "node_8f3a2b1c": "Escalation Handler", "node_4d7e9f0a": "Main Menu", "node_1a2b3c4d": "Greeting", "node_5e6f7a8b": "Transfer to Manager" } } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Test Scenario Source: https://docs.bland.ai/api-v1/post/agent-testing-scenarios POST https://api.bland.ai/v1/agent-testing/scenarios Create a new test scenario with assertions for a pathway or persona. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **pathway\_id** `string` The pathway to test. Either `pathway_id` or `persona_id` is required. **persona\_id** `string` The persona to test. Either `pathway_id` or `persona_id` is required. **name** `string` *required* Name of the scenario. Must be unique within the pathway/persona. **description** `string` Description of what the scenario tests. **category** `string` (default: CUSTOM) One of: `CUSTOM`, `VOICEMAIL`, `VOICEMAIL_SCREENER`, `ANGRY_CALLER`, `BELLIGERENT_CALLER`, `CONFUSED_CALLER`, `CALL_SCREENER`, `HAPPY_PATH`, `EDGE_CASE`. **scenario\_type** `string` (default: AGENT) One of: `AGENT`, `REPLAY`, `HISTORICAL`. **tester\_persona\_prompt** `string` Prompt instructing the simulated caller how to behave. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` (default: 20) Max conversation turns before the test ends. Maximum value is 50. **request\_data** `object` Custom request data to pass to the pathway (e.g., variables). **start\_node\_id** `string` ID of the pathway node where the simulated conversation should begin. Use this to test a specific branch of a pathway without rewiring the flow. When omitted (or `null`), the test runs from the pathway's default start node. If the ID does not match a node in the current pathway version, the run fails with an `Invalid start_node_id` error. **bland\_tone\_enabled** `boolean` (default: false) Enable Bland Tone naturalness scoring. **is\_required\_for\_promotion** `boolean` (default: false) If true, this scenario must pass before the pathway can be promoted to production. **input\_messages** `array` Pre-seeded messages for `REPLAY` scenarios. **advanced\_instructions** `string` Additional instructions for test execution. **metadata** `object` Arbitrary metadata to attach to the scenario. **assertions** `array` Array of assertion definitions. **assertion object** **type** `string` *required* The assertion type. One of: `LLM_JUDGE`, `BLAND_TONE`, `VARIABLE_EXTRACTED`, `NODE_REACHED`, `NODES_VISITED`, `WEBHOOK_TRIGGERED`, `REGEX_MATCH`, `STRING_CHECK`, `CUSTOM_LLM`, `TRAVERSAL_MATCH`. **config** `object` *required* Type-specific configuration for the assertion. **name** `string` Display name for the assertion. **is\_required** `boolean` (default: true) Whether this assertion must pass for the scenario to pass. **weight** `number` (default: 1.0) Weight of this assertion in the overall score. **order** `integer` Order in which the assertion is evaluated. ### Response **id** `string` Unique identifier for the created scenario. **org\_id** `string` Organization ID that owns this scenario. **pathway\_id** `string` The pathway ID being tested (null if testing a persona). **persona\_id** `string` The persona ID being tested (null if testing a pathway). **name** `string` Name of the scenario. **description** `string` Description of the scenario. **category** `string` Scenario category. **scenario\_type** `string` Type of scenario. **tester\_persona\_prompt** `string` Prompt for the simulated caller. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` Maximum conversation turns. **request\_data** `object` Custom request data. **start\_node\_id** `string` Starting node ID. **bland\_tone\_enabled** `boolean` Whether Bland Tone scoring is enabled. **is\_required\_for\_promotion** `boolean` Whether this scenario is required for promotion. **enabled** `boolean` Whether the scenario is enabled. **input\_messages** `array` Pre-seeded messages for replay scenarios. **advanced\_instructions** `string` Additional instructions for test execution. **metadata** `object` Arbitrary metadata. **assertions** `array` Array of assertion objects. **assertion object** **id** `string` Unique identifier for the assertion. **type** `string` The assertion type. **name** `string` Display name for the assertion. **config** `object` Type-specific configuration. **is\_required** `boolean` Whether this assertion must pass. **weight** `number` Weight of this assertion in the overall score. **order** `integer` Evaluation order. **created\_at** `string` ISO 8601 timestamp of when the scenario was created. ```json Response theme={null} { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "name": "Angry Caller Test", "description": "Tests the agent's ability to de-escalate an angry caller", "category": "ANGRY_CALLER", "scenario_type": "AGENT", "tester_persona_prompt": "You are a frustrated customer who has been waiting on hold for 30 minutes. You are upset about a billing error on your account.", "tester_persona_name": "Frustrated Customer", "max_turns": 15, "request_data": null, "start_node_id": null, "bland_tone_enabled": true, "is_required_for_promotion": false, "enabled": true, "input_messages": null, "advanced_instructions": null, "metadata": null, "assertions": [ { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "type": "LLM_JUDGE", "name": "De-escalation", "config": { "prompt": "Did the agent successfully de-escalate the situation and address the customer's concerns?", "output_type": "score", "threshold": 0.7 }, "is_required": true, "weight": 1.5, "order": 0 } ], "created_at": "2026-04-14T00:00:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Generate Scenario from Call Source: https://docs.bland.ai/api-v1/post/agent-testing-scenarios-generate POST https://api.bland.ai/v1/agent-testing/scenarios/generate-from-call Generate a test scenario from a historical call transcript using AI analysis. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **call\_id** `string` *required* The ID of the historical call to generate a scenario from. The call transcript will be analyzed by AI to extract a realistic test scenario. **pathway\_id** `string` The pathway to bind the generated scenario to. Either `pathway_id` or `persona_id` is required. **persona\_id** `string` The persona to bind the generated scenario to. Either `pathway_id` or `persona_id` is required. ### Response The response contains the generated scenario data. This data is **not yet saved** -- it is returned so you can review and use it to create a scenario. > [!NOTE] > > Sensitive data such as phone numbers, webhook URLs, and API keys is automatically stripped from the generated `request_data`. **name** `string` An AI-generated name summarizing the scenario. **description** `string` An AI-generated description of what the scenario tests based on the call transcript. **category** `string` The inferred category for the scenario (e.g., `HAPPY_PATH`, `EDGE_CASE`, `ANGRY_CALLER`). **tester\_persona\_prompt** `string` An AI-generated prompt that instructs the simulated caller to replicate the behavior observed in the original call. **tester\_persona\_name** `string` A name for the simulated caller persona derived from the call. **pathway\_id** `string` The pathway the scenario is bound to (if provided). **persona\_id** `string` The persona the scenario is bound to (if provided). **request\_data** `object` Request data extracted from the call with sensitive fields automatically removed. ```json Response theme={null} { "name": "Inbound Appointment Booking - Returning Customer", "description": "Simulates a returning customer calling to book a follow-up appointment. The caller provides their name and preferred time slot, and expects confirmation.", "category": "HAPPY_PATH", "tester_persona_prompt": "You are Sarah Chen, a returning customer. You previously visited for a consultation and want to book a follow-up appointment. You prefer afternoons, ideally next Thursday at 2 PM. Be polite but firm about your preferred time. If that slot is unavailable, accept an alternative within the same week.", "tester_persona_name": "Sarah Chen", "pathway_id": "pw_abc123", "persona_id": null, "request_data": { "customer_name": "Sarah Chen", "account_id": "cust_92841", "appointment_type": "follow_up" } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Run Test Scenario Source: https://docs.bland.ai/api-v1/post/agent-testing-scenarios-run POST https://api.bland.ai/v1/agent-testing/scenarios/{id}/run Execute a single test scenario. Returns immediately with a run ID while the test executes asynchronously. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The scenario ID to run. ### Body **version\_number** `integer` Pathway version to test. Defaults to the current production version. **request\_data\_override** `object` Override the scenario's `request_data` for this run. Any keys provided here will replace the corresponding keys in the scenario's default request data. **webhook\_url** `string` URL to receive a webhook when the run completes. The webhook payload will include the full run result. ### Response **run\_id** `string` The unique identifier for the test run. **status** `string` The current status of the run. Will be `RUNNING` immediately after creation. ```json Response theme={null} { "run_id": "a3f1b2c4-5d6e-7f8a-9b0c-1d2e3f4a5b6c", "status": "RUNNING" } ``` > [!NOTE] > > This endpoint is rate limited per organization. If you need to run multiple scenarios at once, consider using the [Batch Run](/api-v1/post/agent-testing-batch-run) endpoint instead. *** Docs for agents: [llms.txt](/llms.txt) # Create Simulation Set Source: https://docs.bland.ai/api-v1/post/agent-testing-simulation-sets POST https://api.bland.ai/v1/agent-testing/simulation-sets Create a simulation set that runs each scenario multiple times to detect flaky behavior. Returns immediately while simulations execute asynchronously. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **scenario\_ids** `array of strings` *required* Scenario IDs to include. All scenario IDs must belong to your organization. **simulations\_per\_scenario** `integer` *required* Number of times to run each scenario. Must be >= 1. **pathway\_id** `string` The pathway ID. **persona\_id** `string` The persona ID. **version\_number** `integer` Pathway version to test. > [!NOTE] > > This endpoint is rate limited. All `scenario_ids` must belong to your organization. ### Response **simulation\_set\_id** `string` The unique identifier for the newly created simulation set. **status** `string` The initial status of the simulation set. Will be `PENDING` upon creation. **simulations\_per\_scenario** `integer` The number of simulations that will be run per scenario. **total\_scenarios** `integer` The total number of scenarios included in this set. **created\_at** `string` ISO 8601 timestamp of when the simulation set was created. ```json Response theme={null} { "simulation_set_id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "status": "PENDING", "simulations_per_scenario": 5, "total_scenarios": 3, "created_at": "2026-04-14T10:00:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Clone Test Template Source: https://docs.bland.ai/api-v1/post/agent-testing-templates-clone POST https://api.bland.ai/v1/agent-testing/templates/{id}/clone Clone a template to create a new scenario bound to your pathway or persona. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The template ID to clone. ### Body **pathway\_id** `string` The pathway to bind the cloned scenario to. Either `pathway_id` or `persona_id` is required. **persona\_id** `string` The persona to bind the cloned scenario to. Either `pathway_id` or `persona_id` is required. **name** `string` Override the template name. Defaults to the template's original name. **description** `string` Override the template description. **tester\_persona\_prompt** `string` Override the tester persona prompt that drives the simulated caller's behavior. **max\_turns** `integer` Override the maximum number of conversational turns before the test ends. **request\_data** `object` Override the request data passed to the agent during the test call. **start\_node\_id** `string` Override the starting node for pathway-based scenarios. **bland\_tone\_enabled** `boolean` Override the Bland Tone setting for the test call. **is\_required\_for\_promotion** `boolean` (default: false) Whether to require this scenario to pass before a pathway can be promoted. Default `false`. ### Response **scenario** `object` The newly created scenario object cloned from the template. * `id` (string): The unique identifier for the new scenario. * `name` (string): The scenario name. * `description` (string): The scenario description. * `category` (string): The category inherited from the template. * `tester_persona_prompt` (string): The prompt driving the simulated caller. * `tester_persona_name` (string): The name of the simulated caller persona. * `pathway_id` (string): The pathway this scenario is bound to (if applicable). * `persona_id` (string): The persona this scenario is bound to (if applicable). * `max_turns` (integer): The maximum number of conversational turns. * `request_data` (object): The request data for the test call. * `start_node_id` (string): The starting node ID (if set). * `bland_tone_enabled` (boolean): Whether Bland Tone is enabled. * `is_required_for_promotion` (boolean): Whether this scenario is required for pathway promotion. * `assertions` (array): The assertion objects inherited from the template. * `type` (string): The assertion type. * `config` (object): Configuration specific to the assertion type. * `description` (string): A human-readable description of the assertion. * `created_at` (string): ISO 8601 timestamp of when the scenario was created. ```json Response theme={null} { "scenario": { "id": "scn_8f2a1b3c-4d5e-6f7a-8b9c-0d1e2f3a4b5c", "name": "Voicemail Detection", "description": "Simulates a voicemail greeting to verify the agent correctly detects and handles voicemail.", "category": "VOICEMAIL", "tester_persona_prompt": "You are a voicemail system. Greet the caller with a standard voicemail message: 'Hi, you've reached John. I'm not available right now. Please leave a message after the beep.' Then remain silent.", "tester_persona_name": "Voicemail System", "pathway_id": "pw_abc123", "persona_id": null, "max_turns": 4, "request_data": {}, "start_node_id": null, "bland_tone_enabled": true, "is_required_for_promotion": false, "assertions": [ { "type": "call_ended_by_agent", "config": {}, "description": "Agent should hang up after detecting voicemail" }, { "type": "latency_below", "config": { "max_ms": 3000 }, "description": "Agent response latency stays below 3 seconds" } ], "created_at": "2026-04-14T18:30:00.000Z" } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Cancel Tornado Session Source: https://docs.bland.ai/api-v1/post/agent-testing-tornado-cancel POST https://api.bland.ai/v1/agent-testing/tornado/{id}/cancel Cancel a running tornado session. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The tornado session ID. ### Response **cancelled** `boolean` Whether the session was successfully cancelled. ```json Response theme={null} { "cancelled": true } ``` *** Docs for agents: [llms.txt](/llms.txt) # Start Tornado Session Source: https://docs.bland.ai/api-v1/post/agent-testing-tornado-start POST https://api.bland.ai/v1/agent-testing/tornado/start Start an iterative fix loop that runs tests, analyzes failures, applies fixes, and retests until all scenarios pass. Returns immediately while the loop executes asynchronously. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **pathway\_id** `string` *required* The pathway to fix. **persona\_id** `string` The persona ID. **scenario\_ids** `array of strings` Specific scenarios to test. If omitted, runs all enabled scenarios for the pathway. Maximum 50 scenarios. **version\_number** `integer` Pathway version to start from. **max\_iterations** `integer` Maximum fix iterations. Default `5`. **timeout\_ms** `integer` Timeout in milliseconds. Default `900000` (15 minutes). > [!NOTE] > > Only one tornado session can be active per pathway. Returns `409 Conflict` if a session is already running. ### Response **session\_id** `string` The unique identifier for the tornado session. **status** `string` The initial status of the session. Will be `RUNNING` upon creation. **pathway\_id** `string` The pathway being tested and fixed. **max\_iterations** `integer` The maximum number of fix iterations configured. **timeout\_ms** `integer` The timeout configured for this session in milliseconds. **created\_at** `string` ISO 8601 timestamp of when the session was created. ```json Response theme={null} { "session_id": "e1f2a3b4-5678-9cde-f012-3456789abcde", "status": "RUNNING", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "max_iterations": 5, "timeout_ms": 900000, "created_at": "2026-04-14T10:15:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create a Web Agent Source: https://docs.bland.ai/api-v1/post/agents POST https://api.bland.ai/v1/agents Configure all of the settings for a new web agent. ### Headers **authorization** `string` *required* Your API key for authentication. Example web call usage (client side): ```javascript theme={null} import { BlandWebClient } from 'bland-client-js-sdk'; const agentId = 'YOUR-AGENT-ID'; const sessionToken = 'YOUR-SESSION-TOKEN'; document.addEventListener('DOMContentLoaded', async () => { document.getElementById('btn').addEventListener('click', async () => { const blandClient = new BlandWebClient( agentId, sessionToken ); await blandClient.initConversation({ sampleRate: 44100, }); }); }); ``` ### Body **prompt** `string` *required* Provide instructions, relevant information, and examples of the ideal conversation flow. > [accordion] Best Practices > > #### Out-of-the-Box Behaviors (Summarized): > > * Speech pattern: Direct, concise, casual > * Spells out symbols, acronyms, abbreviations, percentages, etc. (\$4,000,000 -> "four million dollars") > * Asks clarifying questions > * Ends call when objective is complete or voicemail is detected > > #### Prompting Tips: > > * Want to easily test out exactly how your agent will behave? > * [Try out Agent Testing!](https://app.bland.ai/home?page=testing) > * Aim for less than >2,000 characters where possible. > * Simple, direct prompts are the most predictable and reliable. > * Frame instructions positively: > * `"Do this"` rather than `"Don't do this"`. > * Ex. "Keep the conversation casual" rather than "Don't be too formal". > * This gives concrete examples of what to do, instead of leaving expected behavior open to interpretation. **voice** `string` Set your agent's voice - all available voices can be found with the [List Voices](/api-v1/get/voices) endpoint. **webhook** `string` Set a webhook URL to receive call data after the web call completes. **metadata** `object` Add any additional information you want to associate with the call. This can be useful for tracking or categorizing calls. **pathway\_id** `string` Set the pathway that your agent will follow. This will override the `prompt` field, so there is no need to pass the 'prompt' field if you are setting a pathway. Warning: Setting a pathway will set the following fields to `null` / their default value - `prompt`, `first_sentence`, `dynamic_data`, `tools`, `transfer_list` Set to `null` or an empty string to clear the pathway. **language** `string` (default: ENG) Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings. Supported Languages and their codes can be found [here](/api-v1/post/calls#param-language). **first\_sentence** `string` A phrase that your call will start with instead of a generating one on the fly. This works both with and without `wait_for_greeting`. Can be more than one sentence, but must be less than 200 characters. To remove, set to `null` or an empty string. **tools** `array` Interact with the real world through API calls. Detailed tutorial here: [Custom Tools](/tutorials/custom-tools) **dynamic\_data** `object` Integrate data from external APIs into your agent's knowledge. Set to `null` or an empty string to clear dynamic data settings. Detailed usage in the [Send Call](/api-v1/post/calls) endpoint. **interruption\_threshold** `number` (default: 500) Legacy. Sets a fixed wait, in milliseconds, after the caller stops speaking before the AI responds. We recommend leaving this unset: response timing adapts to each caller automatically (see [Agent Speech](/tutorials/agent-speech)). To control how readily the AI stops when the caller talks over it, use `interruptibility`. **interruptibility** `integer` (default: 2) Controls how readily the AI stops speaking when the caller talks over it. A higher value yields more easily; a lower value holds the turn through more of the caller's speech. * `0`: Block. The AI ignores interruptions and finishes speaking (same as `block_interruptions: true`). * `1`: Difficult. Harder to interrupt. * `2`: Balanced (default). * `3`: Easy. The AI stops quickly when the caller begins speaking. * `4`: Always interrupt. Any caller speech stops the AI, including brief acknowledgments like "uh-huh". See [Agent Speech](/tutorials/agent-speech) for how each level behaves. **keywords** `string[]` (default: \[]) These words will be boosted in the transcription engine - recommended for proper nouns or words that are frequently mis-transcribed. For example, if the word "Reece" is frequently transcribed as a homonym like "Reese" you could do this: ```json theme={null} { "keywords": ["Reece"] } ``` For stronger keyword boosts, you can place a colon then a boost factor after the word. The default boost factor is 2. ```json theme={null} { "keywords": ["Reece:3"] } ``` **max\_duration** `number` (default: 30) The maximum duration that calls to your agent can last before being automatically terminated. Set to `null` to reset to default. ### Response **status** `string` Can be `success` or `error`. **call\_id** `string` A unique identifier for the call (present only if status is `success`). ```json Response theme={null} { "agent": { "agent_id": "2c565dc7-f41f-43db-a99f-e4c8ba9d7d18", "dynamic_data": null, "interruption_threshold": null, "first_sentence": null, "voice_settings": null, "voice": "Karen", "prompt": "...", "temperature": null, "max_duration": 30, "language": "ENG", "tools": null } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Web Agent Settings Source: https://docs.bland.ai/api-v1/post/agents-id POST https://api.bland.ai/v1/agents/{agent_id} Update your web agent's settings, prompt and other details. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` The web agent you'll be updating. ### Body **prompt** `string` *required* Provide instructions, relevant information, and examples of the ideal conversation flow. > [accordion] Best Practices > > #### Out-of-the-Box Behaviors (Summarized): > > * Speech pattern: Direct, concise, casual > * Spells out symbols, acronyms, abbreviations, percentages, etc. (\$4,000,000 -> "four million dollars") > * Asks clarifying questions > > #### Prompting Tips: > > * Want to easily test out exactly how your agent will behave? > * [Try out Agent Testing!](https://app.bland.ai/home?page=testing) > * Aim for less than >2,000 characters where possible. > * Simple, direct prompts are the most predictable and reliable. > * Frame instructions positively: > * `"Do this"` rather than `"Don't do this"`. > * Ex. "Keep the conversation casual" rather than "Don't be too formal". > * This gives concrete examples of what to do, instead of leaving expected behavior open to interpretation. **voice** `string` Set your agent's voice - all available voices can be found with the [List Voices](/api-v1/get/voices) endpoint. **webhook** `string` Set a webhook URL to receive call data after the web call completes. **metadata** `object` Add any additional information you want to associate with the call. This can be useful for tracking or categorizing calls. **pathway\_id** `string` Set the pathway that your agent will follow. This will override the `prompt` field, so there is no need to pass the 'prompt' field if you are setting a pathway. Warning: Setting a pathway will set the following fields to `null` / their default value - `prompt`, `first_sentence`, `model`, `dynamic_data`, `tools`, `transfer_list` Set to `null` or an empty string to clear the pathway. **language** `string` (default: ENG) Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings. Supported Languages and their codes can be found [here](/api-v1/post/calls#param-language). **webhook** `string` The webhook should be a http / https callback url. We will send the call\_id and transcript to this URL after the call completes. This can be useful if you want to have real time notifications when calls finish. Set to `null` or an empty string to clear the webhook. **model** `string` (default: base) Select a model to use for your call. Options: `base` or `turbo`. In nearly all cases, `base` is the best choice for now. > [accordion] Model Differences > > There are two different ways to use Bland: > > * `model: base` > * The original, follows scripts/procedures most effectively. > * Supports all features and capabilities. > * Best for Custom Tools > * `model: turbo` > * The absolute fastest latency possible, can be verbose at times > * Limited capabilities currently (excludes Transferring, IVR navigation, Custom Tools) > * Extremely realistic conversation capabilities **first\_sentence** `string` A phrase that your call will start with instead of a generating one on the fly. This works both with and without `wait_for_greeting`. Can be more than one sentence, but must be less than 200 characters. To remove, set to `null` or an empty string. **tools** `array` Interact with the real world through API calls. Detailed tutorial here: [Custom Tools](/tutorials/custom-tools) **dynamic\_data** `object` Integrate data from external APIs into your agent's knowledge. Set to `null` or an empty string to clear dynamic data settings. Detailed usage in the [Send Call](/api-v1/post/calls) endpoint. **interruption\_threshold** `number` (default: 500) Legacy. Sets a fixed wait, in milliseconds, after the caller stops speaking before the AI responds. We recommend leaving this unset: response timing adapts to each caller automatically (see [Agent Speech](/tutorials/agent-speech)). To control how readily the AI stops when the caller talks over it, use `interruptibility`. **interruptibility** `integer` (default: 2) Controls how readily the AI stops speaking when the caller talks over it. A higher value yields more easily; a lower value holds the turn through more of the caller's speech. * `0`: Block. The AI ignores interruptions and finishes speaking (same as `block_interruptions: true`). * `1`: Difficult. Harder to interrupt. * `2`: Balanced (default). * `3`: Easy. The AI stops quickly when the caller begins speaking. * `4`: Always interrupt. Any caller speech stops the AI, including brief acknowledgments like "uh-huh". See [Agent Speech](/tutorials/agent-speech) for how each level behaves. **max\_duration** `integer (minutes)` (default: 30) The maximum duration that calls to your agent can last before being automatically terminated. Set to `null` to reset to default. ### Response **status** `string` Whether the update was successful or not - will be `success` or `error`. **message** `string` A message describing the status of the update. **updates** `object` An object containing the updated settings for the agent. **failed\_updates** `object` If the update was unsuccessful, this will contain the settings that failed to update. Useful to determine how your request is being interpreted on our end. ```json Response theme={null} { "status": "success", "message": "Successfully updated agent 46f37229-7d12-44be-b343-6e68274cfbea.", "updates": { "model": "base" } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Authorize a Web Agent Call Source: https://docs.bland.ai/api-v1/post/agents-id-authorize POST https://api.bland.ai/v1/agents/{agent_id}/authorize Create a single-use session token for a client to talk with your web agent. ### Headers **authorization** `string` *required* Your API key for authentication. Example web call usage (client side): ```javascript theme={null} import { BlandWebClient } from 'bland-client-js-sdk'; const agentId = 'YOUR-AGENT-ID'; const sessionToken = 'YOUR-SESSION-TOKEN'; document.addEventListener('DOMContentLoaded', async () => { document.getElementById('btn').addEventListener('click', async () => { const blandClient = new BlandWebClient( agentId, sessionToken ); await blandClient.initConversation({ sampleRate: 44100, }); }); }); ``` ### Path **agent\_id** `string` *required* The web agent to authorize a call for. Special note: While in Beta, this request must be made to the `api.bland.ai` domain. ### Body **request\_data** `object` Variables to be passed to this session. Example: ```json theme={null} { "name": "John Doe" } ``` ### Response **token** `string` The single-use session token that can be sent to the client. **status** `string` Can be `success` or `error`. **message** `string` A message saying whether the token creation succeeded, or a helpful message describing why it failed. ```json theme={null} { "token": "22480c52-0ff1-4214-bcb7-50649b508432" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Web Agent Source: https://docs.bland.ai/api-v1/post/agents-id-delete POST https://api.bland.ai/v1/agents/{agent_id}/delete Delete a web agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path **agent\_id** `string` *required* The web agent to delete. ### Response **status** `string` Can be `success` or `error`. **message** `string` A message saying whether the deletion succeeded, or a helpful message describing why it failed. ```json theme={null} { "status": "success", "message": "Successfully deleted agent 2c565dc7-f41f-43db-a99f-e4c8ba9d7d18" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Alarm Source: https://docs.bland.ai/api-v1/post/alarms POST https://api.bland.ai/v1/alarms Create an alarm configuration for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **metric\_type** `string` *required* Metric to monitor. Allowed values: `latency`, `api_errors`, `call_length`. **threshold** `number` *required* Positive numeric threshold used for alarm trigger evaluation. Notes: * `threshold` is a sensitivity scalar (higher values are less sensitive; lower values are more sensitive). * The Dashboard may display an approximate "% change" visualization for this value. Treat that UI percentage as a directional aid, not an exact conversion. Dashboard sensitivity presets map to these threshold values: * `Sensitive` → `0.5` * `Normal` → `1.0` * `Relaxed` → `2.0` * `Critical` → `2.5` **webhook\_config** `object` Optional webhook destination for alarm notifications. `webhook_config` should be a JSON object with: * `url` (string, required) * `headers` (object, optional) Example: ```json theme={null} { "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "application/json", "Authorization": "Bearer test-token" } } } ``` **email\_addresses** `string[]` Optional email recipients for notifications. **sms\_numbers** `string[]` Optional SMS recipients for notifications. ### Response **data.alarm** `object` Created alarm configuration object. **data.alarm.id** `string` Alarm configuration ID. **data.alarm.metric\_type** `string` Metric tracked by this alarm. **data.alarm.threshold** `number` Configured trigger threshold. **data.alarm.enabled** `boolean` Whether this alarm is enabled. **errors** `null|array` `null` on success, otherwise an array of error objects. ```json Success theme={null} { "data": { "alarm": { "id": "c92e5e2d-0d41-4c6f-a194-7d9f99e34ab1", "metric_type": "api_errors", "enabled": true, "threshold": 33, "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "appl***" } }, "email_addresses": ["alerts@example.com"], "sms_numbers": ["+15555550123"], "created_at": "2026-03-12T15:56:21.836Z", "updated_at": "2026-03-12T15:56:21.836Z" } }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "error": "INVALID_THRESHOLD", "message": "Threshold must be a positive number" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Test Alarm Notifications Source: https://docs.bland.ai/api-v1/post/alarms-id-notify POST https://api.bland.ai/v1/alarms/{id}/notify Send a test alarm or recovery notification. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Body Parameters **type** `string` *required* Notification type to test. Allowed values: `alarm`, `recovery`. ### Response **data.success** `boolean` Whether at least one configured delivery method succeeded. **data.message** `string` Summary of the test result. **data.results** `object` Delivery results by channel (`webhook`, `email`, `sms`). **data.results.webhook.success** `boolean` Whether webhook delivery succeeded. **data.results.webhook.statusCode** `number` HTTP status returned by the webhook endpoint, when available. **data.results.email.success** `boolean` Whether email delivery succeeded. **data.results.email.sentTo** `string[]` Recipient list used for the test email. **errors** `null|array` `null` on success response, or an array with `NOTIFICATION_TEST_FAILED`. ```json Success theme={null} { "data": { "success": true, "message": "Alarm notification test completed: 2/2 methods successful", "results": { "webhook": { "success": true, "statusCode": 200 }, "email": { "success": true, "sentTo": ["alerts@example.com"] } } }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "error": "INVALID_NOTIFICATION_TYPE", "message": "type must be either 'alarm' or 'recovery'" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Toggle Alarm Source: https://docs.bland.ai/api-v1/post/alarms-id-toggle POST https://api.bland.ai/v1/alarms/{id}/toggle Enable or disable an alarm. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Body Parameters **enabled** `boolean` *required* * `true`: Alarm is active. The system will evaluate this metric on scheduled runs and can generate alarm/recovery events and notifications. * `false`: Alarm is paused. The config is retained, but scheduled evaluation and notifications for this alarm are disabled until re-enabled. ### Response **data.alarm** `object` Updated alarm configuration object. **data.alarm.enabled** `boolean` Updated enabled state. **data.alarm.id** `string` Alarm configuration ID. **data.alarm.metric\_type** `string` Metric this alarm tracks. **data.alarm.threshold** `number` Configured threshold for this alarm. **data.alarm.webhook\_config** `object|null` Webhook settings object. Header values may be masked in responses. **data.alarm.email\_addresses** `string[]` Email recipients for notifications. Can be an empty array. **data.alarm.sms\_numbers** `string[]` SMS recipients for notifications. Can be an empty array. **data.alarm.created\_at** `string` ISO timestamp when the alarm was created. **data.alarm.updated\_at** `string` ISO timestamp when the alarm was last updated. **errors** `null|array` `null` on success, otherwise an array of error objects. ```json Success theme={null} { "data": { "alarm": { "id": "72e424a6-496f-4f89-a349-c6c8cb3eff29", "metric_type": "latency", "enabled": false, "threshold": 0.5, "webhook_config": { "url": "https://example.com/webhooks/alarms", "headers": { "Content-Type": "appl***" } }, "email_addresses": ["alerts@example.com"], "sms_numbers": [], "created_at": "2026-03-12T16:13:02.694Z", "updated_at": "2026-03-12T17:08:56.928Z" } }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "error": "INVALID_ENABLED_VALUE", "message": "enabled must be a boolean value (true or false)" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Trigger Alarm Evaluation Source: https://docs.bland.ai/api-v1/post/alarms-id-trigger POST https://api.bland.ai/v1/alarms/{id}/trigger Manually trigger alarm evaluation with current data. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* Alarm configuration ID. ### Response **data.success** `boolean` Whether the evaluation completed with enough data. **data.message** `string` Human-readable result message. **data.currentMetrics** `object` Current metric snapshot, when available. **data.currentMetrics.value** `number` Current metric value. **data.currentMetrics.sampleCount** `number` Number of samples used in evaluation. **data.currentMetrics.deviation** `number|null` Deviation from baseline. **data.currentMetrics.threshold** `number` Configured threshold for comparison. ```json Success theme={null} { "data": { "success": true, "message": "Test completed successfully. Current alarm state: NORMAL", "currentMetrics": { "value": 0.2, "sampleCount": 22, "deviation": null, "threshold": 2.5 } }, "errors": null } ``` ```json Not Enough Data theme={null} { "data": { "success": false, "message": "Not enough recent data available. Please wait until there is more data to trigger an alarm." }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Block Rules Source: https://docs.bland.ai/api-v1/post/blocked-numbers POST https://api.bland.ai/v1/blocked_numbers Create one or more block rules to prevent specific phone numbers from reaching your inbound numbers. > [!NOTE] > > **Call Blocking** – Blocked numbers will be rejected before reaching any agent. Blocking can apply globally or to specific inbound lines. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **numbers** `string[]` *required* A list of phone numbers to block, formatted in E.164 (e.g., `+14155551234`). Maximum 10 numbers per request. **is\_global** `boolean` *required* Set to `true` to block the numbers globally across all inbound numbers. Set to `false` to scope the block to a specific `inbound_number`. You cannot enable both `is_global` and `inbound_number` in the same request. **inbound\_number** `string` The E.164 formatted inbound number to associate the block with. Required when `is_global` is `false`. **reason** `string` Optional text to describe the reason for blocking. ### Response **data** `object` Contains the number of rules created and the list of created blocks. **data.created\_count** `number` Number of block rules successfully created. **data.blocks** `array` List of block rule objects that were created. **errors** `null|array` `null` on success, or an array of error objects if validation fails. ```json Response theme={null} { "data": { "created_count": 1, "blocks": [ { "id": 123, "blocked_number": "+10000000000", "is_global": true, "inbound_number": null, "org_id": "b7d3e9fc-5c4a-4c2a-9b8f-d1e1d1a2e333", "reason": null, "is_active": true, "created_at": "2025-01-01T00:00:00.000Z", "updated_at": "2025-01-01T00:00:00.000Z" } ] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Edit Block Rule Source: https://docs.bland.ai/api-v1/post/blocked-numbers-id-edit POST https://api.bland.ai/v1/blocked_numbers/{block_id}/edit Update attributes of an existing block rule. > [!NOTE] > > You can only update fields like `reason` or `is_active`. Phone numbers and scope (global/inbound) are immutable after creation. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **block\_id** `number` *required* The unique ID of the block rule to update. ### Body Parameters **reason** `string` Optional reason for blocking. Set to `null` to remove an existing reason. **is\_active** `boolean` Controls whether the block rule is currently enforced. Set to `false` to disable or `true` to re-enable. Use `null` to leave unchanged. ### Response **data** `object` The updated block rule object. **data.id** `number` Unique ID of the block rule. **data.blocked\_number** `string` The phone number being blocked. **data.is\_global** `boolean` Indicates if the block applies globally. **data.inbound\_number** `string|null` The specific inbound number the block applies to (if not global). **data.org\_id** `string` UUID of the owning organization. **data.reason** `string|null` Reason for the block, if present. **data.is\_active** `boolean` Whether the block rule is currently active. **data.created\_at** `string` ISO timestamp when the rule was created. **data.updated\_at** `string` ISO timestamp of the last update. **errors** `null|array` `null` on success, or a list of validation or lookup errors. ```json Response theme={null} { "data": { "id": 123, "blocked_number": "+10000000000", "is_global": false, "inbound_number": "+18888888888", "org_id": "b7d3e9fc-5c4a-4c2a-9b8f-d1e1d1a2e333", "reason": "User requested block", "is_active": false, "created_at": "2025-01-01T00:00:00.000Z", "updated_at": "2025-01-10T12:00:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Call Source: https://docs.bland.ai/api-v1/post/calls POST https://api.bland.ai/v1/calls Send an AI phone call with a custom objective and actions. ## Overview Send an AI phone call with a custom objective and actions. This endpoint can be used to create dynamic phone calls where the AI agent can follow instructions, use tools, and follow a conversation pathway. > [!NOTE] > > International calls need a completed purchase: buy at least \$5 of credits in the [dashboard](https://app.bland.ai/dashboard/pay) under Billing, or turn on auto-recharge. Numbers on the [Agent Phone Plan](/platform/agent-phone-plan) call the US and Canada only, regardless of your credit balance. ## Choose what runs your call Before sending, choose the resource you want to run. If you want the call associated with a Bland Agent in the current dashboard, use **`agent_id`**. | Dispatch choice | What runs | Verify before sending | | - | - | - | | **Agent ID** (`agent_id`) | A saved Bland Agent version. | The exact agent ID, organization, and intended environment or version. Requires an organization API key. | | **Persona ID** (`persona_id`) | A persona's reusable call configuration and routing. | The exact persona ID, selected persona version, configuration, and any pathway overrides. | | **Pathway ID** (`pathway_id`) | A conversational pathway directly. | The exact pathway ID, intended pathway version, and required `request_data` variables. | These IDs identify different objects. They are not interchangeable, even when names or prompts match. A pathway compiled from an agent does not make pathway dispatch equivalent to agent dispatch. The caller ID (`from`) is a separate choice. Using a phone number assigned to an agent does not select that agent for an outbound call. ### Instructions for AI assistants 1. **Resolve the dispatch choice before sending.** If the user has not selected a resource type, ask: "Should I send this call through a dashboard agent, a persona, or a specific pathway?" Make the choices concrete with the resources you found. For example: "I found the dashboard agent Taylor and a pathway named Taylor - Cardholder status check. Which should run the call?" Recommend agent dispatch when the user wants the conversation under that dashboard agent. 2. **Honor an established choice.** If the user already chose a resource type and target, use it without asking again. Keep that choice for subsequent calls in the same agreed task unless the user changes it or a new ambiguity arises. A name alone is insufficient when it matches multiple resource types. 3. **Verify the exact resource.** Check its type, account or organization, name, ID, and environment or version. Read the current endpoint or tool schema. Do not substitute an agent's persona or pathway because its ID is easier to obtain, or combine selectors without checking the supported behavior below. 4. **Ask before changing routes.** If the requested route is unavailable, explain the limitation and ask whether the user wants an alternative. Do not silently fall back to another resource type. 5. **Verify the resulting conversation.** Save the `call_id`, check the actual source and destination numbers, and confirm the recorded resource and version. For agent dispatch, also check the intended agent's Conversations view. Report call success and an attribution problem separately. Do not place a duplicate call just to repair dashboard visibility. ### Request examples Each example sends one call. Replace the example destination and resource ID with values you have verified in the intended organization. Export your key as `BLAND_API_KEY`. Supply any variables required by your agent, persona, or pathway in `request_data`. > [tab] Bland Agent > > Use `agent_id` with an organization API key. This example explicitly selects the production pin and production environment variables. Do not include `persona_id` or `pathway_id`. > > ```bash theme={null} > curl --request POST https://api.bland.ai/v1/calls \ > --header "Authorization: Bearer $BLAND_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "phone_number": "+14155550100", > "agent_id": "00000000-0000-4000-8000-000000000001", > "agent_version": "production" > }' > ``` > > Find the conversation under **your agent > Conversations**. Verify the recorded agent and version; a successful submission alone does not prove the intended version ran. > [tab] Persona > > Use `persona_id` to run its reusable configuration. This example selects the production persona version. > > ```bash theme={null} > curl --request POST https://api.bland.ai/v1/calls \ > --header "Authorization: Bearer $BLAND_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "phone_number": "+14155550100", > "persona_id": "00000000-0000-4000-8000-000000000002", > "persona_version": "production" > }' > ``` > > Find the call under **All agents > Conversations**, using its `call_id`. Do not assume it belongs to a Bland Agent because the persona uses a related pathway or number. > [tab] Pathway > > Use `pathway_id` to run that pathway directly. This example selects its production version. > > ```bash theme={null} > curl --request POST https://api.bland.ai/v1/calls \ > --header "Authorization: Bearer $BLAND_API_KEY" \ > --header "Content-Type: application/json" \ > --data '{ > "phone_number": "+14155550100", > "pathway_id": "00000000-0000-4000-8000-000000000003", > "pathway_version": "production" > }' > ``` > > Find the call under **All agents > Conversations**, using its `call_id`. A matching pathway name or a description referencing an agent ID does not establish agent attribution. ### Selector combinations and precedence * `agent_id` cannot be combined with `persona_id` or `pathway_id`; the API rejects the combination. `agent_version` requires `agent_id`. The agent graph drives the call, so omit `task` on agent requests. * Agent call settings supply defaults. Explicit call settings such as `voice`, `record`, and `max_duration` override their agent defaults. Explicit `request_data` and `metadata` replace their respective default objects, including when you pass `{}`. * A persona can be combined with `pathway_id` and `pathway_version` to override its pathway routing. An explicit `persona_settings` object takes precedence over those pathway overrides. For versioned personas, stored call configuration is applied over matching top-level request fields. Legacy persona presets apply the request over the preset instead. Inspect the persona configuration rather than assuming all request fields win. * A direct pathway request does not need `task`; its graph controls the conversation. `request_data` supplies call variables. > [!WARNING] > > Call completion and agent attribution are separate checks. A persona or pathway call can complete and appear under All agents without appearing under the intended Bland Agent. Check the recorded association and dashboard view instead of inferring attribution from a name, prompt, description, or caller ID. ```bash Bland Agent theme={null} curl --request POST https://api.bland.ai/v1/calls \ --header "Authorization: Bearer $BLAND_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+14155550100", "agent_id": "00000000-0000-4000-8000-000000000001", "agent_version": "production" }' ``` ```bash Persona theme={null} curl --request POST https://api.bland.ai/v1/calls \ --header "Authorization: Bearer $BLAND_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+14155550100", "persona_id": "00000000-0000-4000-8000-000000000002", "persona_version": "production" }' ``` ```bash Pathway theme={null} curl --request POST https://api.bland.ai/v1/calls \ --header "Authorization: Bearer $BLAND_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "phone_number": "+14155550100", "pathway_id": "00000000-0000-4000-8000-000000000003", "pathway_version": "production" }' ``` *** ## Headers **authorization** `string` *required* Your API key for authentication. Send it as `Bearer YOUR_API_KEY`. A bare `Authorization: YOUR_API_KEY` with no prefix is also accepted, so older examples keep working. `x-api-key` is not read and does not authenticate. Get a key from the [dashboard](https://app.bland.ai/dashboard/settings). An autonomous agent with no dashboard session can mint its own with the [Agent onboarding API](/platform/connect-your-agent). **encrypted\_key** `string` A special key for using a BYOT (Bring Your Own Twilio) account. Only required for sending calls from your own Twilio account. Learn more about BYOT [here](/tutorials/custom-twilio). *** ## Body Parameters ### Basic Parameters **phone\_number** `string` *required* The phone number to call. Must be a valid phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. **agent\_id** `string` The UUID of a Bland Agent in the current organization. Requires an organization API key. Runs the agent's saved graph and records the agent/version association on the call. Use this when the conversation should belong to a dashboard agent. Do not combine it with `persona_id` or `pathway_id`. Omit `task` because the agent graph supplies the instructions. See [Choose what runs your call](#choose-what-runs-your-call). **agent\_version** `string` Selects the agent version and environment. Requires `agent_id`. | Value | Version selected | Environment variables | | - | - | - | | Omitted | Production pin, eligible for active experiment routing. | Production | | `"production"` | Production pin, bypassing experiments. | Production | | `"staging"` | Staging pin, bypassing experiments. | Staging | | `"dev"` or `"latest"` | Latest saved version on the main line, bypassing experiments. | Dev | | A semantic version such as `"1.2.0"` | That published version, bypassing experiments. | Dev | | `"branch:"` | The open branch's head, bypassing experiments. | Dev | A semantic version or branch selector uses dev variables even if the same version is deployed to production or staging. Use an environment label when you need that environment's variables. Branch names contain 1 to 64 letters, digits, underscores, periods, or hyphens. If the agent is unavailable, the selected environment has no deployed version, or preparation fails, inspect the API error before retrying. Do not replace the requested route with a persona or pathway without the user's choice. **voice** `string` (default: Karen) The voice of the AI agent to use. Accepts any form of voice ID, including custom voice clones and voice presets. If you omit it, the call uses Karen. Default voices can be referenced directly by their name instead of an id. Usage example: voice: "Karen" For Bland's recommended voices, call [List voices](/api-v1/get/voices) and pick voices tagged `"Bland Curated"` whose `service` is `BTTS_V3`. **pathway\_id** `string` This is the pathway ID for the pathway you have created on our dev portal. You can access the ID of your pathways by clicking the 'Copy ID' button of your pathway [here](https://app.bland.ai/home?page=convo-pathways) Note: Certain parameters do not apply when using pathways. Example Simple Request body: ```json theme={null} { "phone_number": "+1975934749", "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7" } ``` **pathway\_version** `integer | string` Select a numeric pathway version, `"production"`, or `"staging"`. Omitted, `0`, and `"production"` select production. A missing numeric version can fall back to production, so verify the resolved version when an exact version matters. **task** `string` Required when you do not supply `agent_id`, `persona_id`, or `pathway_id`. Do not specify it for agent or pathway dispatch. Provide instructions, relevant information, and examples of the ideal conversation flow. This is your prompt where you are telling the agent what to do. Recommendations: * Include context and a background/persona for the agent like `"You are {name}, a customer service agent at {company} calling {name} about {reason}`. * Phrase instructions like you are speaking to the agent before the call. * Any time you tell the agent not to do something, provide an example of what they should do instead. * Keep the prompt under 2,000 characters where possible. **first\_sentence** `string` Makes your agent say a specific phrase or sentence for it's first response. **persona\_id** `string` The ID of the persona to use for the call. Personas act as pre-configured templates that automatically apply a configuration when you pass a persona\_id to an outbound call. Think of them as "call presets" that you can reuse across multiple calls. Check the selected persona's stored configuration and [selector precedence](#selector-combinations-and-precedence) before applying overrides. `persona_id` cannot be combined with `agent_id`. You can access your persona IDs by clicking the "Personas" button at the bottom of the Send Call page, and then "Use and Manage". **persona\_version** `string` (default: production) For versioned personas, selects `"production"` or `"draft"`. If `"draft"` is requested but no draft exists, the server uses production when available. Verify that the intended version exists before sending. ### Model Parameters **language** `string` (default: en) Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings. > [accordion] Expand to view language options > > The available language options are as follows: > > * `babel` - Babel (All Languages) - Experimental1 > * `fluent` - Fluent (Multilingual)2 > * `en` - English > * `babel-en` - English (Babel) > * `en-US` - English (US) > * `en-GB` - English (UK) > * `en-AU` - English (Australia) > * `en-NZ` - English (New Zealand) > * `en-IN` - English (India) > * `es` - Spanish > * `babel-es` - Spanish (Babel) > * `es-419` - Spanish (Latin America) > * `fr` - French > * `babel-fr` - French (Babel) > * `fr-CA` - French (Canada) > * `de` - German > * `babel-de` - German (Babel) > * `el` - Greek > * `hi` - Hindi > * `hi-Latn` - Hindi (Latin script) > * `hu` - Hungarian > * `ja` - Japanese > * `ko` - Korean > * `ko-KR` - Korean (Korea) > * `vi` - Vietnamese > * `pt` - Portuguese > * `pt-BR` - Portuguese (Brazil) > * `pt-PT` - Portuguese (Portugal) > * `zh` - Chinese (Mandarin, Simplified) > * `zh-CN` - Chinese (Mandarin, Simplified, China) > * `zh-Hans` - Chinese (Mandarin, Simplified, Hans) > * `zh-TW` - Chinese (Mandarin, Traditional) > * `zh-Hant` - Chinese (Mandarin, Traditional, Hant) > * `it` - Italian > * `nl` - Dutch > * `pl` - Polish > * `ru` - Russian > * `sv` - Swedish > * `sv-SE` - Swedish (Sweden) > * `da` - Danish > * `da-DK` - Danish (Denmark) > * `fi` - Finnish > * `no` - Norwegian > * `id` - Indonesian > * `ms` - Malay > * `tr` - Turkish > * `uk` - Ukrainian > * `bg` - Bulgarian > * `cs` - Czech > * `ro` - Romanian > * `sk` - Slovak > * `auto` - Auto Detect (English & Spanish) > > 1 The Bland Babel Transcription Engine (BETA) is our new proprietary transcription engine! Babel can handle multilingual conversations by identifying and switching languages on the fly. It's now in beta and available under the "babel" language mode. **Note: For pathway calls and prompts, make sure to prompt your agent to respond in the language they are spoken to.** > > 2 The `fluent` mode is a multilingual option that auto-detects the spoken language and switches between languages on the fly, powered by a multilingual transcription model. **Note: For pathway calls and prompts, make sure to prompt your agent to respond in the language they are spoken to.** **wait\_for\_greeting** `boolean` (default: false) By default, the agent starts talking as soon as the call connects. When wait\_for\_greeting is set to true, the agent will wait for the call recipient to speak first before responding. **pronunciation\_guide** `array` The pronunciation guide is an `array` of `objects` that guides the agent on how to say specific words. Use this to improve clarity for acronyms, names, brand terms, or jargon. ```json theme={null} [ { "word": "example", "pronunciation": "ex-am-ple", "case_sensitive": "false", "spaced": "false" }, { "word": "API", "pronunciation": "A P I", "case_sensitive": "true", "spaced": "true" } ] ``` > [accordion] Object Parameters > > * `word` — the word you want to guide the LLM on how to pronounce > * `pronunciation` — how the AI should pronounce the word, using syllables or space-separated characters. For example, `"A P I"` ensures each letter is spoken clearly rather than read as a word. > * `case_sensitive` — whether or not to consider case. Particularly useful with names. EG: 'Max' the name versus 'max' the word. Defaults to false. `Not required`. > * `spaced` — whether to match whole words only. When true, "high" will match "high" but not "hightop". When false, it will match any word that contains "high". Defaults to true. `Not required`. **temperature** `float` (default: 0.7) A value between 0 and 1 that controls the randomness of the LLM. 0 will cause more deterministic outputs while 1 will cause more random. Example Values: "0.9", "0.3", "0.5" **interruption\_threshold** `number` (default: 500) Legacy. Sets a fixed wait, in milliseconds, after the caller stops speaking before the AI responds. We recommend leaving this unset: response timing adapts to each caller automatically (see [Agent Speech](/tutorials/agent-speech)). To control how readily the AI stops when the caller talks over it, use `interruptibility`. **interruptibility** `integer` (default: 2) Controls how readily the AI stops speaking when the caller talks over it. A higher value yields more easily; a lower value holds the turn through more of the caller's speech. * `0`: Block. The AI ignores interruptions and finishes speaking (same as `block_interruptions: true`). * `1`: Difficult. Harder to interrupt. * `2`: Balanced (default). * `3`: Easy. The AI stops quickly when the caller begins speaking. * `4`: Always interrupt. Any caller speech stops the AI, including brief acknowledgments like "uh-huh". See [Agent Speech](/tutorials/agent-speech) for how each level behaves. ### Dispatch Parameters **from** `string` Specify a phone number to call from that you own or have uploaded from your Twilio account. Country code is required, spaces or parentheses must be excluded. By default, calls are initiated from a separate pool of numbers owned by Bland. If you are using your own twilio numbers, you must specify a matching encrypted\_key in the create call request headers. **dialing\_strategy** `object` Controls how the caller number (`from`) is selected when placing an outbound call. Use this field to influence how the system chooses a number that appears local or relevant to the callee, improving pickup rates. There are two supported strategies: #### 1. `local` Automatically selects a `from` number that matches the callee's area code for **US-based calls**. You must have purchased a local dialing add-on in the [add-ons section](https://app.bland.ai/dashboard/add-ons). Example: ```json theme={null} { "dialing_strategy": { "type": "local" } } ``` #### 2. `custom_pooling` Selects a number from your own pre-configured pool of phone numbers. Designed for organizations that want full control over the caller IDs being used. This is an enterprise only feature, to use this feature contact your Bland representative or reach out to sales. Example: ```json theme={null} { "dialing_strategy": { "type": "custom_pooling", "pool_id": "bd039087-decb-435a-a6e3-ca1ffbf89974" } } ``` By default, Bland will choose a US-based number from our own pool of numbers. **timezone** `string` (default: America/Los\_Angeles) Set the timezone for the call. Handled automatically for calls in the US. This helps significantly with use cases that rely on appointment setting, scheduling, or behaving differently based on the time of day. Timezone options are here in the TZ identifier column. **start\_time** `string` The time you want the call to start. If you don't specify a time (or the time is in the past), the call will send immediately. Set your time in the format YYYY-MM-DD HH:MM:SS -HH:MM (ex. 2021-01-01 12:00:00 -05:00). The timezone is optional, and defaults to UTC if not specified. Note: Scheduled calls can be cancelled with the POST /v1/calls/:call\_id/stop endpoint. **transfer\_phone\_number** `string` A phone number that the agent can transfer to under specific conditions - such as being asked to speak to a human or supervisor. This option will be ignored for pathways. > [accordion] Prompting Notes > > For best results: > > * Specify conditions that the agent should transfer to a human under (examples are great!) > * In the `task`, refer to the action solely as "transfer" or "transferring". > * Alternate phrasing such as "swap" or "switch" can mislead the agent, causing the action to be ignored. **transfer\_list** `object` Give your agent the ability to transfer calls to a set of phone numbers. This option will be ignored for pathways. Overrides transfer\_phone\_number if a transfer\_list.default is specified. Will default to transfer\_list.default, or the chosen phone number. Example usage to route calls to different departments: ```json theme={null} { "transfer_list": { "default": "+12223334444", "sales": "+12223334444", "support": "+12223334444", "billing": "+12223334444" } } ``` **max\_duration** `integer` (default: 30) When the call starts, a timer is set for the `max_duration` minutes. At the end of that timer, if the call is still active it will be automatically ended. Example Values: 20, 2 ### Knowledge Parameters **tools** `array` Add custom tools and knowledge base items to your call for your agent to call upon. Example: ```json theme={null} { "tools": [ "TL-ba6c4237-67c2-40e8-868b-60d429a84eda", "KB-30d465c0-22d0-41e0-a63d-61bcacc277e7" ] } ``` Read more about custom tools [here](https://docs.bland.ai/tutorials/custom-tools#custom-tools) ### Audio Parameters **background\_track** `string` Select an audio track that you'd like to play in the background during the call. The audio will play continuously when the agent isn't speaking, and is incorporated into it's speech as well. Use this to provide a more natural, seamless, engaging experience for the conversation. We've found this creates a significantly smoother call experience by minimizing the stark differences between total silence and the agent's speech. Options: * null - Default, will play audible but quiet phone static. * office - Office-style soundscape. Includes faint typing, chatter, clicks, and other office sounds. * cafe - Cafe-like soundscape. Includes faint talking, clinking, and other cafe sounds. * restaurant - Similar to cafe, but more subtle. * none - Minimizes background noise **noise\_cancellation** `boolean` (default: true) Toggles noise filtering or suppression in the audio stream to filter out background noise. This parameter was previously documented as defaulting to `false`. The server has been applying `true` when the field is omitted, so send it explicitly whenever the behavior matters to you. **block\_interruptions** `boolean` (default: false) When set to `true`, the AI will not respond or process interruptions from the user. **record** `boolean` (default: false) To record your phone call, set `record` to true. When your call completes, you can access through the `recording_url` field in the call details or your webhook. ### Voicemail Parameters **ivr\_mode** `boolean` (default: false) Set to `true` when the number you are calling answers with a phone menu rather than a person. IVR mode changes two things. The agent stops responding on the conversational timing it uses with a human, so it does not talk over a menu's prompts or fill its pauses. And voicemail handling is suppressed: the effective voicemail action becomes `"ignore"` no matter what you passed, because a phone tree has no voicemail to leave a message on. Pair it with [`precall_dtmf_sequence`](/api-v1/post/calls#param-precall-dtmf-sequence) to play a fixed sequence of digits before the call starts, or leave the agent to navigate the menu from the `task`. > [!NOTE] > > `amd` is a legacy alias for this parameter. It sets the same switch, and passing `ivr_mode: true` sets `amd` for you. Prefer `ivr_mode`: the name says what it does. **voicemail** `object` Configuration for handling voicemails during outbound calls. This object controls how the AI behaves when it encounters a voicemail, including whether to leave a message, send an SMS notification, or detect voicemails more intelligently using AI. It has the following parameters: * `message` (string): The message the AI will leave if a voicemail is detected. This message will be played after the beep, then the call will end. This field is required if `action` is set to `leave_message`. - `action` (enum): What the AI should do when it detects a voicemail. The default is `"hangup"`. Available options: * `"hangup"`: Immediately end the call without leaving a message. * `"leave_message"`: Play the `message` and then end the call. * `"leave_message_and_sms"`: Play the `message`, end the call, and send the SMS configured in `sms`. Supply both `message` and `sms`: with no `sms` config this falls back to `leave_message`. * `"ignore"`: Continue the call as if no voicemail was detected (used for IVRs or special routing). * `sms` (object): Optional. Configuration for sending an SMS notification when a voicemail is left. Contains: * `message` (string): Required. The body of the SMS message. Keep concise and clear. * `from` (string): Optional. The phone number to send the SMS from (must be a number you own and have SMS permissions for). The destination is resolved by Bland rather than set on the request. There is no `to` field, and passing one has no effect. - `sensitive` (boolean): When `true`, uses LLM-based analysis to detect frequent voicemails. The default is `false`. > [!NOTE] > > The effective action is derived from the whole request, not from `action` alone. Supplying a `message` implies leaving one, so `"action": "hangup"` sent alongside a `message` leaves the message. And [`ivr_mode`](/api-v1/post/calls#param-ivr-mode) forces `ignore` regardless of `action`, since a phone menu has no voicemail. See [Voicemail](/platform/agent-call-recipes#voicemail) for the full precedence. Example: ```json theme={null} { "voicemail": { "message": "Hi, just calling to follow up. Please call us back when you can.", "action": "leave_message", "sms": { "from": "+18005550678", "message": "We just left you a voicemail. Call us back anytime!" }, "sensitive": true } } ``` ### Analysis Parameters **citation\_schema\_ids** `string[]` The citation schema is an incredibly powerful tool for running ***post call analysis***, including specific variable extractions, conditional logic, and more. You can build a citation schema [here](https://app.bland.ai/dashboard/analytics?tab=citations). After building the citation schema (or schemas), you can copy their UUIDs and reference them in your API request for outgoing calls (and you can also attach them to your inbound phone numbers). Here's an example: ```json theme={null} { "citation_schema_ids": ["b7c2e1d4-8f3a-4c9e-9a2b-1e5f6d7c8a9b", "f2d3c4b5-6a7e-8d9c-0b1a-2c3d4e5f6a7b"] } ``` > Note: Citation schemas are very powerful and accurate, but also are more resource intensive to run. As such, for the time being, they are an enterprise-only feature. **disposition\_ids** `string[]` Outcome IDs to run after the call ends. Create outcomes with [Create Outcome](/api-v1/post/dispositions). Results appear in the `dispositions` field of [Call Details](/api-v1/get/calls-id). See [Outcomes](/tutorials/outcomes) for details. **stream\_post\_transfer\_transcript** `boolean` (default: false) When `true` and the call is transferred to a human, Bland transcribes the conversation after the transfer live and streams it over the [Post-Transfer Transcript Stream](/api-v1/post/calls-id-transcript-stream) WebSocket while the transferred conversation is happening. Works for both cold and warm transfers. This option controls the live stream only. To receive the post-transfer transcript in the post-call webhook, subscribe with `"post_transfer_transcript"` in `webhook_events`. The two are independent: you can use either one or both. > [!NOTE] > > This feature is in limited rollout. If it is not enabled for your organization, the option has no effect. **post\_call\_evals** `object` Attach an [evals workbench](/agents/evaluations#score-calls-after-they-end) to this call. When the call completes, Bland automatically runs the workbench's eval configuration against the call — no separate eval-run submission needed. Provide at least one of: * `workbench_setup_id` (string): The workbench setup to attach. Bland pins the setup's current published version at call creation, so editing the workbench mid-call does not change what gets evaluated. * `workbench_setup_version_id` (string): An exact published workbench setup version to pin. Attaching evals requires the call to be recorded. If you set `record: false` alongside `post_call_evals`, the request is rejected; otherwise recording is enabled automatically. The post-call webhook acknowledges the attachment with `post_call_evals: { workbench_setup_id, workbench_setup_version_id, status: "pending" }`. Eval scores arrive later on a separate `evals` webhook event once the run completes. Example: ```json theme={null} { "post_call_evals": { "workbench_setup_id": "b7c2e1d4-8f3a-4c9e-9a2b-1e5f6d7c8a9b" } } ``` ### Post Call Parameters **summary\_prompt** `string` (Optional) Custom instructions for how the call summary should be generated after the call completes. Use this to provide specific guidance or context for the AI when writing the post-call summary. Maximum length: 2000 characters. Example: ```json theme={null} { "summary_prompt": "Summarize the call in 2-3 sentences, focusing on the customer's main concern and any next steps discussed." } ``` **retry** `object` If the call goes to voicemail, you can set up the call to retry, after a configurable delay. You can also update the voicemail\_action, and voicemail\_message in the retry object, for the re-tried call. Takes in the following parameters: * `wait` (integer): The delay in seconds before the call is retried. * `voicemail_action` (enum): The action to take when the call goes to voicemail. Options: `hangup`, `leave_message`, `leave_message_and_sms`, `ignore`. * `voicemail_message` (string): The message to leave when the call goes to voicemail. Example: ```json theme={null} { "retry": { "wait": 10, "voicemail_action": "leave_message", "voicemail_message": "Hello, this is a test message." } } ``` **dispositions** `string[]` A list of possible outcome tags (dispositions) you define. After the call ends, the AI reviews the transcript and picks **one** of these tags to describe how the call went. Tag selection is based **only** on the transcript, no metadata or external inputs are used. The chosen tag will appear in the `disposition_tag` field of the call data. > [accordion] Built-in Disposition Tags > > If no custom `dispositions` are provided, the AI will automatically select from these built-in tags: > > * `INTERESTED` - Customer shows clear interest in the offering > * `NOT_INTERESTED` - Customer expresses lack of interest > * `FOLLOW_UP_REQUIRED` - Customer needs additional follow-up > * `CALL_BACK_SCHEDULED` - A callback appointment was scheduled > * `TRANSFERRED` - Call was transferred to another agent/department > * `OBJECTION_RAISED` - Customer raised concerns or objections > * `NEEDS_MORE_INFO` - Customer requires additional information > * `NOT_QUALIFIED` - Customer does not meet qualification criteria > * `NO_CONTACT_MADE` - Unable to establish meaningful contact > * `COMPLETED_ACTION` - Customer completed the desired action > * `DO_NOT_CONTACT` - Customer requested no future contact > * `AGENT_ENDED_CALL` - Call ended by AI (auto-assigned for calls >2 minutes without transcript) > * `NO_ANSWER` - Call was not answered (auto-assigned by system) > * `BUSY` - Number was busy (auto-assigned by system) > * `CANCELED` - Call was canceled (auto-assigned by system) > * `FAILED` - Call failed to connect (auto-assigned by system) Example: ```json theme={null} { "dispositions": ["got_full_name_and_number", "no_information_provided", "transferred_to_agent"] } ``` ### Advanced Parameters **request\_data** `object` Custom key-value data you send with the call. This information is available as variables inside your prompt, pathway, or tools — but only if the call is answered. ```json theme={null} { "task": "Say hello to the user, who's name is {{name}}", "request_data": { "name": "John Doe" } } ``` In this case, the AI would say: "Hello, John". **metadata** `object` Add any additional information you want to associate with the call. This data is accessible for all calls, regardless of if they are picked up or not. This can be used to track calls or add custom data to the call. Anything that you put here will be returned in the post call webhook under metadata. Example: ```json theme={null} { "metadata": { "campaign_id": "1234", "source": "web" } } ``` **external\_id** `string` Your own identifier for the call, such as a CRM interaction ID or a contact center session ID. Use it to look the call up later without storing Bland's `call_id`. Must be a non-empty string of at most 256 printable characters. The call is returned in [Call details](/api-v1/get/calls-id), [List calls](/api-v1/get/calls), and the post-call webhook with this `external_id`. ```json theme={null} { "external_id": "crm-interaction-48213" } ``` **webhook** `string` When the call ends, call information is sent to this webhook URL. **webhook\_events** `array` Specify which events you want to stream to the webhook, during the call. > [!NOTE] > > **Citation Webhook Requirements:** > > * Include `citations` for any citation webhooks (sent separately after call completion) > * For delayed post-call webhooks with citations, you need `citations` + dashboard delay toggle enabled > > See the [Citations documentation](/enterprise-features/citations#webhook-integration-options) for complete setup instructions. Options: * `queue` * `call` * `latency` * `webhook` * `tool` * `dynamic_data` * `citations` (Required for any citation webhooks) * `evals` (Eval scores from an attached [evals workbench](/agents/evaluations#score-calls-after-they-end), sent as a separate webhook when the run completes) * `post_transfer_transcript` (Adds the post-transfer conversation to the post-call webhook when the call is transferred to a human; see [Post-transfer transcript](/tutorials/post-call-webhooks#post-transfer-transcript). Requires call recording: `record` is enabled automatically when unset, and passing `record: false` alongside this subscription returns a 400. In limited rollout: if not enabled for your organization, the subscription has no effect.) Example payloads: ```json queue theme={null} // ex 1 { "message": "Call enqueued", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "queue", "log_level": "info" } ``` ```json call theme={null} // ex 1 { "message": "Call connected", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 2 { "message": "Sending first sentence: Hello, thank you for reaching out. I'd like to get to know you a bit better. How are you feeling today?", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 3 { "message": "Agent speech: Hello, thank you for reaching out.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 4 { "message": "Handling user speech: Yeah. I'm thirty six. And I'm five foot nine.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 5 { "message": "Webhook Response: 200 | Webhook Response Data: [object Object] | Response Time: 689ms", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json latency theme={null} // ex 1 { "message": "TTS: 218ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } // ex 2 { "message": "LLM: 266ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } ``` ```json webhook theme={null} { "message": "Storing dynamic data messages: \n\n answer : \"true\"", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json tool theme={null} { "message": "Executing custom tool: Test Tool 4 with input: [object Object]", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json dynamic_data theme={null} { "message": "Storing dynamic data: \n\n vector_data : {\"data\":{\"results\":[{\"id\":\"fedcba98-7654-3210-fedc-ba9876543210\",\"input_text\":\"Here are details on the restaurant...\",\"similarity\":0.103339002763233,\"chunk_index\":0}]},\"errors\":null}", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json citations theme={null} { "call_id": "12345678-1234-1234-1234-123456789abc", "user_id": "11111111-2222-3333-4444-555555555555", "event_type": "citations", "timestamp": "2025-07-03T16:41:15.231Z", "citations": [ { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "User height", "variable_type": "boolean", "value": true, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller Age", "variable_type": "number", "value": 36, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" }, { "id": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff", "idx": 4, "start_time": 30.56, "end_time": 35.455, "confidence": 0.5672727272727273, "channel": 0, "transcript": "All right. So you're 36 years old and five foot nine. That's great. How's your day been so far? Anything exciting happened?", "speaker_id": "SPEAKER_0_0", "speaker_name": null, "speaker_description": null, "topics": [ "day_review_inquiry" ], "topics_meta": "{\"day_review_inquiry\":\"agent inquiring about the customer's day and any exciting events\"}", "utterance_type": "question" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller feeling", "variable_type": "string", "value": null, "cited_utterances": [], "schema_id": "99999999-8888-7777-6666-555555555555" } ] } ``` **dynamic\_data** `object[]` Integrate data from external APIs into your agent's knowledge. Set to `null` or an empty string to clear dynamic data settings. ```json theme={null} "dynamic_data": [ { "url": "endpoint", "method": "GET", "body": [], "headers": [ { "key": "Content-Type", "value": "application/json" } ], "query": [], "cache": true, "response_data": [ { "context": "", "data": "$", "name": "" } ] } ], ``` **keywords** `string[]` (default: \[]) These words will be boosted in the transcription engine - recommended for proper nouns or words that are frequently mis-transcribed. For example, if the word Blandy is frequently transcribed as a homonym like "Reese" you could do this: ```json theme={null} { "keywords": ["Blandy"] } ``` For stronger keyword boosts, you can place a colon then a boost factor after the word. The default boost factor is 2. ```json theme={null} { "keywords": ["Blandy:3"] } ``` **ignore\_button\_press** `boolean` (default: false) When `true`, the system will ignore DTMF input (Dual-Tone Multi-Frequency) — the tones generated when a user presses keys on their phone keypad (e.g., 0-9, \*, #).\ This disables any in-call actions triggered by keypad input, such as menu navigation or transfers.\ Useful when your agent should handle the entire call conversationally, without responding to button presses. **precall\_dtmf\_sequence** `string` A sequence of DTMF digits that will be played before the call starts. Acceptable characters are 0-9, \*, #, and w, where w is a pause of 0.5 seconds. Example: ```json theme={null} { "precall_dtmf_sequence": "1234567890*#w" } ``` **guard\_rails** `array` Configure guard rails to monitor the call for compliance violations and trigger actions automatically. Guard rails continuously analyze AI and user responses during the call. Learn more about guard rails in the [Guard Rails documentation](/tutorials/guard-rails). Each item in the array can be one of three types: > [accordion] TCPA Guard Rails > > * `tcpa:ai_disclosure` - AI must disclose it's an AI > * `tcpa:self_introduction` - Must identify who is calling > * `tcpa:recording_disclosure` - Must disclose the call is being recorded > * `tcpa:opt_out` - This out-of-the-box guard rail is different as it's not time-based and instead monitors the entire conversation to see if the agent continues to engage in the conversation after the user opts out. `config.end_seconds` is not needed for this type. > > ```json theme={null} > { > "type": "tcpa:ai_disclosure", > "actions": [ > { "type": "end_call" } > ], > "config": { > "end_seconds": 30 > } > } > ``` > > | Field | Type | Description | > | - | - | - | > | `type` | string | One of: `tcpa:ai_disclosure`, `tcpa:self_introduction`, `tcpa:recording_disclosure` | > | `actions` | array | Actions to take if disclosure is NOT made within the time window | > | `config.end_seconds` | number | Time window in seconds (default: 30) | > [accordion] Custom Guard Rails (Enterprise) > > Custom guard rails with your own prompt. Enterprise customers can create up to 5 custom guard rails. > > ```json theme={null} > { > "type": "custom", > "prompt": "Flag if the agent provides any medical advice or diagnosis...", > "actions": [ > { "type": "transfer", "config": { "phone_number": "+15551234567" } } > ] > } > ``` > > | Field | Type | Description | > | - | - | - | > | `type` | string | `custom` | > | `prompt` | string | Your custom detection prompt | > | `actions` | array | Actions to take when the guard rail triggers | > [accordion] Action Types > > Each guard rail requires an `actions` array. Available action types: > > | Action Type | Description | Config | > | - | - | - | > | `end_call` | Immediately terminate the call | None | > | `transfer` | Transfer to a human agent | `{ "phone_number": "+15551234567" }` | > | `move_to_node` | Jump to a specific pathway node | `{ "node_id": "node-uuid" }` | **Full example with multiple guard rails:** ```json theme={null} { "guard_rails": [ { "type": "tcpa:ai_disclosure", "actions": [{ "type": "end_call" }], "config": { "end_seconds": 30 } }, { "type": "tcpa:opt_out", "actions": [{ "type": "end_call" }] }, { "type": "custom", "prompt": "Flag if the agent makes any investment recommendations", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ] } ``` ## Response **status** `string` Can be `success` or `error`. **message** `string` A message explaining the status of the call. **call\_id** `string` A unique identifier for the call (present only if status is `success`). **batch\_id** `string` The batch ID of the call (present only if status is `success`). **errors** `array` For validation errors, a detailed list of each field with an error and it's error message. Example: ```json theme={null} { "status": "error", "message": "Invalid parameters", "errors": [ "Missing required parameter: phone_number.", "Missing required parameter: task.", "Phone number must be a string or number.", "Task must be a string." ] } ``` ```json theme={null} { "status": "success", "message": "Call successfully queued.", "call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1", "batch_id": null } ``` ## Error Codes Reference > [accordion] View All Error Codes > > This section documents all possible error codes and HTTP status codes you can receive when making a POST request to `/v1/calls`. > > ### Authentication & Authorization Errors > > **401 - AUTH\_FAILURE** `object` > > Authentication failed due to missing or invalid API key. > > ```json theme={null} > { > "data": null, > "errors": [ > { > "error": "AUTH_FAILURE", > "message": "Unauthorized" > } > ] > } > ``` > > **Common causes:** > > * Missing Authorization header > * Invalid API key > * Expired API key > > **403 - Account Flagged** `object` > > Account has been flagged or banned for security purposes. > > ```json theme={null} > { > "status": "error", > "message": "The Bland Team has flagged your account for security purposes. As a precautionary measure against recent heightened malicious use cases, we have flagged your account for review and temporarily blocked from dispatching calls. If you need to be unblocked urgently, please email us at support@bland.ai with your account phone number." > } > ``` > > ### Rate Limiting Errors (HTTP 429) > > **429 - Call Frequency Limit** `object` > > Calls sent too frequently to the same number. > > ```json theme={null} > { > "status": "error", > "message": "Calls can only be sent every 10 seconds to the same number. Please try again in a few seconds." > } > ``` > > **429 - General Rate Limit** `object` > > Rate limit exceeded for your account. > > ```json theme={null} > { > "status": "error", > "message": "Rate limit exceeded" > } > ``` > > **429 - Blacklisted Number** `object` > > Attempting to call a blacklisted number. > > ```json theme={null} > { > "status": "error", > "message": "This number is blacklisted." > } > ``` > > **429 - New Customer Rate Limit** `object` > > Rate limits for newly created accounts. > > ```json theme={null} > { > "status": "error", > "message": "Rate limit exceeded for newly created accounts. Please try again soon." > } > ``` > > **429 - International Rate Limit** `object` > > International calling rate limit exceeded. > > ```json theme={null} > { > "status": "error", > "message": "International rate limit exceeded for your account type." > } > ``` > > ### Parameter Validation Errors (HTTP 400) > > **400 - Missing Required Parameter** `object` > > Required parameters are missing from the request. > > ```json theme={null} > { > "status": "error", > "message": "Invalid parameters. Error: [\"Missing required parameter: phone_number.\"]", > "errors": ["Missing required parameter: phone_number."] > } > ``` > > **Required parameters:** > > * `phone_number` (always required) > * `task` (required if `pathway_id` is not provided) > > **400 - Invalid Field Types** `object` > > Field values are the wrong data type according to TypeBox validation. > > ```json theme={null} > { > "status": "error", > "message": "Record must be a boolean" > } > ``` > > **Common type validation errors:** > > * `"Task must be a string"` > * `"Record must be a boolean"` > * `"Max duration must be a number"` > * `"Temperature must be a number"` > * `"Tools must be an array"` > * `"Dynamic data must be an array"` > * `"Metadata must be a record of string keys and any values"` > > **400 - Invalid Voicemail Action** `object` > > Voicemail action must be one of the allowed values. > > ```json theme={null} > { > "status": "error", > "message": "Invalid voicemail action. Must be one of: hangup, leave_message, leave_message_and_sms, ignore" > } > ``` > > **400 - Number Range Validation** `object` > > Numeric values are outside their allowed ranges. > > ```json theme={null} > { > "status": "error", > "message": "Max duration must be at least 1" > } > ``` > > **400 - Invalid DTMF Sequence** `object` > > Precall DTMF sequence contains invalid characters. > > ```json theme={null} > { > "status": "error", > "message": "Precall DTMF sequence must be a valid DTMF sequence" > } > ``` > > **Valid DTMF characters:** 0-9, \*, #, w (wait) > > **400 - Invalid Date Format** `object` > > Start time must be a valid ISO date-time string. > > ```json theme={null} > { > "status": "error", > "message": "Start time must be a valid date-time format" > } > ``` > > **400 - Invalid Webhook URL** `object` > > Webhook URL format is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Webhook must be a valid URI" > } > ``` > > **400 - Invalid From Number Format** `object` > > From number doesn't match phone number pattern. > > ```json theme={null} > { > "status": "error", > "message": "Invalid from number format" > } > ``` > > **400 - Invalid Transfer Phone Format** `object` > > Transfer phone number format validation error. > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer phone number format" > } > ``` > > **400 - Invalid Transfer List Format** `object` > > Transfer list contains phone numbers with invalid format. > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number format in transfer list" > } > ``` > > **400 - Additional Properties Not Allowed** `object` > > Request contains fields that are not allowed in the schema. > > ```json theme={null} > { > "status": "error", > "message": "Additional properties are not allowed" > } > ``` > > **400 - Invalid Phone Number** `object` > > Phone number format is invalid, missing country code, or invalid length. > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number. Please include a country code if outside the US." > } > ``` > > **Other variations:** > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number. `+1234567890123456789` has these validation errors: [specific errors]" > } > ``` > > ```json theme={null} > { > "error": "Invalid phone number format" > } > ``` > > **Common causes:** > > * Phone number too long (>15 digits) or too short (\<7 digits) > * Invalid characters in phone number > * Missing country code for international numbers > * Phone number fails Twilio validation > > **400 - Invalid Transfer Number** `object` > > Transfer phone number is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer_phone_number." > } > ``` > > **400 - Invalid Language Code** `object` > > Language code is not supported. > > ```json theme={null} > { > "status": "error", > "message": "Invalid language code" > } > ``` > > **400 - Invalid Pronunciation Guide** `object` > > Pronunciation guide format is incorrect. > > ```json theme={null} > { > "status": "error", > "message": "Invalid pronunciation guide type." > } > ``` > > **400 - Platform Not Supported** `object` > > Feature not supported on the specified platform. > > ```json theme={null} > { > "status": "error", > "message": "Precall DTMF sequence is not supported for this platform." > } > ``` > > **400 - Invalid From Number** `object` > > The 'from' number is invalid or not owned by your account. > > ```json theme={null} > { > "status": "error", > "message": "Invalid 'from' - must be a phone number string with 10 or 12 digits." > } > ``` > > **400 - DNC List Violation** `object` > > Attempting to call a number on the Do Not Call list. > > ```json theme={null} > { > "status": "DNC Error", > "message": "Number found in DNC list. You cannot dial sensitive numbers. More attempts will result in being blocked." > } > ``` > > **400 - Transfer List Validation** `object` > > Transfer list configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "Transfer list must be an object." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer phone number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Transfer phone number cannot be the same as the phone number." > } > ``` > > **400 - Retry Parameter Validation** `object` > > Retry configuration must be an object. > > ```json theme={null} > { > "status": "error", > "message": "Retry must be an object." > } > ``` > > **400 - Version Number Validation** `object` > > Version number must be a valid number. > > ```json theme={null} > { > "status": "error", > "message": "version_number must be a number." > } > ``` > > **400 - Pathway Version Validation** `object` > > Pathway version must be a number or specific string value. > > ```json theme={null} > { > "status": "error", > "message": "pathway_version needs to either be a number, or a string of 'production' or 'staging'." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "version_number must be a number or string." > } > ``` > > **400 - From Phone Number Validation** `object` > > The 'from' number format is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Invalid from phone number." > } > ``` > > **400 - Boolean Parameter Validation** `object` > > Boolean parameters must be true/false or string equivalents. > > ```json theme={null} > { > "status": "error", > "message": "wait_for_greeting must be a boolean." > } > ``` > > **Valid for parameters**: `wait_for_greeting`, `record`, `answered_by_enabled`, `block_interruptions`, `sensitive_voicemail_detection`, `ignore_button_press` > > **400 - First Sentence Validation** `object` > > First sentence must be a string. > > ```json theme={null} > { > "status": "error", > "message": "First sentence must be a string. type: [actual_type]" > } > ``` > > **400 - Voicemail Message Validation** `object` > > Voicemail message must be a string. > > ```json theme={null} > { > "status": "error", > "message": "Voicemail message must be a string. type: [actual_type]" > } > ``` > > **400 - Voicemail SMS Validation** `object` > > Voicemail SMS configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms must be an object. type: [actual_type]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms.message must be a string. type: [actual_type]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms.from must be a string. type: [actual_type]" > } > ``` > > **400 - Interruption Threshold Validation** `object` > > Interruption threshold must be a number. > > ```json theme={null} > { > "status": "error", > "message": "interruption_threshold must be a number." > } > ``` > > **400 - Webhook URL Validation** `object` > > Webhook URL must be a valid HTTPS URL. > > ```json theme={null} > { > "status": "error", > "message": "webhook must be a string that starts with https://." > } > ``` > > **400 - Request Data Validation** `object` > > Request data must be an object. > > ```json theme={null} > { > "status": "error", > "message": "request_data must be an object." > } > ``` > > **400 - Metadata Validation** `object` > > Metadata must be an object. > > ```json theme={null} > { > "status": "error", > "message": "metadata must be an object." > } > ``` > > **400 - Voice Parameter Validation** `object` > > Voice parameter must be a string. > > ```json theme={null} > { > "status": "error", > "message": "Voice must be a string." > } > ``` > > **400 - Voicemail Action Validation** `object` > > Voicemail action must be one of the allowed values. > > ```json theme={null} > { > "status": "error", > "message": "Invalid voicemail_action. Options are: [list_of_options]." > } > ``` > > **400 - Keywords Validation** `object` > > Keywords configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be an array of strings." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be strings." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords each must be less than 100 characters: [keyword]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be in the format 'string' or 'string:number'." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keyword boosts with a colon must have a valid integer for the boost rate." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "At most 20 keywords can be added." > } > ``` > > **400 - Timezone Validation** `object` > > Timezone validation errors. > > ```json theme={null} > { > "status": "error", > "message": "Timezone must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid timezone: [error_message]" > } > ``` > > **400 - Summary Prompt Validation** `object` > > Summary prompt validation errors. > > ```json theme={null} > { > "status": "error", > "message": "Summary prompt must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Summary prompt must be less than 2000 characters." > } > ``` > > **400 - Start Time Validation** `object` > > Start time scheduling validation errors. > > ```json theme={null} > { > "status": "error", > "message": "start_time must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid start_time." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Calls must be scheduled at least 5 minutes in advance, or more" > } > ``` > > **400 - Background Track Validation** `object` > > Background track validation errors. > > ```json theme={null} > { > "status": "error", > "message": "background_track must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid background_track option. Options are: [list_of_options]." > } > ``` > > **400 - Max Duration Validation** `object` > > Max duration validation errors. > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be a number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be a positive number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be at most 12 hours." > } > ``` > > **400 - Invalid Dynamic Data** `object` > > Dynamic data or tools configuration is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Unable to parse dynamic data/tools." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid tools: [error_message]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid dynamic data: [error_message]" > } > ``` > > **400 - Invalid Pathway Data** `object` > > Pathway configuration is invalid or missing required components. > > ```json theme={null} > { > "status": "error", > "message": "Invalid pathway data - no blocks or links found for pathway {pathway_id}" > } > ``` > > **Other variations:** > > ```json theme={null} > { > "status": "error", > "message": "Invalid pathway data" > } > ``` > > **400 - Invalid Start Node ID** `object` > > The specified start node ID does not exist in the pathway. > > ```json theme={null} > { > "status": "error", > "message": "Invalid start node ID: {start_node_id}" > } > ``` > > **400 - Content Flagged** `object` > > Content failed moderation and was flagged as inappropriate. > > ```json theme={null} > { > "status": "error", > "message": "Flagged Node: [flagged content]" > } > ``` > > **400 - Sensitive Number Protection** `object` > > Attempting to call emergency or sensitive numbers. > > ```json theme={null} > { > "status": "error", > "message": "Cannot dial sensitive numbers. More attempts will result in being blocked." > } > ``` > > **400 - Unable to Save Request** `object` > > Server unable to save the request body or call data. > > ```json theme={null} > { > "status": "error", > "message": "Unable to save request body." > } > ``` > > **400 - Unable to Queue Call** `object` > > Call could not be queued for processing. > > ```json theme={null} > { > "status": "error", > "message": "Unable to queue call." > } > ``` > > **400 - Warm Transfer Parent Call Completed** `object` > > Parent call for warm transfer has already completed or doesn't exist. > > ```json theme={null} > { > "status": "error", > "message": "Parent call has completed or does not exist. Warm Transfer Request Cancelled" > } > ``` > > **500 - Internal Server Errors** `object` > > General server errors and catch-all error handlers. > > ```json theme={null} > { > "status": "error", > "message": "Internal server error during flagging process" > } > ``` > > **Typical scenarios**: > > * Uncaught exceptions in call processing > * Third-party service failures > * Memory allocation or resource exhaustion errors > * Network connectivity issues > > **400 - Call Parameters Validation** `object` > > Basic call parameters validation from the main validation function. > > ```json theme={null} > { > "status": "error", > "message": "Call parameters must be an object." > } > ``` > > ### Business Logic Errors > > **402 - No Billing Record** `object` > > No billing record found for your account. > > ```json theme={null} > { > "status": "error", > "message": "No billing record found." > } > ``` > > **402 - Insufficient Balance** `object` > > Account balance is insufficient for the call. > > ```json theme={null} > { > "status": "error", > "message": "Insufficient balance." > } > ``` > > **404 - Pathway Not Found** `object` > > The specified pathway ID does not exist or is not accessible. > > ```json theme={null} > { > "status": "error", > "message": "Pathway with ID \"{pathway_id}\" not found" > } > ``` > > **404 - Pathway Version Not Found** `object` > > The specified pathway version does not exist. > > ```json theme={null} > { > "status": "error", > "message": "Pathway version with ID \"{version_number}\" not found" > } > ``` > > **418 - Invalid Objective** `object` > > The objective parameter failed validation (returns validation details). > > ```json theme={null} > { > "error": "OBJECTIVE_VALIDATION_ERROR", > "details": "Custom validation response" > } > ``` > > ### Service Errors (HTTP 500) > > **500 - Twilio Connection Error** `object` > > Failed to establish connection with Twilio services. > > ```json theme={null} > { > "status": "error", > "message": "Error in creating Twilio connection." > } > ``` > > **500 - Invalid Encrypted Key** `object` > > The encrypted key provided is invalid or corrupted. > > ```json theme={null} > { > "status": "error", > "message": "Invalid `encrypted_key`. Please use the correct key for your account." > } > ``` > > **500 - Internal Server Error** `object` > > General internal server error during call processing. > > ```json theme={null} > { > "status": "error", > "message": "Error triggering call. Please check your twilio account for errors" > } > ``` > > **500 - Content Moderation Error** `object` > > Error occurred during the content flagging process. > > ```json theme={null} > { > "status": "error", > "message": "Internal server error during flagging process" > } > ``` > > **500 - BYOT Number Error** `object` > > Error retrieving Bring Your Own Twilio (BYOT) phone number. > > ```json theme={null} > { > "status": "error", > "message": "Error in getting BYOT Number" > } > ``` > > **500 - Dialer Data Error** `object` > > Error retrieving dialer data from encrypted key. > > ```json theme={null} > { > "status": "error", > "message": "Error in getting dialer data from encrypted key" > } > ``` > > **500 - User Data Fetch Error** `object` > > Error fetching user data for account verification. > > ```json theme={null} > { > "status": "error", > "message": "Error in fetching user data" > } > ``` > > **Other variations:** > > ```json theme={null} > { > "status": "error", > "message": "Error in fetching parent user data" > } > ``` > > **500 - Retry Call Error** `object` > > Missing retry attempt information for retry calls. > > ```json theme={null} > { > "status": "error", > "message": "Retry attempt not provided for retry call: {call_id}" > } > ``` *** Docs for agents: [llms.txt](/llms.txt) # Stop All Active Calls Source: https://docs.bland.ai/api-v1/post/calls-active-stop POST https://us.api.bland.ai/v1/calls/active/stop End all active phone calls on your account. ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **status** `string` Can be `success` or `error`. **message** `string` If the status is `success`, the message will say "Call ended successfully." Otherwise, if the status is `error`, the message will say "SID not found for the given c\_id." or "Internal server error." **num\_calls** `integer` The number of active calls that will be cancelled. ```json theme={null} { "status": "success", "message": "Stopping active calls. This may take some time...", "num_calls": 12 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Transfer Active Call Source: https://docs.bland.ai/api-v1/post/calls-active-transfer POST https://api.bland.ai/v1/calls/active/transfer Transfer an in-progress call to a different phone number. ## Overview Transfers an active call to a different phone number while the call is in progress. The current call leg is replaced with a `` to the new number, no announcement is played to either party. Only calls in `queue_status: "started"` are eligible. Once transferred, the call record's `transferred_to` field is updated so the new number appears in call details. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **call\_id** `string` *required* ID of the active call to transfer. Must currently be in progress. **transfer\_number** `string` *required* Destination phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format (for example `+12223334444`). Parsed against the US region by default, so 10-digit US numbers also work. *** ## Response **data.message** `string` Confirmation message including the `call_id` and the destination number. **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "message": "Call 29f01d00-5197-4b83-bc0f-161e14533a78 transferred to +12223334444 successfully" }, "errors": null } ``` ```json Validation Error theme={null} { "data": null, "errors": [ { "error": "VALIDATION_ERROR", "message": "Call ID is required" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Call with id 29f01d00-5197-4b83-bc0f-161e14533a78 not found or has already been completed." } ] } ``` ```json Forbidden theme={null} { "data": null, "errors": [ { "error": "FORBIDDEN", "message": "Transfer blocked by international restrictions for your account type." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Call with an Agent Source: https://docs.bland.ai/api-v1/post/calls-agent POST https://api.bland.ai/v1/calls Place an outbound call with one of your agents. ## Overview Send an AI phone call with one of your agents. The agent's published version supplies the conversation, its prompt, scenarios, nodes and tools, so this request names the agent and sets anything you want to override for this one call. > [!NOTE] > > International calls need a completed purchase: buy at least \$5 of credits in the [dashboard](https://app.bland.ai/dashboard/pay) under Billing, or turn on auto-recharge. Numbers on the [Agent Phone Plan](/platform/agent-phone-plan) call the US and Canada only, regardless of your credit balance. Every setting below is optional and falls back to the agent's own configuration. A value you send always wins over the agent's. *** ## Headers **authorization** `string` *required* Your API key for authentication. Send it as `Bearer YOUR_API_KEY`. A bare `Authorization: YOUR_API_KEY` with no prefix is also accepted, so older examples keep working. `x-api-key` is not read and does not authenticate. Get a key from the [dashboard](https://app.bland.ai/dashboard/settings). An autonomous agent with no dashboard session can mint its own with the [Agent onboarding API](/platform/connect-your-agent). **encrypted\_key** `string` A special key for using a BYOT (Bring Your Own Twilio) account. Only required for sending calls from your own Twilio account. Learn more about BYOT [here](/tutorials/custom-twilio). *** ## Body Parameters ### Basic Parameters **phone\_number** `string` *required* The phone number to call. Must be a valid phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. **voice** `string` (default: Karen) The voice of the AI agent to use. Accepts any form of voice ID, including custom voice clones and voice presets. If you omit it, the call uses Karen. Default voices can be referenced directly by their name instead of an id. Usage example: voice: "Karen" For Bland's recommended voices, call [List voices](/api-v1/get/voices) and pick voices tagged `"Bland Curated"` whose `service` is `BTTS_V3`. **agent\_id** `string` *required* The agent to call, as a UUID from [List Agents](/api-v2/get/agents). The agent's published version supplies the prompt, scenarios, nodes and tools that run the conversation. Cannot be combined with `pathway_id` or `persona_id`. Sending more than one is rejected with `AGENT_PARAM_CONFLICT`, a value that is not a UUID with `AGENT_ID_INVALID`, and an agent your organization does not own with `AGENT_NOT_FOUND`. **agent\_version** `string` (default: production) Which version of the agent runs the call. Omit it and the call runs the version pinned to production. Requires `agent_id`, and must be a string: a bare number is rejected. > [accordion] Accepted values > > | Value | Runs | > | - | - | > | `"production"` | The version pinned to production. The default. | > | `"staging"` | The version pinned to staging. | > | `"dev"` or `"latest"` | The newest saved version, published or not. | > | `"1.2.0"` | That exact version, by semver. | > | `"branch:my-branch"` | The head of an open branch. The name is 1 to 64 characters of letters, digits, underscore, dot or hyphen. | > > A string in none of these forms is rejected before the call is placed, with a message naming the accepted forms. A semver or a branch selector runs the call as the dev environment, so `{{env.KEY}}` references resolve against dev's values. The two environment labels run as themselves. The agent's own tools always drive the call, so the call-level `tools` parameter is rejected for agent calls. An environment with no pinned version returns `AGENT_ENV_UNPINNED`. A missing version or branch returns `AGENT_VERSION_NOT_FOUND` or `AGENT_BRANCH_NOT_FOUND`. > [!NOTE] > > Only calls that omit `agent_version` are eligible for [experiments](/api-v2/post/agents-id-experiments). Any explicit selector bypasses assignment, including `"production"`, and is never attributed to a variant. ### Model Parameters **language** `string` (default: en) Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings. > [accordion] Expand to view language options > > The available language options are as follows: > > * `babel` - Babel (All Languages) - Experimental1 > * `fluent` - Fluent (Multilingual)2 > * `en` - English > * `babel-en` - English (Babel) > * `en-US` - English (US) > * `en-GB` - English (UK) > * `en-AU` - English (Australia) > * `en-NZ` - English (New Zealand) > * `en-IN` - English (India) > * `es` - Spanish > * `babel-es` - Spanish (Babel) > * `es-419` - Spanish (Latin America) > * `fr` - French > * `babel-fr` - French (Babel) > * `fr-CA` - French (Canada) > * `de` - German > * `babel-de` - German (Babel) > * `el` - Greek > * `hi` - Hindi > * `hi-Latn` - Hindi (Latin script) > * `hu` - Hungarian > * `ja` - Japanese > * `ko` - Korean > * `ko-KR` - Korean (Korea) > * `vi` - Vietnamese > * `pt` - Portuguese > * `pt-BR` - Portuguese (Brazil) > * `pt-PT` - Portuguese (Portugal) > * `zh` - Chinese (Mandarin, Simplified) > * `zh-CN` - Chinese (Mandarin, Simplified, China) > * `zh-Hans` - Chinese (Mandarin, Simplified, Hans) > * `zh-TW` - Chinese (Mandarin, Traditional) > * `zh-Hant` - Chinese (Mandarin, Traditional, Hant) > * `it` - Italian > * `nl` - Dutch > * `pl` - Polish > * `ru` - Russian > * `sv` - Swedish > * `sv-SE` - Swedish (Sweden) > * `da` - Danish > * `da-DK` - Danish (Denmark) > * `fi` - Finnish > * `no` - Norwegian > * `id` - Indonesian > * `ms` - Malay > * `tr` - Turkish > * `uk` - Ukrainian > * `bg` - Bulgarian > * `cs` - Czech > * `ro` - Romanian > * `sk` - Slovak > * `auto` - Auto Detect (English & Spanish) > > 1 The Bland Babel Transcription Engine (BETA) is our new proprietary transcription engine! Babel can handle multilingual conversations by identifying and switching languages on the fly. It's now in beta and available under the "babel" language mode. **Note: prompt your agent to respond in the language it is spoken to.** > > 2 The `fluent` mode is a multilingual option that auto-detects the spoken language and switches between languages on the fly, powered by a multilingual transcription model. **Note: prompt your agent to respond in the language it is spoken to.** **wait\_for\_greeting** `boolean` (default: false) By default, the agent starts talking as soon as the call connects. When wait\_for\_greeting is set to true, the agent will wait for the call recipient to speak first before responding. **pronunciation\_guide** `array` The pronunciation guide is an `array` of `objects` that guides the agent on how to say specific words. Use this to improve clarity for acronyms, names, brand terms, or jargon. ```json theme={null} [ { "word": "example", "pronunciation": "ex-am-ple", "case_sensitive": "false", "spaced": "false" }, { "word": "API", "pronunciation": "A P I", "case_sensitive": "true", "spaced": "true" } ] ``` > [accordion] Object Parameters > > * `word`: the word you want to guide the LLM on how to pronounce > * `pronunciation`: how the AI should pronounce the word, using syllables or space-separated characters. For example, `"A P I"` ensures each letter is spoken clearly rather than read as a word. > * `case_sensitive`: whether or not to consider case. Particularly useful with names. EG: 'Max' the name versus 'max' the word. Defaults to false. `Not required`. > * `spaced`: whether to match whole words only. When true, "high" will match "high" but not "hightop". When false, it will match any word that contains "high". Defaults to true. `Not required`. **temperature** `float` (default: 0.7) A value between 0 and 1 that controls the randomness of the LLM. 0 will cause more deterministic outputs while 1 will cause more random. Example Values: "0.9", "0.3", "0.5" **interruption\_threshold** `number` (default: 500) Adjusts how patient the AI is when waiting for the user to finish speaking. Lower values mean the AI will respond more quickly, while higher values mean the AI will wait longer before responding. **interruptibility** `integer` (default: 2) Controls how readily the AI stops speaking when the caller talks over it. A higher value yields more easily; a lower value holds the turn through more of the caller's speech. * `0`: Block. The AI ignores interruptions and finishes speaking (same as `block_interruptions: true`). * `1`: Difficult. Harder to interrupt. * `2`: Balanced (default). * `3`: Easy. The AI stops quickly when the caller begins speaking. ### Dispatch Parameters **from** `string` Specify a phone number to call from that you own or have uploaded from your Twilio account. Country code is required, spaces or parentheses must be excluded. By default, calls are initiated from a separate pool of numbers owned by Bland. If you are using your own twilio numbers, you must specify a matching encrypted\_key in the create call request headers. **dialing\_strategy** `object` Controls how the caller number (`from`) is selected when placing an outbound call. Use this field to influence how the system chooses a number that appears local or relevant to the callee, improving pickup rates. There are two supported strategies: #### 1. `local` Automatically selects a `from` number that matches the callee's area code for **US-based calls**. You must have purchased a local dialing add-on in the [add-ons section](https://app.bland.ai/dashboard/add-ons). Example: ```json theme={null} { "dialing_strategy": { "type": "local" } } ``` #### 2. `custom_pooling` Selects a number from your own pre-configured pool of phone numbers. Designed for organizations that want full control over the caller IDs being used. This is an enterprise only feature, to use this feature contact your Bland representative or reach out to sales. Example: ```json theme={null} { "dialing_strategy": { "type": "custom_pooling", "pool_id": "bd039087-decb-435a-a6e3-ca1ffbf89974" } } ``` By default, Bland will choose a US-based number from our own pool of numbers. **timezone** `string` (default: America/Los\_Angeles) Set the timezone for the call. Handled automatically for calls in the US. This helps significantly with use cases that rely on appointment setting, scheduling, or behaving differently based on the time of day. Timezone options are here in the TZ identifier column. **start\_time** `string` The time you want the call to start. If you don't specify a time (or the time is in the past), the call will send immediately. Set your time in the format YYYY-MM-DD HH:MM:SS -HH:MM (ex. 2021-01-01 12:00:00 -05:00). The timezone is optional, and defaults to UTC if not specified. Note: Scheduled calls can be cancelled with the POST /v1/calls/:call\_id/stop endpoint. **transfer\_phone\_number** `string` A phone number that the agent can transfer to under specific conditions - such as being asked to speak to a human or supervisor. > [accordion] Prompting Notes > > For best results: > > * Specify conditions that the agent should transfer to a human under (examples are great!) > * In the agent's prompt, refer to the action solely as "transfer" or "transferring". > * Alternate phrasing such as "swap" or "switch" can mislead the agent, causing the action to be ignored. **transfer\_list** `object` Give your agent the ability to transfer calls to a set of phone numbers. Overrides transfer\_phone\_number if a transfer\_list.default is specified. Will default to transfer\_list.default, or the chosen phone number. Example usage to route calls to different departments: ```json theme={null} { "transfer_list": { "default": "+12223334444", "sales": "+12223334444", "support": "+12223334444", "billing": "+12223334444" } } ``` **max\_duration** `integer` (default: 30) When the call starts, a timer is set for the `max_duration` minutes. At the end of that timer, if the call is still active it will be automatically ended. Example Values: 20, 2 ### Audio Parameters **background\_track** `string` Select an audio track that you'd like to play in the background during the call. The audio will play continuously when the agent isn't speaking, and is incorporated into it's speech as well. Use this to provide a more natural, seamless, engaging experience for the conversation. We've found this creates a significantly smoother call experience by minimizing the stark differences between total silence and the agent's speech. Options: * null - Default, will play audible but quiet phone static. * office - Office-style soundscape. Includes faint typing, chatter, clicks, and other office sounds. * cafe - Cafe-like soundscape. Includes faint talking, clinking, and other cafe sounds. * restaurant - Similar to cafe, but more subtle. * none - Minimizes background noise **noise\_cancellation** `boolean` (default: true) Toggles noise filtering or suppression in the audio stream to filter out background noise. This parameter was previously documented as defaulting to `false`. The server has been applying `true` when the field is omitted, so send it explicitly whenever the behavior matters to you. **block\_interruptions** `boolean` (default: false) When set to `true`, the AI will not respond or process interruptions from the user. **record** `boolean` (default: false) To record your phone call, set `record` to true. When your call completes, you can access through the `recording_url` field in the call details or your webhook. ### Voicemail Parameters **ivr\_mode** `boolean` (default: false) Set to `true` when the number you are calling answers with a phone menu rather than a person. IVR mode changes two things. The agent stops responding on the conversational timing it uses with a human, so it does not talk over a menu's prompts or fill its pauses. And voicemail handling is suppressed: the effective voicemail action becomes `"ignore"` no matter what you passed, because a phone tree has no voicemail to leave a message on. Pair it with [`precall_dtmf_sequence`](#param-precall-dtmf-sequence) to play a fixed sequence of digits before the call starts, or leave the agent to navigate the menu from its own prompt. > [!NOTE] > > `amd` is a legacy alias for this parameter. It sets the same switch, and passing `ivr_mode: true` sets `amd` for you. Prefer `ivr_mode`: the name says what it does. **voicemail** `object` Configuration for handling voicemails during outbound calls. This object controls how the AI behaves when it encounters a voicemail, including whether to leave a message, send an SMS notification, or detect voicemails more intelligently using AI. It has the following parameters: * `message` (string): The message the AI will leave if a voicemail is detected. This message will be played after the beep, then the call will end. This field is required if `action` is set to `leave_message`. - `action` (enum): What the AI should do when it detects a voicemail. The default is `"hangup"`. Available options: * `"hangup"`: Immediately end the call without leaving a message. * `"leave_message"`: Play the `message` and then end the call. * `"leave_message_and_sms"`: Play the `message`, end the call, and send the SMS configured in `sms`. Supply both `message` and `sms`: with no `sms` config this falls back to `leave_message`. * `"ignore"`: Continue the call as if no voicemail was detected (used for IVRs or special routing). * `sms` (object): Optional. Configuration for sending an SMS notification when a voicemail is left. Contains: * `message` (string): Required. The body of the SMS message. Keep concise and clear. * `from` (string): Optional. The phone number to send the SMS from (must be a number you own and have SMS permissions for). The destination is resolved by Bland rather than set on the request. There is no `to` field, and passing one has no effect. - `sensitive` (boolean): When `true`, uses LLM-based analysis to detect frequent voicemails. The default is `false`. > [!NOTE] > > The effective action is derived from the whole request, not from `action` alone. Supplying a `message` implies leaving one, so `"action": "hangup"` sent alongside a `message` leaves the message. And [`ivr_mode`](/api-v1/post/calls#param-ivr-mode) forces `ignore` regardless of `action`, since a phone menu has no voicemail. See [Voicemail](/platform/agent-call-recipes#voicemail) for the full precedence. Example: ```json theme={null} { "voicemail": { "message": "Hi, just calling to follow up. Please call us back when you can.", "action": "leave_message", "sms": { "from": "+18005550678", "message": "We just left you a voicemail. Call us back anytime!" }, "sensitive": true } } ``` ### Analysis Parameters **stream\_post\_transfer\_transcript** `boolean` (default: false) When `true` and the call is transferred to a human, Bland transcribes the conversation after the transfer live and streams it over the [Post-Transfer Transcript Stream](/api-v1/post/calls-id-transcript-stream) WebSocket while the transferred conversation is happening. Works for both cold and warm transfers. This option controls the live stream only. To receive the post-transfer transcript in the post-call webhook, subscribe with `"post_transfer_transcript"` in `webhook_events`. The two are independent: you can use either one or both. > [!NOTE] > > This feature is in limited rollout. If it is not enabled for your organization, the option has no effect. **post\_call\_evals** `object` Attach an [evals workbench](/agents/evaluations#score-calls-after-they-end) to this call. When the call completes, Bland automatically runs the workbench's eval configuration against the call, no separate eval-run submission needed. Provide at least one of: * `workbench_setup_id` (string): The workbench setup to attach. Bland pins the setup's current published version at call creation, so editing the workbench mid-call does not change what gets evaluated. * `workbench_setup_version_id` (string): An exact published workbench setup version to pin. Attaching evals requires the call to be recorded. If you set `record: false` alongside `post_call_evals`, the request is rejected; otherwise recording is enabled automatically. The post-call webhook acknowledges the attachment with `post_call_evals: { workbench_setup_id, workbench_setup_version_id, status: "pending" }`. Eval scores arrive later on a separate `evals` webhook event once the run completes. Example: ```json theme={null} { "post_call_evals": { "workbench_setup_id": "b7c2e1d4-8f3a-4c9e-9a2b-1e5f6d7c8a9b" } } ``` ### Post Call Parameters **summary\_prompt** `string` (Optional) Custom instructions for how the call summary should be generated after the call completes. Use this to provide specific guidance or context for the AI when writing the post-call summary. Maximum length: 2000 characters. Example: ```json theme={null} { "summary_prompt": "Summarize the call in 2-3 sentences, focusing on the customer's main concern and any next steps discussed." } ``` **retry** `object` If the call goes to voicemail, you can set up the call to retry, after a configurable delay. You can also update the voicemail\_action, and voicemail\_message in the retry object, for the re-tried call. Takes in the following parameters: * `wait` (integer): The delay in seconds before the call is retried. * `voicemail_action` (enum): The action to take when the call goes to voicemail. Options: `hangup`, `leave_message`, `leave_message_and_sms`, `ignore`. * `voicemail_message` (string): The message to leave when the call goes to voicemail. Example: ```json theme={null} { "retry": { "wait": 10, "voicemail_action": "leave_message", "voicemail_message": "Hello, this is a test message." } } ``` ### Advanced Parameters **request\_data** `object` Custom key-value data you send with the call. The runtime interpolates these as `{{variable}}` inside the agent's prompt, scenarios, nodes and tools. This is separate from the agent's environment variables, which are written as `{{env.KEY}}` and resolve from the environment the call runs as. A referenced environment key with no value fails the call with `AGENT_VARIABLE_UNRESOLVED`. ```json theme={null} { "agent_id": "41282230-dd13-4546-8785-0afa19b708c0", "phone_number": "+15551234567", "request_data": { "name": "John Doe" } } ``` An agent whose greeting reads `Hello, {{name}}` then opens with "Hello, John". **metadata** `object` Add any additional information you want to associate with the call. This data is accessible for all calls, regardless of if they are picked up or not. This can be used to track calls or add custom data to the call. Anything that you put here will be returned in the post call webhook under metadata. Example: ```json theme={null} { "metadata": { "campaign_id": "1234", "source": "web" } } ``` **external\_id** `string` Your own identifier for the call, such as a CRM interaction ID or a contact center session ID. Use it to look the call up later without storing Bland's `call_id`. Must be a non-empty string of at most 256 printable characters. The call is returned in [Call details](/api-v1/get/calls-id), [List calls](/api-v1/get/calls), and the post-call webhook with this `external_id`. ```json theme={null} { "external_id": "crm-interaction-48213" } ``` **webhook** `string` When the call ends, call information is sent to this webhook URL. **webhook\_events** `array` Specify which events you want to stream to the webhook, during the call. > [!NOTE] > > **Citation Webhook Requirements:** > > * Include `citations` for any citation webhooks (sent separately after call completion) > * For delayed post-call webhooks with citations, you need `citations` + dashboard delay toggle enabled > > See the [Citations documentation](/enterprise-features/citations#webhook-integration-options) for complete setup instructions. Options: * `queue` * `call` * `latency` * `webhook` * `tool` * `dynamic_data` * `citations` (Required for any citation webhooks) * `evals` (Eval scores from an attached [evals workbench](/agents/evaluations#score-calls-after-they-end), sent as a separate webhook when the run completes) * `post_transfer_transcript` (Adds the post-transfer conversation to the post-call webhook when the call is transferred to a human; see [Post-transfer transcript](/tutorials/post-call-webhooks#post-transfer-transcript). Requires call recording: `record` is enabled automatically when unset, and passing `record: false` alongside this subscription returns a 400. In limited rollout: if not enabled for your organization, the subscription has no effect.) Example payloads: ```json queue theme={null} // ex 1 { "message": "Call enqueued", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "queue", "log_level": "info" } ``` ```json call theme={null} // ex 1 { "message": "Call connected", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 2 { "message": "Sending first sentence: Hello, thank you for reaching out. I'd like to get to know you a bit better. How are you feeling today?", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 3 { "message": "Agent speech: Hello, thank you for reaching out.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 4 { "message": "Handling user speech: Yeah. I'm thirty six. And I'm five foot nine.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 5 { "message": "Webhook Response: 200 | Webhook Response Data: [object Object] | Response Time: 689ms", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json latency theme={null} // ex 1 { "message": "TTS: 218ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } // ex 2 { "message": "LLM: 266ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } ``` ```json webhook theme={null} { "message": "Storing dynamic data messages: \n\n answer : \"true\"", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json tool theme={null} { "message": "Executing custom tool: Test Tool 4 with input: [object Object]", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json dynamic_data theme={null} { "message": "Storing dynamic data: \n\n vector_data : {\"data\":{\"results\":[{\"id\":\"fedcba98-7654-3210-fedc-ba9876543210\",\"input_text\":\"Here are details on the restaurant...\",\"similarity\":0.103339002763233,\"chunk_index\":0}]},\"errors\":null}", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json citations theme={null} { "call_id": "12345678-1234-1234-1234-123456789abc", "user_id": "11111111-2222-3333-4444-555555555555", "event_type": "citations", "timestamp": "2025-07-03T16:41:15.231Z", "citations": [ { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "User height", "variable_type": "boolean", "value": true, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller Age", "variable_type": "number", "value": 36, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" }, { "id": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff", "idx": 4, "start_time": 30.56, "end_time": 35.455, "confidence": 0.5672727272727273, "channel": 0, "transcript": "All right. So you're 36 years old and five foot nine. That's great. How's your day been so far? Anything exciting happened?", "speaker_id": "SPEAKER_0_0", "speaker_name": null, "speaker_description": null, "topics": [ "day_review_inquiry" ], "topics_meta": "{\"day_review_inquiry\":\"agent inquiring about the customer's day and any exciting events\"}", "utterance_type": "question" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller feeling", "variable_type": "string", "value": null, "cited_utterances": [], "schema_id": "99999999-8888-7777-6666-555555555555" } ] } ``` **dynamic\_data** `object[]` Integrate data from external APIs into your agent's knowledge. Set to `null` or an empty string to clear dynamic data settings. ```json theme={null} "dynamic_data": [ { "url": "endpoint", "method": "GET", "body": [], "headers": [ { "key": "Content-Type", "value": "application/json" } ], "query": [], "cache": true, "response_data": [ { "context": "", "data": "$", "name": "" } ] } ], ``` **keywords** `string[]` (default: \[]) These words will be boosted in the transcription engine - recommended for proper nouns or words that are frequently mis-transcribed. For example, if the word Blandy is frequently transcribed as a homonym like "Reese" you could do this: ```json theme={null} { "keywords": ["Blandy"] } ``` For stronger keyword boosts, you can place a colon then a boost factor after the word. The default boost factor is 2. ```json theme={null} { "keywords": ["Blandy:3"] } ``` **ignore\_button\_press** `boolean` (default: false) When `true`, the system will ignore DTMF input (Dual-Tone Multi-Frequency), the tones generated when a user presses keys on their phone keypad (e.g., 0-9, \*, #).\ This disables any in-call actions triggered by keypad input, such as menu navigation or transfers.\ Useful when your agent should handle the entire call conversationally, without responding to button presses. **precall\_dtmf\_sequence** `string` A sequence of DTMF digits that will be played before the call starts. Acceptable characters are 0-9, \*, #, and w, where w is a pause of 0.5 seconds. Only available on calls that leave over Twilio, and rejected with a 400 on any other platform. Example: ```json theme={null} { "precall_dtmf_sequence": "1234567890*#w" } ``` **guard\_rails** `array` Configure guard rails to monitor the call for compliance violations and trigger actions automatically. Guard rails continuously analyze AI and user responses during the call. Learn more about guard rails in the [Guard Rails documentation](/tutorials/guard-rails). Each item in the array can be one of three types: > [accordion] TCPA Guard Rails > > * `tcpa:ai_disclosure` - AI must disclose it's an AI > * `tcpa:self_introduction` - Must identify who is calling > * `tcpa:recording_disclosure` - Must disclose the call is being recorded > * `tcpa:opt_out` - This out-of-the-box guard rail is different as it's not time-based and instead monitors the entire conversation to see if the agent continues to engage in the conversation after the user opts out. `config.end_seconds` is not needed for this type. > > ```json theme={null} > { > "type": "tcpa:ai_disclosure", > "actions": [ > { "type": "end_call" } > ], > "config": { > "end_seconds": 30 > } > } > ``` > > | Field | Type | Description | > | - | - | - | > | `type` | string | One of: `tcpa:ai_disclosure`, `tcpa:self_introduction`, `tcpa:recording_disclosure` | > | `actions` | array | Actions to take if disclosure is NOT made within the time window | > | `config.end_seconds` | number | Time window in seconds (default: 30) | > [accordion] Custom Guard Rails (Enterprise) > > Custom guard rails with your own prompt. Enterprise customers can create up to 5 custom guard rails. > > ```json theme={null} > { > "type": "custom", > "prompt": "Flag if the agent provides any medical advice or diagnosis...", > "actions": [ > { "type": "transfer", "config": { "phone_number": "+15551234567" } } > ] > } > ``` > > | Field | Type | Description | > | - | - | - | > | `type` | string | `custom` | > | `prompt` | string | Your custom detection prompt | > | `actions` | array | Actions to take when the guard rail triggers | > [accordion] Action Types > > Each guard rail requires an `actions` array. Available action types: > > | Action Type | Description | Config | > | - | - | - | > | `end_call` | Immediately terminate the call | None | > | `transfer` | Transfer to a human agent | `{ "phone_number": "+15551234567" }` | > | `move_to_node` | Jump to a specific node in the agent | `{ "node_id": "node-uuid" }` | **Full example with multiple guard rails:** ```json theme={null} { "guard_rails": [ { "type": "tcpa:ai_disclosure", "actions": [{ "type": "end_call" }], "config": { "end_seconds": 30 } }, { "type": "tcpa:opt_out", "actions": [{ "type": "end_call" }] }, { "type": "custom", "prompt": "Flag if the agent makes any investment recommendations", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ] } ``` ## Response **status** `string` Can be `success` or `error`. **message** `string` A message explaining the status of the call. **call\_id** `string` A unique identifier for the call (present only if status is `success`). **batch\_id** `string` The batch ID of the call (present only if status is `success`). **errors** `array` For validation errors, a detailed list of each field with an error and it's error message. Example: ```json theme={null} { "status": "error", "message": "Invalid parameters", "errors": [ "Missing required parameter: phone_number.", "Phone number must be a string or number." ] } ``` ```json theme={null} { "status": "success", "message": "Call successfully queued.", "call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1", "batch_id": null } ``` *** ## Error Codes Reference > [accordion] View All Error Codes > > This section documents all possible error codes and HTTP status codes you can receive when making a POST request to `/v1/calls`. > > ### Authentication & Authorization Errors > > **400 - Agent Parameter Conflict** `object` > > `agent_id` was sent alongside `pathway_id` or `persona_id`. > > ```json theme={null} > { > "status": "error", > "code": "AGENT_PARAM_CONFLICT", > "message": "agent_id cannot be combined with pathway_id or persona_id" > } > ``` > > **400 - Agent Version Invalid** `object` > > `agent_version` was not a semantic version, a `branch:`, or one of the four labels. It must be a string; a bare number is rejected. > > ```json theme={null} > { > "status": "error", > "message": "Invalid parameters. Error: [\n \"agent_version must be a semantic version like '1.2.0', 'branch:', or one of 'dev', 'latest', 'staging', 'production'.\"\n]" > } > ``` > > **400 - Agent Environment Unpinned** `object` > > The environment named by `agent_version` has no version pinned to it. > > ```json theme={null} > { > "status": "error", > "code": "AGENT_ENV_UNPINNED", > "message": "Environment has no pinned version" > } > ``` > > **400 - Agent Not Found** `object` > > No agent in your organization matches `agent_id`. A malformed id returns `AGENT_ID_INVALID` instead, and a missing version or branch returns `AGENT_VERSION_NOT_FOUND` or `AGENT_BRANCH_NOT_FOUND`. > > ```json theme={null} > { > "status": "error", > "code": "AGENT_NOT_FOUND", > "message": "Agent not found" > } > ``` > > **401 - AUTH\_FAILURE** `object` > > Authentication failed due to missing or invalid API key. > > ```json theme={null} > { > "data": null, > "errors": [ > { > "error": "AUTH_FAILURE", > "message": "Unauthorized" > } > ] > } > ``` > > **Common causes:** > > * Missing Authorization header > * Invalid API key > * Expired API key > > **403 - Account Flagged** `object` > > Account has been flagged or banned for security purposes. > > ```json theme={null} > { > "status": "error", > "message": "The Bland Team has flagged your account for security purposes. As a precautionary measure against recent heightened malicious use cases, we have flagged your account for review and temporarily blocked from dispatching calls. If you need to be unblocked urgently, please email us at support@bland.ai with your account phone number." > } > ``` > > **429 - Call Frequency Limit** `object` > > Calls sent too frequently to the same number. > > ```json theme={null} > { > "status": "error", > "message": "Calls can only be sent every 10 seconds to the same number. Please try again in a few seconds." > } > ``` > > **429 - General Rate Limit** `object` > > Rate limit exceeded for your account. > > ```json theme={null} > { > "status": "error", > "message": "Rate limit exceeded" > } > ``` > > **429 - Blacklisted Number** `object` > > Attempting to call a blacklisted number. > > ```json theme={null} > { > "status": "error", > "message": "This number is blacklisted." > } > ``` > > **429 - New Customer Rate Limit** `object` > > Rate limits for newly created accounts. > > ```json theme={null} > { > "status": "error", > "message": "Rate limit exceeded for newly created accounts. Please try again soon." > } > ``` > > **429 - International Rate Limit** `object` > > International calling rate limit exceeded. > > ```json theme={null} > { > "status": "error", > "message": "International rate limit exceeded for your account type." > } > ``` > > **400 - Missing Required Parameter** `object` > > Required parameters are missing from the request. > > ```json theme={null} > { > "status": "error", > "message": "Invalid parameters. Error: [\"Missing required parameter: phone_number.\"]", > "errors": ["Missing required parameter: phone_number."] > } > ``` > > **Required parameters:** > > * `phone_number` (always required) > * `agent_id` (names the agent that makes the call) > > **400 - Invalid Field Types** `object` > > Field values are the wrong data type according to TypeBox validation. > > ```json theme={null} > { > "status": "error", > "message": "Record must be a boolean" > } > ``` > > **Common type validation errors:** > > * `"Record must be a boolean"` > * `"Max duration must be a number"` > * `"Temperature must be a number"` > * `"Dynamic data must be an array"` > * `"Metadata must be a record of string keys and any values"` > > **400 - Invalid Voicemail Action** `object` > > Voicemail action must be one of the allowed values. > > ```json theme={null} > { > "status": "error", > "message": "Invalid voicemail action. Must be one of: hangup, leave_message, leave_message_and_sms, ignore" > } > ``` > > **400 - Number Range Validation** `object` > > Numeric values are outside their allowed ranges. > > ```json theme={null} > { > "status": "error", > "message": "Max duration must be at least 1" > } > ``` > > **400 - Invalid DTMF Sequence** `object` > > Precall DTMF sequence contains invalid characters. > > ```json theme={null} > { > "status": "error", > "message": "Precall DTMF sequence must be a valid DTMF sequence" > } > ``` > > **Valid DTMF characters:** 0-9, \*, #, w (wait) > > **400 - Invalid Date Format** `object` > > Start time must be a valid ISO date-time string. > > ```json theme={null} > { > "status": "error", > "message": "Start time must be a valid date-time format" > } > ``` > > **400 - Invalid Webhook URL** `object` > > Webhook URL format is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Webhook must be a valid URI" > } > ``` > > **400 - Invalid From Number Format** `object` > > From number doesn't match phone number pattern. > > ```json theme={null} > { > "status": "error", > "message": "Invalid from number format" > } > ``` > > **400 - Invalid Transfer Phone Format** `object` > > Transfer phone number format validation error. > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer phone number format" > } > ``` > > **400 - Invalid Transfer List Format** `object` > > Transfer list contains phone numbers with invalid format. > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number format in transfer list" > } > ``` > > **400 - Additional Properties Not Allowed** `object` > > Request contains fields that are not allowed in the schema. > > ```json theme={null} > { > "status": "error", > "message": "Additional properties are not allowed" > } > ``` > > **400 - Invalid Phone Number** `object` > > Phone number format is invalid, missing country code, or invalid length. > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number. Please include a country code if outside the US." > } > ``` > > **Other variations:** > > ```json theme={null} > { > "status": "error", > "message": "Invalid phone number. `+1234567890123456789` has these validation errors: [specific errors]" > } > ``` > > ```json theme={null} > { > "error": "Invalid phone number format" > } > ``` > > **Common causes:** > > * Phone number too long (>15 digits) or too short (\<7 digits) > * Invalid characters in phone number > * Missing country code for international numbers > * Phone number fails Twilio validation > > **400 - Invalid Language Code** `object` > > Language code is not supported. > > ```json theme={null} > { > "status": "error", > "message": "Invalid language code" > } > ``` > > **400 - Invalid Pronunciation Guide** `object` > > Pronunciation guide format is incorrect. > > ```json theme={null} > { > "status": "error", > "message": "Invalid pronunciation guide type." > } > ``` > > **400 - Platform Not Supported** `object` > > Feature not supported on the specified platform. > > ```json theme={null} > { > "status": "error", > "message": "Precall DTMF sequence is not supported for this platform." > } > ``` > > **400 - Invalid From Number** `object` > > The 'from' number is invalid or not owned by your account. > > ```json theme={null} > { > "status": "error", > "message": "Invalid 'from' - must be a phone number string with 10 or 12 digits." > } > ``` > > **400 - DNC List Violation** `object` > > Attempting to call a number on the Do Not Call list. > > ```json theme={null} > { > "status": "DNC Error", > "message": "Number found in DNC list. You cannot dial sensitive numbers. More attempts will result in being blocked." > } > ``` > > **400 - Transfer List Validation** `object` > > Transfer list configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "Transfer list must be an object." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer phone number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Transfer phone number cannot be the same as the phone number." > } > ``` > > **400 - Retry Parameter Validation** `object` > > Retry configuration must be an object. > > ```json theme={null} > { > "status": "error", > "message": "Retry must be an object." > } > ``` > > **400 - Version Number Validation** `object` > > Version number must be a valid number. > > ```json theme={null} > { > "status": "error", > "message": "version_number must be a number." > } > ``` > > **400 - From Phone Number Validation** `object` > > The 'from' number format is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Invalid from phone number." > } > ``` > > **400 - Boolean Parameter Validation** `object` > > Boolean parameters must be true/false or string equivalents. > > ```json theme={null} > { > "status": "error", > "message": "wait_for_greeting must be a boolean." > } > ``` > > **Valid for parameters**: `wait_for_greeting`, `record`, `answered_by_enabled`, `block_interruptions`, `sensitive_voicemail_detection`, `ignore_button_press` > > **400 - First Sentence Validation** `object` > > First sentence must be a string. > > ```json theme={null} > { > "status": "error", > "message": "First sentence must be a string. type: [actual_type]" > } > ``` > > **400 - Voicemail Message Validation** `object` > > Voicemail message must be a string. > > ```json theme={null} > { > "status": "error", > "message": "Voicemail message must be a string. type: [actual_type]" > } > ``` > > **400 - Voicemail SMS Validation** `object` > > Voicemail SMS configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms must be an object. type: [actual_type]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms.message must be a string. type: [actual_type]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "voicemail_sms.from must be a string. type: [actual_type]" > } > ``` > > **400 - Interruption Threshold Validation** `object` > > Interruption threshold must be a number. > > ```json theme={null} > { > "status": "error", > "message": "interruption_threshold must be a number." > } > ``` > > **400 - Webhook URL Validation** `object` > > Webhook URL must be a valid HTTPS URL. > > ```json theme={null} > { > "status": "error", > "message": "webhook must be a string that starts with https://." > } > ``` > > **400 - Request Data Validation** `object` > > Request data must be an object. > > ```json theme={null} > { > "status": "error", > "message": "request_data must be an object." > } > ``` > > **400 - Metadata Validation** `object` > > Metadata must be an object. > > ```json theme={null} > { > "status": "error", > "message": "metadata must be an object." > } > ``` > > **400 - Voice Parameter Validation** `object` > > Voice parameter must be a string. > > ```json theme={null} > { > "status": "error", > "message": "Voice must be a string." > } > ``` > > **400 - Voicemail Action Validation** `object` > > Voicemail action must be one of the allowed values. > > ```json theme={null} > { > "status": "error", > "message": "Invalid voicemail_action. Options are: [list_of_options]." > } > ``` > > **400 - Keywords Validation** `object` > > Keywords configuration errors. > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be an array of strings." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be strings." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords each must be less than 100 characters: [keyword]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keywords must be in the format 'string' or 'string:number'." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Keyword boosts with a colon must have a valid integer for the boost rate." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "At most 20 keywords can be added." > } > ``` > > **400 - Timezone Validation** `object` > > Timezone validation errors. > > ```json theme={null} > { > "status": "error", > "message": "Timezone must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid timezone: [error_message]" > } > ``` > > **400 - Summary Prompt Validation** `object` > > Summary prompt validation errors. > > ```json theme={null} > { > "status": "error", > "message": "Summary prompt must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Summary prompt must be less than 2000 characters." > } > ``` > > **400 - Start Time Validation** `object` > > Start time scheduling validation errors. > > ```json theme={null} > { > "status": "error", > "message": "start_time must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid start_time." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Calls must be scheduled at least 5 minutes in advance, or more" > } > ``` > > **400 - Background Track Validation** `object` > > Background track validation errors. > > ```json theme={null} > { > "status": "error", > "message": "background_track must be a string." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid background_track option. Options are: [list_of_options]." > } > ``` > > **400 - Max Duration Validation** `object` > > Max duration validation errors. > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be a number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be a positive number." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "max_duration must be at most 12 hours." > } > ``` > > **400 - Invalid Dynamic Data** `object` > > Dynamic data or tools configuration is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Unable to parse dynamic data/tools." > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid tools: [error_message]" > } > ``` > > ```json theme={null} > { > "status": "error", > "message": "Invalid dynamic data: [error_message]" > } > ``` > > **400 - Content Flagged** `object` > > Content failed moderation and was flagged as inappropriate. > > ```json theme={null} > { > "status": "error", > "message": "Flagged Node: [flagged content]" > } > ``` > > **400 - Sensitive Number Protection** `object` > > Attempting to call emergency or sensitive numbers. > > ```json theme={null} > { > "status": "error", > "message": "Cannot dial sensitive numbers. More attempts will result in being blocked." > } > ``` > > **400 - Unable to Save Request** `object` > > Server unable to save the request body or call data. > > ```json theme={null} > { > "status": "error", > "message": "Unable to save request body." > } > ``` > > **400 - Unable to Queue Call** `object` > > Call could not be queued for processing. > > ```json theme={null} > { > "status": "error", > "message": "Unable to queue call." > } > ``` > > **400 - Warm Transfer Parent Call Completed** `object` > > Parent call for warm transfer has already completed or doesn't exist. > > ```json theme={null} > { > "status": "error", > "message": "Parent call has completed or does not exist. Warm Transfer Request Cancelled" > } > ``` > > **500 - Internal Server Errors** `object` > > General server errors and catch-all error handlers. > > ```json theme={null} > { > "status": "error", > "message": "Internal server error during flagging process" > } > ``` > > **Typical scenarios**: > > * Uncaught exceptions in call processing > * Third-party service failures > * Memory allocation or resource exhaustion errors > * Network connectivity issues > > **400 - Call Parameters Validation** `object` > > Basic call parameters validation from the main validation function. > > ```json theme={null} > { > "status": "error", > "message": "Call parameters must be an object." > } > ``` > > **402 - No Billing Record** `object` > > No billing record found for your account. > > ```json theme={null} > { > "status": "error", > "message": "No billing record found." > } > ``` > > **402 - Insufficient Balance** `object` > > Account balance is insufficient for the call. > > ```json theme={null} > { > "status": "error", > "message": "Insufficient balance." > } > ``` > > **418 - Invalid Objective** `object` > > The objective parameter failed validation (returns validation details). > > ```json theme={null} > { > "error": "OBJECTIVE_VALIDATION_ERROR", > "details": "Custom validation response" > } > ``` > > **500 - Twilio Connection Error** `object` > > Failed to establish connection with Twilio services. > > ```json theme={null} > { > "status": "error", > "message": "Error in creating Twilio connection." > } > ``` > > **500 - Invalid Encrypted Key** `object` > > The encrypted key provided is invalid or corrupted. > > ```json theme={null} > { > "status": "error", > "message": "Invalid `encrypted_key`. Please use the correct key for your account." > } > ``` > > **500 - Internal Server Error** `object` > > General internal server error during call processing. > > ```json theme={null} > { > "status": "error", > "message": "Error triggering call. Please check your twilio account for errors" > } > ``` > > **500 - Content Moderation Error** `object` > > Error occurred during the content flagging process. > > ```json theme={null} > { > "status": "error", > "message": "Internal server error during flagging process" > } > ``` > > **500 - BYOT Number Error** `object` > > Error retrieving Bring Your Own Twilio (BYOT) phone number. > > ```json theme={null} > { > "status": "error", > "message": "Error in getting BYOT Number" > } > ``` > > **500 - Dialer Data Error** `object` > > Error retrieving dialer data from encrypted key. > > ```json theme={null} > { > "status": "error", > "message": "Error in getting dialer data from encrypted key" > } > ``` > > **500 - User Data Fetch Error** `object` > > Error fetching user data for account verification. > > ```json theme={null} > { > "status": "error", > "message": "Error in fetching user data" > } > ``` > > **Other variations:** > > ```json theme={null} > { > "status": "error", > "message": "Error in fetching parent user data" > } > ``` > > **500 - Retry Call Error** `object` > > Missing retry attempt information for retry calls. > > ```json theme={null} > { > "status": "error", > "message": "Retry attempt not provided for retry call: {call_id}" > } > ``` > > **400 - Invalid Transfer Number** `object` > > Transfer phone number is invalid. > > ```json theme={null} > { > "status": "error", > "message": "Invalid transfer_phone_number." > } > ``` *** Docs for agents: [llms.txt](/llms.txt) # Analyze Call with AI Source: https://docs.bland.ai/api-v1/post/calls-id-analyze POST https://api.bland.ai/v1/calls/{call_id}/analyze Analyzes a call of calls based using questions and goals. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **call\_id** `string` *required* The unique identifier for the call to be analyzed. ### Request Body **goal** `string` *required* This is the overall purpose of the call. Provides context for the analysis to guide how the questions/transcripts are interpreted. **questions** `string[][]` *required* An array of questions to be analyzed for the call. Each question should be an array with two elements: the question text and the expected answer type (e.g., "string", "boolean"). Fairly flexible in terms of the expected answer type, and unanswerable questions will default to `null`. Examples: ```json theme={null} "questions": [ ["Who answered the call?", "human or voicemail"], ["Positive feedback about the product: ", "string"], ["Negative feedback about the product: ", "string"], ["Customer confirmed they were satisfied", "boolean"] ] ``` ### Response **status** `object` Will be `success` if the request was successful. **message** `string` Confirms the request was successful, or provides an error message if the request failed. **answers** `array` Contains the analyzed answers for the call in an array. **credits\_used** `number` Token-based price for the analysis request. As a rough estimate, the base cost is `0.003` credits with an additional `0.0015` credits per call in the call. Longer call transcripts and higher numbers of questions can increase the cost, however the cost scales very effectively with calls vs. individual calls. ```json theme={null} { "status": "success", "message": "Successfully analyzed call", "answers": [ "human", "Customer found the product sturdy and reliable", "A bit heavy", true ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Listen to Active Call Source: https://docs.bland.ai/api-v1/post/calls-id-listen POST https://api.bland.ai/v1/calls/{call_id}/listen Initiate a live listen session for an active call Starts a live listen session for an active call, returning a WebSocket URL for real-time audio streaming. ## Authentication **authorization** `string` *required* Your API key for authentication ## Path Parameters **call\_id** `string` *required* The unique identifier of the call to listen to ## Prerequisites * Live listen must be enabled in organization preferences (`live_listen_enabled: true`) * Call must be in active status (not completed) * Call must belong to the authenticated organization ## Response **status** `string` Response status indicator **data** `object` **data properties** **url** `string` WebSocket URL for connecting to the live audio stream **errors** `array` (default: null) Array of error objects if request failed ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v1/calls/call_123456/listen" \ -H "Authorization: Bearer YOUR_API_KEY" ``` ```javascript JavaScript theme={null} const response = await fetch('https://api.bland.ai/v1/calls/call_123456/listen', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }); const data = await response.json(); console.log(data.data.url); // WebSocket URL ``` ```python Python theme={null} import requests url = "https://api.bland.ai/v1/calls/call_123456/listen" headers = {"Authorization": "Bearer YOUR_API_KEY"} response = requests.post(url, headers=headers) data = response.json() print(data["data"]["url"]) # WebSocket URL ``` ```json Success Response theme={null} { "status": "success", "data": { "url": "wss://api.bland.ai/ws/listen/call_123456" }, "errors": null } ``` ```json Organization Not Configured theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_ORG_PREFERENCES", "message": "Org preferences do not allow live listening" } ] } ``` ```json Call Not Found theme={null} { "status": "error", "data": null, "errors": [ { "error": "CALL_NOT_FOUND", "message": "Call not found" } ] } ``` ```json Call Not Active theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_CALL_STATUS", "message": "Call is not in progress" } ] } ``` ```json Call Not Available for Streaming theme={null} { "status": "error", "data": null, "errors": [ { "error": "CALL_NOT_FOUND", "message": "Call was either not found or not started" } ] } ``` ## WebSocket Connection After receiving the WebSocket URL, connect to it to receive real-time audio data: ### Connection Details * **URL**: Use the `url` returned in the response * **Protocol**: WebSocket (WSS) * **Binary Type**: `arraybuffer` * **Authentication**: Handled via the URL token ### Audio Data Format The WebSocket streams binary audio data with these specifications: * **Format**: PCM Int16 (16-bit signed integers) * **Sample Rate**: 16,000 Hz * **Channels**: Mono (1 channel) * **Byte Order**: Little-endian * **Data**: Combined audio from all call participants ### WebSocket Implementation Example ```javascript theme={null} // Connect to WebSocket const socket = new WebSocket(websocketUrl); socket.binaryType = 'arraybuffer'; socket.onmessage = (event) => { // Convert ArrayBuffer to Int16Array const dataView = new DataView(event.data); const int16Array = new Int16Array(dataView.byteLength / 2); for (let i = 0; i < int16Array.length; i++) { int16Array[i] = dataView.getInt16(i * 2, true); // Little-endian } // Process audio data (convert to Float32 for Web Audio API) const float32Array = new Float32Array(int16Array.length); for (let i = 0; i < int16Array.length; i++) { float32Array[i] = int16Array[i] / 32768; // Normalize to [-1, 1] } // Use audio data for playback }; socket.onclose = () => { console.log('Live listen session ended'); }; ``` ## Error Codes | Error Code | Description | | - | - | | `MISSING_CALL_ID` | Call ID parameter is required | | `INVALID_ORG_PREFERENCES` | Live listen is not enabled for organization | | `CALL_NOT_FOUND` | Call does not exist or does not belong to organization | | `INVALID_CALL_STATUS` | Call is not currently active | | `INTERNAL_SERVER_ERROR` | Server error occurred | ## Notes * WebSocket connection automatically closes when the call ends * Multiple concurrent listeners can subscribe to the same call * Audio stream includes all participants in the call (combined) * The WebSocket URL can be used by multiple connections simultaneously *** Docs for agents: [llms.txt](/llms.txt) # Stop Active Call Source: https://docs.bland.ai/api-v1/post/calls-id-stop POST https://api.bland.ai/v1/calls/{call_id}/stop End an active phone call by call_id. This endpoint can also be used to cancel scheduled calls. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **call\_id** `string` *required* The unique identifier for the call you want to end. ### Response **status** `string` Can be `success` or `error`. **message** `string` If the status is `success`, the message will say "Call ended successfully." Otherwise, if the status is `error`, the message will say "SID not found for the given c\_id." or "Internal server error." ```json theme={null} { "status": "success", "message": "Call ended successfully." } ``` *** Docs for agents: [llms.txt](/llms.txt) # Post-Transfer Transcript Stream (WebSocket) Source: https://docs.bland.ai/api-v1/post/calls-id-transcript-stream Live transcript of the conversation after a call is transferred to a human. ## Overview When a call created with `stream_post_transfer_transcript: true` is transferred to a human (cold or warm), Bland transcribes the bridged conversation live. Connect to this WebSocket to receive finalized transcript segments as the caller and the transferred-to representative speak. The stream is a real-time preview. For a durable record, subscribe with `"post_transfer_transcript"` in `webhook_events`: the [post-call webhook](/tutorials/post-call-webhooks#post-transfer-transcript) then carries the same segment format, built from the call recording after the call ends. The stream and the webhook are independent opt-ins. > [!NOTE] > > The post-transfer transcript stream is in limited rollout. If the [Get Transcript Stream URL endpoint](/api-v1/post/calls-id-transcript-stream-token) returns 403, it is not yet enabled for your organization. *** ## Connecting Request a connection URL from [Get Transcript Stream URL](/api-v1/post/calls-id-transcript-stream-token) and connect to it exactly as returned, within 5 minutes. The URL is opaque: it routes the connection to the server handling the call and carries the stream credential. Do not parse or reconstruct it. Connections without a valid credential for the call are closed with code `1008`. *** ## Connection Lifecycle * **Connect any time after the call is answered.** The connection URL becomes available once the call is answered; a listener that connects before the transfer starts is held and attached automatically when the transferred conversation begins. * **Join-live semantics.** A listener that connects mid-transfer receives segments from that moment forward. There is no history replay; use the post-call webhook for the complete transcript. * **Multiple listeners are allowed.** Each requests its own connection URL; all receive the same events. * **End of stream.** When the transferred conversation ends, the server sends a `stream_end` event and closes the socket with code `1000`. *** ## Events All messages are JSON text frames. ### `transcript_segment` One finalized utterance. Segments are settled text (interim results are never sent), so they arrive at natural pause boundaries, not word by word. ```json theme={null} { "event": "transcript_segment", "call_id": "9d404c1b-6a23-4b21-a7f9-64f8456ba0ec", "segment": { "start": 12.4, "end": 15.1, "speaker": 1, "speaker_label": "user", "text": "I was calling about my appointment on Thursday.", "confidence": 0.97 } } ``` **segment.start** `number` Seconds from the start of the transferred conversation. **segment.end** `number` End of the utterance, in the same clock as `start`. **segment.speaker** `number` `1` for the caller, `2` for the transferred-to human. **segment.speaker\_label** `string` `user` for the caller, `representative` for the transferred-to human. Matches the labels in the webhook's `post_transfer_transcript`. **segment.text** `string` The finalized utterance text. **segment.confidence** `number` Transcription confidence between 0 and 1. Segments from the two speakers can arrive out of chronological order, since each speaker's speech finalizes independently. Order by `start` when rendering. ### `stream_end` The transferred conversation has ended. No further segments will arrive, and the socket closes with code `1000`. ```json theme={null} { "event": "stream_end", "call_id": "9d404c1b-6a23-4b21-a7f9-64f8456ba0ec" } ``` *** ## Implementation Example ```javascript theme={null} // 1. Get a connection URL (server-side) const res = await fetch( `https://api.bland.ai/v1/calls/${callId}/transcript-stream/token`, { method: "POST", headers: { authorization: BLAND_API_KEY } }, ); const { data } = await res.json(); // 2. Connect (safe in a browser: the URL carries only a short-lived credential) const ws = new WebSocket(data.url); ws.onmessage = (event) => { const msg = JSON.parse(event.data); if (msg.event === "transcript_segment") { const s = msg.segment; console.log(`[${s.start}s] ${s.speaker_label}: ${s.text}`); } else if (msg.event === "stream_end") { console.log("Transfer ended"); } }; ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Transcript Stream URL Source: https://docs.bland.ai/api-v1/post/calls-id-transcript-stream-token POST https://api.bland.ai/v1/calls/{call_id}/transcript-stream/token Get a short-lived, ready-to-connect WebSocket URL for a call's live post-transfer transcript stream. ## Overview Returns a short-lived, ready-to-connect WebSocket URL for the call's [post-transfer transcript stream](/api-v1/post/calls-id-transcript-stream). Use this from your backend so browser clients never see your long-lived API key; the returned URL carries only a 5-minute credential scoped to this one call. The URL is opaque — connect to it exactly as returned. Do not parse it or construct your own. The URL becomes available when the call is answered (that is when the server handling the call is assigned). Until then this endpoint returns 404 with `CALL_NOT_FOUND` ("Call was either not found or not started" — the same response as [Listen to Active Call](/api-v1/post/calls-id-listen)); poll every second or two after placing the call. Once connected, you can hold the socket through the rest of the call — it parks until the transfer starts. > [!NOTE] > > The post-transfer transcript stream is in limited rollout. If this endpoint returns 403 with `FEATURE_NOT_ENABLED`, it is not yet enabled for your organization. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **call\_id** `string` *required* The call whose post-transfer transcript you want to stream. The call must have been created with `stream_post_transfer_transcript: true`. *** ## Body Parameters This endpoint takes no body. POST an empty body or `{}`. *** ## Response **data.url** `string` Opaque WebSocket URL. Connect to it as returned, within 5 minutes. **data.expires\_in\_seconds** `number` Lifetime of the URL's embedded credential. Currently `300` (5 minutes). The TTL gates the connection handshake only; an established stream is not closed when it expires. **errors** `null | array` `null` on success. `401` when the call belongs to a different organization, `403` when the feature is not enabled for your organization, `404` with `CALL_NOT_FOUND` when the call does not exist or has no active transcript stream (not created with `stream_post_transfer_transcript`, not yet answered, or already ended). ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v1/calls/{call_id}/transcript-stream/token" \ -H "authorization: Bearer YOUR_API_KEY" ``` ```json Response theme={null} { "data": { "url": "wss://stream.aws.dc8.bland.ai/ws/transcript-stream/eyJhbGciOiJBMjU2R0NNS1ci...?token=eyJhbGciOiJIUzI1NiIs...", "expires_in_seconds": 300 }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Call With Task (Simple) Source: https://docs.bland.ai/api-v1/post/calls-simple POST https://us.api.bland.ai/v1/calls Send an AI phone call using a task. ### Headers **Authorization** `string` *required* A valid Bland API key, located in the [organization portal](https://app.bland.ai/dashboard/settings). ### Body **phone\_number** `string` *required* The phone number to call. Must be a valid phone number in [E.164](https://en.wikipedia.org/wiki/E.164) format. **task** `string` *required* The task to use for the call. This is a prompt that tells the AI background information, expected behavior, and relevant information. ### Response **status** `string` Can be `success` or `error`. **call\_id** `string` A unique identifier for the call (present only if status is `success`). ```json Response theme={null} { "status": "success", "call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Call using Pathways (Simple) Source: https://docs.bland.ai/api-v1/post/calls-simple-pathway POST https://api.bland.ai/v1/calls Send an AI phone call with your own conversational pathway agent! Links - [Video Tutorial](https://www.loom.com/share/5ce5a84ec97149efad7cf5eff66a93c5?sid=697dc436-53cf-494c-a3e9-a25031df6496) | [Step-by-step web tutorial](https://docs.bland.ai/tutorials/pathways) ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The phone number to call. Country code defaults to `+1` (US) if not specified. Formatting is flexible, however for the most predictable results use the [E.164](https://www.twilio.com/docs/glossary/what-e164#examples-of-e164-numbers) format. > [accordion] Formatting Examples > > Expected/Ideal Format: > > * "+12223334444" > * "+91223334444" > * "+61223334444" > > Valid, but not recommended: > > * "2223334444" > * "+1 (222) 333-4444" > * "+1 222 333 4444" > * "222-333-4444" > > Invalid: > > * "12223334444" > * "552223334444" > * "non-numeric characters" > * "2223334444 ext. 123" **pathway\_id** `string` *required* Follows the conversational pathway you created to guide the conversation. You can access your pathway\_id by clicking on the 'Copy ID' button on your pathways [here](https://app.bland.ai/home?page=convo-pathways). If you don't have any pathways, click the 'Create Pathway' button to create one! > [accordion] Conversational Pathway Tutorial > > [Video tutorial](https://www.loom.com/share/5ce5a84ec97149efad7cf5eff66a93c5?sid=697dc436-53cf-494c-a3e9-a25031df6496) > > [Step by step Web Tutorial](https://docs.bland.ai/tutorials/pathways) ### Response **status** `string` Can be `success` or `error`. **call\_id** `string` A unique identifier for the call (present only if status is `success`). ```json Response theme={null} { "status": "success", "call_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Citation Schema Source: https://docs.bland.ai/api-v1/post/citation-schemas POST https://api.bland.ai/v1/citation_schemas/ Create a new citation schema for extracting structured data from call transcripts. ## 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 **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* The name of the citation schema. This should be descriptive and help you identify the schema's purpose. **description** `string` An optional description explaining what this schema extracts and its intended use case. **schema** `object` 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 extraction * `groupings`: Array of related variable collections * `conditions`: Array of conditional logic rules that trigger additional variable extraction Example structure: ```json theme={null} { "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 **status** `integer` HTTP status code (200 for success). **data** `object` The created citation schema object. **id** `string` The unique identifier for the created citation schema (UUID format). **name** `string` The name of the citation schema. **description** `string` The description of the citation schema. **org\_id** `string` The organization ID that owns this schema. **schema** `object` The JSON schema configuration for citation extraction. **created\_at** `string` The timestamp when the citation schema was created (ISO 8601 format). **errors** `null` Will be null for successful requests. ### Error Responses **400 Bad Request** Returned when the required `name` parameter is missing. ```json Response theme={null} { "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](/llms.txt) # Backfill Citation Schema Source: https://docs.bland.ai/api-v1/post/citation-schemas-backfill POST https://api.bland.ai/v1/citation_schemas/backfill Retroactively apply one or more citation schemas to extract data from existing call transcripts. ## Overview The backfill endpoint allows you to apply citation schemas to calls and SMS conversations that have already been completed. This is useful when you: * Create a new schema and want to extract data from historical calls or conversations * Need to re-analyze calls or conversations with updated schemas * Want to extract data from multiple calls or conversations at scale Call backfill operations are **asynchronous** — you'll receive a `workflow_id` immediately and can poll the status endpoint to check progress. SMS conversation backfill is **synchronous** — results are returned directly in the response. > [!NOTE] > > This is an **Enterprise-only feature**. Contact your Bland representative or reach out to sales to enable this functionality. > [!WARNING] > > Backfilling will update citation variables for the specified call(s) and schema(s). Variables are merged with existing data - only the variables defined in the schema being backfilled will be updated. *** ## Request ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters #### Schema Parameters (Choose One) **schema\_id** `string` A single citation schema ID from your organization to apply to the call(s). **schema\_ids** `string[]` An array of citation schema IDs to apply to the call(s). All schemas will be processed for each call. **Note**: Cannot be combined with `schema` (inline schema). **schema** `object` An inline citation schema definition. Useful for one-time analysis without creating a schema in your account. Can be combined with `call_id`/`call_ids` or `conversation_id`/`conversation_ids` for multi-call or multi-conversation analysis. **Note**: Cannot be combined with `schema_ids`. #### Call Parameters **call\_id** `string` A single call ID to analyze with the specified schema(s). **call\_ids** `string[]` An array of call IDs to analyze with the specified schema(s). All schemas will be applied to each call. #### SMS Conversation Parameters **conversation\_id** `string` A single SMS conversation ID to analyze with the specified schema(s). Processed synchronously. **conversation\_ids** `string[]` An array of SMS conversation IDs to analyze. Maximum 50 conversations per request. All schemas will be applied to each conversation. Processed synchronously. *** ## Response Returns `202 Accepted` when calls are included (async processing), or `200 OK` when only SMS conversations are included (sync processing). **status** `string` `"processing"` when calls are being processed asynchronously, or `"complete"` when only SMS conversations were processed. **workflow\_id** `string` Unique identifier for the call backfill workflow. Only present when calls are included. Use this to check status and retrieve results. **call\_count** `integer` Number of calls being processed. **conversation\_count** `integer` Number of SMS conversations processed. **schema\_count** `integer` Number of schemas being applied. **total\_combinations** `integer` Total number of call+schema extractions that will be performed (`call_count × schema_count`). Only present when calls are included. **conversations** `array` Results for SMS conversation backfill. Only present when conversations are included. Each entry contains: * `conversation_id` — the conversation that was analyzed * `status` — `"success"`, `"skipped"`, or `"error"` * `variables_extracted` — count of unique variable names extracted across all schemas (same definition as `result.calls[].variables_extracted_count`) * `previous_variables` — the conversation's citation variables **before** this backfill operation * `newly_extracted_variables` — variables that were extracted or updated by **this backfill** operation * `final_variables` — the conversation's citation variables **after** this backfill operation (complete merged state) * `error` — error message if the extraction failed **message** `string` Instructions on how to check the status of the call workflow. *** ## Checking Status Use the workflow ID to poll the status endpoint: ```bash theme={null} GET https://api.bland.ai/v1/citation_schemas/backfill/status/{workflow_id} ``` ### Status Response **workflow\_id** `string` The workflow ID you're querying. **status** `string` Current workflow status: * `RUNNING`: Still processing * `COMPLETED`: Finished successfully (may have partial failures) * `FAILED`: Workflow encountered an error * `TERMINATED`: Manually stopped * `TIMED_OUT`: Exceeded maximum execution time **result** `object` Only present when `status` is `COMPLETED`. Contains the full backfill results. ### Result Object (When Completed) **result.status** `string` Overall result status: * `success`: All extractions succeeded * `partial`: Some extractions succeeded, some failed * `failed`: All extractions failed **result.calls** `array` Array of results, one entry per call processed. **result.calls\[].call\_id** `string` The call that was analyzed. **result.calls\[].status** `string` Status for this call: `success`, `partial`, or `failed`. **result.calls\[].schemas\_processed** `array` Details about each schema extraction for this call. **result.calls\[].variables\_extracted\_count** `integer` Total number of unique variables extracted across all schemas for this call. **result.calls\[].previous\_variables** `object` The call's citation variables **before** this backfill operation. **result.calls\[].newly\_extracted\_variables** `object` Variables that were extracted or updated by **this backfill** operation. **result.calls\[].final\_variables** `object` The call's citation variables **after** this backfill operation (complete state). **result.summary** `object` Aggregate statistics across all calls and schemas: * `total_calls`: Number of calls processed * `successful_calls`: Calls where all schemas succeeded * `partial_calls`: Calls where some schemas failed * `failed_calls`: Calls where all schemas failed * `total_schemas_processed`: Total schema extractions attempted * `successful_schema_extractions`: Schema extractions that succeeded * `failed_schema_extractions`: Schema extractions that failed *** ## Usage Flow 1. **Send backfill request** and receive `workflow_id` 2. **Poll the status endpoint** periodically (every 5-10 seconds) 3. **When status is `COMPLETED`**, retrieve results from `result` field 4. **Review the results** to see what was extracted for each call *** ## Examples ### Single Call, Single Schema ```bash Request theme={null} curl -X POST https://api.bland.ai/v1/citation_schemas/backfill \ -H "authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "call_id": "call-123", "schema_id": "schema-abc" }' ``` ```json Response (202 Accepted) theme={null} { "status": "processing", "workflow_id": "backfill:call-123:1760635265843", "call_count": 1, "schema_count": 1, "total_combinations": 1, "message": "Citation backfill workflow started for 1 call(s) with 1 schema(s)..." } ``` ### Multiple Calls, Multiple Schemas ```bash Request theme={null} curl -X POST https://api.bland.ai/v1/citation_schemas/backfill \ -H "authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "call_ids": ["call-123", "call-456", "call-789"], "schema_ids": ["schema-abc", "schema-def"] }' ``` ```json Response (202 Accepted) theme={null} { "status": "processing", "workflow_id": "backfill:batch:671b7623-f9ac-46db-95f1-9b504fe59a06:1760635265843", "call_count": 3, "schema_count": 2, "total_combinations": 6, "message": "Citation backfill workflow started for 3 call(s) with 2 schema(s)..." } ``` ### SMS Conversations ```bash Request theme={null} curl -X POST https://api.bland.ai/v1/citation_schemas/backfill \ -H "authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "conversation_ids": ["conv-123", "conv-456"], "schema_id": "schema-abc" }' ``` ```json Response (200 OK) theme={null} { "status": "complete", "call_count": 0, "conversation_count": 2, "schema_count": 1, "conversations": [ { "conversation_id": "conv-123", "status": "success", "variables_extracted": 2, "previous_variables": { "customer_name": "Jane" }, "newly_extracted_variables": { "intent": "support", "resolved": true }, "final_variables": { "customer_name": "Jane", "intent": "support", "resolved": true } }, { "conversation_id": "conv-456", "status": "success", "variables_extracted": 2, "previous_variables": {}, "newly_extracted_variables": { "intent": "billing", "resolved": false }, "final_variables": { "intent": "billing", "resolved": false } } ] } ``` ### Single Call with Inline Schema ```bash Request theme={null} curl -X POST https://api.bland.ai/v1/citation_schemas/backfill \ -H "authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "call_id": "call-123", "schema": { "name": "Customer Sentiment Analysis", "variables": [ { "name": "customer_satisfied", "type": "boolean", "description": "Whether the customer expressed satisfaction" }, { "name": "sentiment_score", "type": "number", "description": "Overall sentiment from -1 (negative) to 1 (positive)" } ] } }' ``` ### Checking Status ```bash Request theme={null} curl https://api.bland.ai/v1/citation_schemas/backfill/status/backfill:call-123:1760635265843 \ -H "authorization: Bearer YOUR_API_KEY" ``` ```json Response (Status: RUNNING) theme={null} { "workflow_id": "backfill:call-123:1760635265843", "status": "RUNNING", "run_id": "0199ee0a-2343-7d98-8fbb-8d5c2d46ed4c", "start_time": "2025-10-16T17:21:05.859Z" } ``` ```json Response (Status: COMPLETED) theme={null} { "workflow_id": "backfill:call-123:1760635265843", "status": "COMPLETED", "run_id": "0199ee0a-2343-7d98-8fbb-8d5c2d46ed4c", "start_time": "2025-10-16T17:21:05.859Z", "close_time": "2025-10-16T17:21:39.019Z", "result": { "status": "success", "calls": [ { "call_id": "call-123", "status": "success", "schemas_processed": [ { "schema_id": "schema-abc", "status": "success", "variables_extracted": 5 } ], "variables_extracted_count": 5, "previous_variables": { "customer_name": "John Doe" }, "newly_extracted_variables": { "order_id": "ORD-789456", "issue_type": "shipping", "products": [ { "name": "Wireless Headphones", "issue": "damaged packaging", "quantity": 1 } ], "customer_satisfied": true, "resolution": "refund_issued" }, "final_variables": { "customer_name": "John Doe", "order_id": "ORD-789456", "issue_type": "shipping", "products": [ { "name": "Wireless Headphones", "issue": "damaged packaging", "quantity": 1 } ], "customer_satisfied": true, "resolution": "refund_issued" } } ], "summary": { "total_calls": 1, "successful_calls": 1, "partial_calls": 0, "failed_calls": 0, "total_schemas_processed": 1, "successful_schema_extractions": 1, "failed_schema_extractions": 0 } } } ``` *** ## Error Responses ### 400 Bad Request Returned when: * No schema parameter provided (`schema_id`, `schema_ids`, or `schema` required) * No identifier parameter provided (`call_id`, `call_ids`, `conversation_id`, `conversation_ids`, or `recording_url` required) * Invalid parameter combinations (e.g., `schema_ids` with inline `schema`) * Empty arrays provided * More than 50 SMS conversations in a single request ### 403 Forbidden Returned when: * Account does not have enterprise features enabled * Attempting to access another organization's calls, conversations, or schemas ### 404 Not Found Returned when: * Specified call ID(s) not found * Specified schema ID(s) not found * Resources don't belong to your organization * None of the provided `schema_id`/`schema_ids` can be resolved (error code: `NO_RESOLVABLE_SCHEMAS`) ### 500 Internal Server Error Returned when an unexpected error occurs starting the workflow. *** ## Best Practices ### Polling Strategy * Poll every **5-10 seconds** for single-call operations * Poll every **10-30 seconds** for batch operations * Implement exponential backoff if polling for extended periods * Stop polling once status is `COMPLETED`, `FAILED`, `TERMINATED`, or `TIMED_OUT` ### Batch Processing * Process up to **100 calls** at once for optimal performance * For larger batches, split into multiple backfill requests * Use multiple schemas in a single request rather than separate requests per schema ### Error Handling * Check the `result.calls[].status` field for per-call results * Review `schemas_processed` array to see which schemas succeeded/failed * Use `error_summary` field for quick diagnosis of partial failures * Failed extractions don't prevent successful ones from being stored ### Variable Management * **Newly extracted variables** overwrite previous values with the same name * Variables from different schemas are merged together * Only variables defined in the backfilled schema are updated * Other existing variables remain unchanged *** Docs for agents: [llms.txt](/llms.txt) # Clone Voice Source: https://docs.bland.ai/api-v1/post/clone POST https://api.bland.ai/v1/voices/clone Create a custom voice clone from audio samples. ## Overview Creates a Bland TTS voice clone from one or more audio samples. Sent as `multipart/form-data`. The new voice is private to your org and immediately usable with [Speak](/api-v2/post/tts). Two cloning engines are available, selectable per request: * **BTTS V3** (default), single 10-second sample, 17+ languages, highest fidelity. Returned `service: "BTTS_V3"`. * **BTTS V2**, exactly 1 WAV file, 17+ languages. Returned `service: "BTTS_V2"`. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Form Fields **name** `string` *required* Display name for the voice clone. 1-30 characters. Must be unique in your library. **audio\_samples** `file[]` *required* Audio file or files. Constraints depend on the engine flag (see below). WAV format recommended. **gender** `string` `male` or `female`. Optional but recommended; helps the underlying model. **description** `string` Free-text description. Surfaced as additional context to the model for tone and style. **isBTTS\_V3** `boolean` Use the V3 engine. Default if no engine flag is set. Pass `"true"` as a multipart string. **isBTTS\_V2** `boolean` Use the V2 engine instead of V3. Pass `"true"` as a multipart string. *** ## Engine constraints Each engine validates `audio_samples` differently. Mismatched files will return a `Validation Error` before the clone is created. > [accordion] V3 (default) > > * Exactly 1 audio file. > * Roughly 10 seconds is ideal. > * Max 10 MB. > * 17+ languages supported. > [accordion] V2 (isBTTS\_V2=true) > > * Exactly 1 audio file. > * Roughly 10 seconds is ideal. > * Max 10 MB. > * 17+ languages supported. *** ## Response Returns `200 OK` with the new voice on success. **data.voice\_id** `string` UUID of the new voice clone. Use it as `voice_id` in [Speak](/api-v2/post/tts). **data.name** `string` The display name you provided. **errors** `null | array` `null` on success. ```json Response theme={null} { "status": 200, "data": { "voice_id": "4cc89edf-c4b7-4df8-98c5-f8548fcd7c62", "name": "DocTestClone" }, "errors": null } ``` ```json Validation Error theme={null} { "status": 400, "data": null, "errors": [ { "error": "Validation Error", "message": "No files provided for voice cloning." } ] } ``` ```json Voice Limit Exceeded theme={null} { "status": 400, "data": null, "errors": [ { "error": "Limit Exceeded", "message": "You have reached the maximum number of voices for your plan." } ] } ``` *** V2 and V3 voices are single-sample by design. Use [List Voice Samples](/api-v1/get/voices-id-samples) to inspect the source sample attached to a voice. *** Docs for agents: [llms.txt](/llms.txt) # Merge Contacts Source: https://docs.bland.ai/api-v1/post/contacts-merge POST https://api.bland.ai/v1/contacts/merge Merge two contacts into one. All data from the duplicate contact is moved to the primary contact, and the duplicate is deleted. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **primary\_contact\_id** `string` *required* The ID of the contact that will remain after the merge. Data from the duplicate will be merged into this contact. **duplicate\_contact\_id** `string` *required* The ID of the contact to merge and delete. All associated data (calls, conversations, memory) will be transferred to the primary contact. ### Response **data** `object` The merged contact object. **data.id** `string` Unique identifier for the merged contact (same as primary\_contact\_id). **data.org\_id** `string` Organization ID the contact belongs to. **data.name** `string` Contact's name (prefers primary, falls back to duplicate if primary is empty). **data.metadata** `object` Merged metadata from both contacts (primary takes precedence for conflicting keys). **data.created\_at** `string` ISO timestamp when the contact was created. **data.updated\_at** `string` ISO timestamp when the contact was last updated. **errors** `null` Error array (null on success). ### Merge Behavior When merging contacts: * **Identifiers**: All phone numbers, emails, and external IDs from the duplicate are added to the primary contact * **Metadata**: Metadata objects are merged, with primary contact values taking precedence for conflicting keys * **Name**: The primary contact's name is kept, unless it's empty (then the duplicate's name is used) * **Calls**: All calls associated with the duplicate are reassigned to the primary contact * **SMS Conversations**: All SMS conversations are reassigned to the primary contact * **Contact Memory**: Memory data is merged (facts, recent messages, summaries) for each persona/agent. If both contacts have memory for the same persona, the data is intelligently combined ```json Response theme={null} { "data": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "John Doe", "metadata": { "source": "web_signup", "phone_verified": true, "email_verified": true }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T16:30:00.000Z" }, "errors": null } ``` ```json Error - Same Contact theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Cannot merge a contact with itself" } ] } ``` ```json Error - Different Orgs theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Cannot merge contacts from different orgs" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Contact not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Resolve Contact Source: https://docs.bland.ai/api-v1/post/contacts-resolve POST https://api.bland.ai/v1/contacts/resolve Find an existing contact or create a new one. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **phone\_number** `string` Phone number for the contact. At least one identifier is required. **email** `string` Email address for the contact. At least one identifier is required. **external\_id** `string` External ID for the contact. At least one identifier is required. **name** `string` Name of the contact. **persona\_id** `string` Persona ID for memory scoping. Either `persona_id` or `agent_number` should be provided for memory creation. **agent\_number** `string` Agent phone number for memory scoping. Either `persona_id` or `agent_number` should be provided for memory creation. **metadata** `object` Custom metadata to associate with the contact. ### Response **data** `object` Response containing the contact and creation status. **data.contact** `object` The resolved contact object. **data.contact.id** `string` Unique identifier for the contact. **data.contact.org\_id** `string` Organization ID the contact belongs to. **data.contact.name** `string` Contact's name (if set). **data.contact.metadata** `object` Custom metadata associated with the contact. **data.contact.created\_at** `string` ISO timestamp when the contact was created. **data.contact.updated\_at** `string` ISO timestamp when the contact was last updated. **data.created** `boolean` Whether a new contact was created (true) or an existing one was found (false). **errors** `null` Error array (null on success). ```json New Contact Created theme={null} { "data": { "contact": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "John Doe", "metadata": { "source": "api" }, "created_at": "2025-07-22T10:30:00.000Z", "updated_at": "2025-07-22T10:30:00.000Z" }, "created": true }, "errors": null } ``` ```json Existing Contact Found theme={null} { "data": { "contact": { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "name": "John Doe", "metadata": { "source": "web_signup" }, "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T15:45:00.000Z" }, "created": false }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "At least one identifier (phone_number, email, or external_id) is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Folder Source: https://docs.bland.ai/api-v1/post/create_pathway_folder POST https://us.api.bland.ai/v1/pathway/folders Creates a new folder for the authenticated user. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* The name of the new folder. **parent\_folder\_id** `string` The ID of the parent folder, if creating a subfolder. ### Response **folder\_id** `string` The unique identifier of the newly created folder. **name** `string` The name of the newly created folder. **parent\_folder\_id** `string` The ID of the parent folder, if applicable. ```json Response theme={null} { "folder_id": "new_folder_123", "name": "New Folder", "parent_folder_id": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Pathway Version Source: https://docs.bland.ai/api-v1/post/create_pathway_version POST https://api.bland.ai/v1/pathway/{pathway_id}/version Creates a new version of a specific pathway, including its name, nodes, and edges. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The ID of the pathway for which to create a new version. ### Request Body **name** `string` *required* The name of the new pathway version. **nodes** `array of objects` *required* An array of node objects defining the structure of the pathway. > [accordion] Node Object Parameters > > * `id` — Unique identifier of the node > * `type` — Type of the node (e.g., "Default", "End Call", "Webhook") > * `data` — Object containing node-specific data > * `name` — Name of the node > * `text` or `prompt` — Text or prompt associated with the node > * Other properties specific to the node type **edges** `array of objects` *required* An array of edge objects defining the connections between nodes. > [accordion] Edge Object Parameters > > * `id` — Unique identifier of the edge > * `source` — ID of the source node > * `target` — ID of the target node > * `label` — Label for this edge ### Response **status** `string` The status of the operation (e.g., "success"). **message** `string` A message describing the result of the operation. **data** `object` **properties** **created\_at** `string` The timestamp when the new version was created. **id** `string` The unique identifier of the newly created version. **name** `string` The name of the newly created version. **version\_number** `integer` The version number of the newly created version. ```json Response theme={null} { "status": "success", "message": "Version created successfully", "data": { "created_at": "2024-03-07T10:15:30Z", "id": "v3_ghi789", "name": "Improved Customer Flow", "version_number": 3 } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Custom Dialing Pool Source: https://docs.bland.ai/api-v1/post/custom-dialing-pool-update POST https://us.api.bland.ai/v1/custom-dialing-pools/{pool_id}/update Update an existing custom dialing pool with new phone numbers or credentials. > [!NOTE] > > **Enterprise Feature** - Custom dialing is only available on Enterprise plans. Contact your Bland representative for access. Update an existing custom dialing pool by replacing its phone numbers and/or Twilio credentials. This operation will completely replace the existing phone numbers with the new ones provided. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pool\_id** `string` *required* The unique identifier of the custom dialing pool to update. **Format**: UUID format (e.g., `550e8400-e29b-41d4-a716-446655440000`) ### Body **phone\_numbers** `array` *required* Array of phone numbers to replace the existing numbers in the pool. All numbers must be valid US phone numbers with +1 prefix. **Format**: Each phone number must be exactly 12 characters: `+1` followed by 10 digits. **Example**: `["+12345678901", "+19876543210"]` > [!WARNING] > > This will completely replace all existing phone numbers in the pool. Any numbers not included in this array will be removed. **encrypted\_key** `string` Optional UUID of Twilio credentials to associate with this pool. If provided, must be valid credentials that belong to your account. To remove credentials, pass `null`. **Format**: UUID format (e.g., `550e8400-e29b-41d4-a716-446655440000`) or `null` Learn more about BYOT [here](/tutorials/custom-twilio). ### Response **status** `string` Can be `success` or `error`. **data** `object` The updated custom dialing pool object (present only if status is `success`). **data properties** **id** `string` Unique identifier for the pool. **owner\_id** `string` Organization ID that owns this pool. **phone\_numbers** `array` Array of phone numbers in the pool (updated). **encrypted\_key** `string` UUID of associated Twilio credentials (or null if none). **created\_at** `string` Timestamp when the pool was created. **errors** `array` Array of error objects (present only if status is `error`). **error object properties** **error** `string` Error code indicating the type of error. **message** `string` Human-readable error message. ```bash cURL theme={null} curl -X POST "https://us.api.bland.ai/v1/custom-dialing-pools/550e8400-e29b-41d4-a716-446655440001/update" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+12345678901", "+19876543210", "+15551234567", "+17775551234"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000" }' ``` ```javascript JavaScript theme={null} const poolId = '550e8400-e29b-41d4-a716-446655440001'; const response = await fetch(`https://us.api.bland.ai/v1/custom-dialing-pools/${poolId}/update`, { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ phone_numbers: ['+12345678901', '+19876543210', '+15551234567', '+17775551234'], encrypted_key: '550e8400-e29b-41d4-a716-446655440000' }) }); const data = await response.json(); console.log(data); ``` ```python Python theme={null} import requests pool_id = "550e8400-e29b-41d4-a716-446655440001" url = f"https://us.api.bland.ai/v1/custom-dialing-pools/{pool_id}/update" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "phone_numbers": ["+12345678901", "+19876543210", "+15551234567", "+17775551234"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000" } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```json Success Response theme={null} { "status": "success", "data": { "id": "550e8400-e29b-41d4-a716-446655440001", "owner_id": "550e8400-e29b-41d4-a716-446655440002", "phone_numbers": ["+12345678901", "+19876543210", "+15551234567", "+17775551234"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2024-01-15T10:30:00Z" }, "errors": null } ``` ```json Error Response - Pool Not Found theme={null} { "status": "error", "data": null, "errors": [ { "error": "POOL_NOT_FOUND", "message": "Geospatial dialing pool not found" } ] } ``` ```json Error Response - Invalid Phone Numbers theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_PHONE_NUMBERS", "message": "All phone numbers must be valid US numbers with +1 prefix" } ] } ``` ```json Error Response - Invalid Credentials theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_CREDENTIALS", "message": "Twilio credentials not found or do not belong to your account" } ] } ``` ## Removing Credentials To remove Twilio credentials from a pool, set `encrypted_key` to `null`: ```json theme={null} { "phone_numbers": ["+12345678901", "+19876543210"], "encrypted_key": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Custom Dialing Pool Source: https://docs.bland.ai/api-v1/post/custom-dialing-pools POST https://us.api.bland.ai/v1/custom-dialing-pools Create a new custom dialing pool with phone numbers for optimized call routing. > [!NOTE] > > **Enterprise Feature** - Custom dialing is only available on Enterprise plans. Contact your Bland representative for access. Custom dialing pools allow you to create collections of phone numbers that will be automatically selected based on geographic proximity to optimize call pickup rates. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_numbers** `array` *required* Array of phone numbers to include in the pool. All numbers must be valid US phone numbers with +1 prefix. **Format**: Each phone number must be exactly 12 characters: `+1` followed by 10 digits. **Example**: `["+12345678901", "+19876543210"]` **encrypted\_key** `string` Optional UUID of Twilio credentials to associate with this pool. If provided, must be valid credentials that belong to your account. **Format**: UUID format (e.g., `550e8400-e29b-41d4-a716-446655440000`) Learn more about BYOT [here](/tutorials/custom-twilio). ### Response **status** `string` Can be `success` or `error`. **data** `object` The created custom dialing pool object (present only if status is `success`). **data properties** **id** `string` Unique identifier for the pool. **owner\_id** `string` Organization ID that owns this pool. **phone\_numbers** `array` Array of phone numbers in the pool. **encrypted\_key** `string` UUID of associated Twilio credentials (or null if none). **created\_at** `string` Timestamp when the pool was created. **errors** `array` Array of error objects (present only if status is `error`). **error object properties** **error** `string` Error code indicating the type of error. **message** `string` Human-readable error message. ```bash cURL theme={null} curl -X POST "https://us.api.bland.ai/v1/custom-dialing-pools" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+12345678901", "+19876543210", "+15551234567"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000" }' ``` ```javascript JavaScript theme={null} const response = await fetch('https://us.api.bland.ai/v1/custom-dialing-pools', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ phone_numbers: ['+12345678901', '+19876543210', '+15551234567'], encrypted_key: '550e8400-e29b-41d4-a716-446655440000' }) }); const data = await response.json(); console.log(data); ``` ```python Python theme={null} import requests url = "https://us.api.bland.ai/v1/custom-dialing-pools" headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" } data = { "phone_numbers": ["+12345678901", "+19876543210", "+15551234567"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000" } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```json Success Response theme={null} { "status": "success", "data": { "id": "550e8400-e29b-41d4-a716-446655440001", "owner_id": "550e8400-e29b-41d4-a716-446655440002", "phone_numbers": ["+12345678901", "+19876543210", "+15551234567"], "encrypted_key": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2024-01-15T10:30:00Z" }, "errors": null } ``` ```json Error Response - Invalid Phone Numbers theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_PHONE_NUMBERS", "message": "All phone numbers must be valid US numbers with +1 prefix" } ] } ``` ```json Error Response - Invalid Credentials theme={null} { "status": "error", "data": null, "errors": [ { "error": "INVALID_CREDENTIALS", "message": "Twilio credentials not found or do not belong to your account" } ] } ``` ## Usage with Calls Once you've created a custom dialing pool, you can use it in your call requests by specifying the `custom_dialing` parameter: ```json theme={null} { "phone_number": "+12345678901", "task": "Your call task here", "custom_dialing": "550e8400-e29b-41d4-a716-446655440001" } ``` ## The system will automatically select the most geographically appropriate phone number from your pool to maximize pickup rates. Docs for agents: [llms.txt](/llms.txt) # Delete Pathway Source: https://docs.bland.ai/api-v1/post/delete_pathway DELETE https://api.bland.ai/v1/pathway/{pathway_id} Delete your conversational pathway. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The unique identifier of the conversational pathway you want to delete. ### Response **status** `string` Can be `success` or `error`. **pathway\_id** `string` A unique identifier for the pathway (present only if status is `success`). ```json Response theme={null} { "status": "success", "message": "Pathway deleted successfully" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Outcome Source: https://docs.bland.ai/api-v1/post/dispositions POST https://api.bland.ai/v1/dispositions Create an outcome script for your organization. An outcome is a JavaScript script that reads a finished call or SMS conversation and returns structured data. The API calls outcomes dispositions. Pass outcome IDs in `disposition_ids` on [Send Call](/api-v1/post/calls) or [Send SMS](/api-v1/post/sms-send), and they run when the conversation ends. See [Outcomes](/tutorials/outcomes) for how they work. Outcomes are available on enterprise plans. Creating, updating, deleting and running an outcome requires the Owner, Admin or Operator role. Dispositions on V2 agents are a separate feature with their own [endpoints](/api-v2/get/agents-id-dispositions). ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* A name for the outcome. 1 to 100 characters, letters and underscores only (for example, `appointment_outcome`). **script** `string` *required* The JavaScript source, up to 200,000 characters. The script exports a `fetch` handler, reads the call from the request body and returns a JSON response: ```js theme={null} export default { async fetch(request) { const call = await request.json(); return Response.json({ booked: call.summary?.includes("booked") ?? false, minutes: call.call_length, }); }, }; ``` The request body is the same JSON that [Call Details](/api-v1/get/calls-id) returns for that call. Scripts can't make network calls: a script that uses `fetch()`, `XMLHttpRequest` or `WebSocket` is rejected with a 400. **metadata** `object` (default: \{}) Any key-value data you want stored with the outcome. ### Response **data** `object` The new outcome. **Outcome fields** **id** `string` The outcome ID. **org\_id** `string` The organization that owns the outcome. **name** `string` The outcome name. **metadata** `object` The metadata you stored with the outcome. **snippet\_id** `string` The ID of the stored script. **snippet\_version** `integer` The script version. Starts at `1` and goes up each time you update the script. **created\_at** `string` When the outcome was created (ISO 8601). **updated\_at** `string` When the outcome was last updated (ISO 8601). **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "id": "51b2f9ae-4162-4880-9920-10308352c55f", "org_id": "9b51b0fc-4127-446a-9ffb-21b1f006e6b5", "name": "appointment_outcome", "metadata": {}, "snippet_id": "44468cc3-d31f-47cd-8cff-94476b904a28", "snippet_version": 1, "created_at": "2026-10-26T15:04:12.381Z", "updated_at": "2026-10-26T15:04:12.381Z" }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Invalid request body", "ext": "{\"errors\":[\"/name: Expected string to match '^[a-zA-Z_]+$'\"]}" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Run Outcome Source: https://docs.bland.ai/api-v1/post/dispositions-id-run POST https://api.bland.ai/v1/dispositions/{id}/run Run an outcome on one call or SMS conversation. Runs the outcome's current script on a single conversation and returns the result. Use it to test a script, or to re-run an outcome on a past call. To run it on more conversations, send one request per conversation. Each run is saved, so you can read it back later with [List Outcome Runs](/api-v1/get/dispositions-id-run). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The outcome ID. ### Body Parameters **conversation\_id** `string` *required* The call ID or SMS conversation ID to run the outcome on. **reference\_type** `string` *required* One of `CALL`, `CALL_TEST`, `PATHWAY` or `PERSONA`. Use `CALL_TEST` to mark the run as a test. The other values save the run as `CALL`, or as `SMS` for an SMS conversation. ### Response **data** `object | null` The run result. `null` when no call or SMS conversation with that ID exists in your organization. **Run result fields** **disposition\_id** `string` The outcome that ran. **snippet\_version** `integer | null` The script version that ran. **status** `string` `COMPLETE` or `FAILED`. **result** `any` What the script returned. `null` when the run failed. **error** `string | null` Why the run failed. `null` when it succeeded. **exec\_time** `integer | null` How long the script ran, in milliseconds. **errors** `null | array` `null` on success, otherwise an array of error objects. ```json Response theme={null} { "data": { "disposition_id": "b3174d14-49bc-4e10-a12b-7dbe2480e377", "snippet_version": 3, "status": "COMPLETE", "result": { "booked": true, "minutes": 2.4 }, "error": null, "exec_time": 41 }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Eval Agent Source: https://docs.bland.ai/api-v1/post/evals-agents POST https://api.bland.ai/v1/evals/agents Create a new eval agent, optionally seeded from a template. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` Display name for the eval agent. Between 1 and 200 characters. **description** `string | null` Optional description of what the eval agent grades. **template\_key** `string | null` Key of a shipped template to seed the agent from. **user\_template\_id** `string | null` ID of a saved user template to seed the agent from. **modality** `string` The modality for the eval agent. One of `text` or `audio`. > [!NOTE] > > `template_key` and `user_template_id` are mutually exclusive. If both are provided, `user_template_id` wins. ### Response **data.agent** `object` The newly created eval agent. **data.agent.id** `string` Unique identifier for the eval agent. **data.agent.org\_id** `string` ID of the organization that owns this eval agent. **data.agent.key** `string` Unique slug key for the eval agent within the organization. **data.agent.name** `string` Display name of the eval agent. **data.agent.description** `string | null` Optional description of what the eval agent grades. **data.agent.current\_version\_id** `string` ID of the current editable draft version. **data.agent.active\_version\_id** `string | null` ID of the published version, or `null` if never published. **data.agent.metadata** `object` Key-value metadata associated with the eval agent. Values are strings. **data.agent.created\_at** `string` ISO 8601 timestamp for when the eval agent was created. **data.agent.updated\_at** `string` ISO 8601 timestamp for when the eval agent was last updated. **data.agent.deleted\_at** `string | null` ISO 8601 timestamp if the eval agent has been soft-deleted, otherwise `null`. **data.current\_version** `object` The editable draft version created alongside the agent. **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.eval\_agent\_id** `string` ID of the parent eval agent. **data.current\_version.version\_number** `integer` Sequential version number. **data.current\_version.name** `string` Name of this version. **data.current\_version.description** `string | null` Optional description of this version. **data.current\_version.state** `string` Always `"editable"` for a newly created draft. **data.current\_version.modality** `string` One of `text` or `audio`. **data.current\_version.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.current\_version.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.current\_version.levels** `array of objects` Verdict levels for graded mode. Empty array for pass/fail mode. Each level contains `level_key`, `label`, `prompt_md`, and optionally `color`. **data.current\_version.target\_level\_keys** `array of strings` Which level keys count as a target match. Empty array for pass/fail agents. **data.current\_version.weight** `number` Relative weight of this agent in aggregate scoring. Between 0 and 100. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if this is the first version. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "agent": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "key": "empathy-check", "name": "Empathy Check", "description": "Grades how empathetic the agent sounds during difficult conversations.", "current_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "active_version_id": null, "metadata": {}, "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z", "deleted_at": null }, "current_version": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 1, "name": "Empathy Check v1", "description": null, "state": "editable", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer.", "prompt_md": "Did the agent express empathy when the caller described their problem?", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent clearly and warmly acknowledged the caller's feelings.", "color": "emerald" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored or dismissed the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 10, "created_from_version_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" } } } ``` # Publish Eval Agent Source: https://docs.bland.ai/api-v1/post/evals-agents-id-publish POST https://api.bland.ai/v1/evals/agents/{eval_agent_id}/publications Publish the agent's current draft as a new active version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent to publish. > [!NOTE] > > Publishing validates the draft before snapshotting it. A graded agent must have between 2 and 5 levels, and every key in `target_level_keys` must match a defined level. A pass/fail agent must have 0 levels and no target level keys set. ### Response **data.eval\_agent\_id** `string` ID of the eval agent that was published. **data.current\_version\_id** `string` ID of the new editable draft created after publishing. **data.active\_version\_id** `string` ID of the newly published (archived) version. **data.published\_version** `object` Summary of the version that was published. **data.published\_version.id** `string` Unique identifier of the published version. **data.published\_version.eval\_agent\_id** `string` ID of the parent eval agent. **data.published\_version.version\_number** `integer` Sequential version number of the published version. **data.published\_version.name** `string` Name of the published version. **data.published\_version.state** `string` Always `"archived"` for a published version. **data.published\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.published\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.published\_version.latest\_run** `object | null` Summary of the most recent run against this version, or `null` if no runs exist. ```json Response theme={null} { "errors": null, "data": { "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "current_version_id": "e5f6a7b8-c9d0-1234-efab-567890123456", "active_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "published_version": { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Empathy Check v3", "state": "archived", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-15T08:00:00.000Z", "latest_run": null } } } ``` # Create Eval Agent Version Source: https://docs.bland.ai/api-v1/post/evals-agents-id-versions POST https://api.bland.ai/v1/evals/agents/{eval_agent_id}/versions Fork a new editable draft version of an eval agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **eval\_agent\_id** `string` *required* The unique identifier of the eval agent. ### Body Parameters **name** `string` Display name for the new version. Between 1 and 200 characters. **description** `string | null` Optional description for the new version. **from\_version\_id** `string` ID of the version to fork from. Defaults to the current draft if not provided. ### Response **data.id** `string` Unique identifier for the new version. **data.org\_id** `string` ID of the organization that owns this version. **data.eval\_agent\_id** `string` ID of the parent eval agent. **data.version\_number** `integer` Sequential version number assigned to the new draft. **data.name** `string` Name of the new version. **data.description** `string | null` Description of the new version, or `null`. **data.state** `string` Always `"editable"` for a newly forked draft. **data.modality** `string` One of `text` or `audio`, inherited from the source version. **data.system\_prompt\_md** `string` The system prompt for the judge LLM, in Markdown. **data.prompt\_md** `string` The grading prompt for the judge LLM, in Markdown. **data.levels** `array of objects` Verdict levels copied from the source version. Each level contains `level_key`, `label`, `prompt_md`, and optionally `color`. **data.target\_level\_keys** `array of strings` Target level keys copied from the source version. **data.weight** `number` Relative weight copied from the source version. Between 0 and 100. **data.created\_from\_version\_id** `string | null` ID of the version this was forked from. **data.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. ```json Response theme={null} { "errors": null, "data": { "id": "e5f6a7b8-c9d0-1234-efab-567890123456", "org_id": "f0e1d2c3-b4a5-9678-fedc-ba9876543210", "eval_agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 4, "name": "Empathy Check v4", "description": null, "state": "editable", "modality": "audio", "system_prompt_md": "You are an expert call quality reviewer.", "prompt_md": "Did the agent express empathy when the caller described their problem?", "levels": [ { "level_key": "excellent", "label": "Excellent", "prompt_md": "The agent clearly and warmly acknowledged the caller's feelings.", "color": "emerald" }, { "level_key": "poor", "label": "Poor", "prompt_md": "The agent ignored or dismissed the caller's feelings.", "color": "rose" } ], "target_level_keys": ["excellent"], "weight": 10, "created_from_version_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T11:30:00.000Z", "updated_at": "2026-05-27T11:30:00.000Z" } } ``` # Create Eval Run Source: https://docs.bland.ai/api-v1/post/evals-runs POST https://api.bland.ai/v1/evals/runs Start a new eval run over a batch of calls. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **call\_ids** `array of string` *required* The call IDs to score. Between 1 and 5000 calls. **attached\_agents** `array of objects` The eval agents to score with. Maximum 50 agents. Each object: **Agent attachment fields** **eval\_agent\_id** `string` *required* The UUID of the eval agent. **eval\_agent\_version\_id** `string` Pin a specific version of the agent. Omit to use the latest published version. **weight** `number` Relative weight of this agent in the overall score, 0-100. **target\_level\_keys** `array of string` Level keys considered a passing result for this agent. **run\_mode** `string` The scoring modality. One of `text`, `audio`, or `full`. Defaults to `text`. **pass\_threshold\_pct** `number` Percentage of evaluations that must pass for the run to be marked passing overall, 0-100. Omit to run without a threshold. **workbench\_setup\_id** `string` UUID of a workbench setup to associate with this run. Must be provided together with `workbench_setup_version_id`. **workbench\_setup\_version\_id** `string` UUID of the pinned workbench setup version. The version's agent roster is used when `attached_agents` is omitted. Must be provided together with `workbench_setup_id`. **triggered\_by** `string` How this run was initiated. One of `manual`, `auto`, or `backfill`. Defaults to `manual`. **metadata** `object` Key-value metadata to attach to the run. Keys and values must be strings. > [!NOTE] > > You must supply either a non-empty `attached_agents` array or a `workbench_setup_version_id` (whose pinned roster supplies the agents). If you provide `workbench_setup_id` or `workbench_setup_version_id`, both fields are required together. A valid billing record must be on file before a run can start. ### Response **id** `string` Unique identifier for the newly created eval run. **org\_id** `string` The organization that owns this run. **status** `string` Initial status of the run. Will be `PENDING` immediately after creation. **triggered\_by** `string` How the run was triggered. **run\_mode** `string` The scoring modality for this run. **submitted\_call\_ids** `array of string` The call IDs submitted for scoring. **submitted\_attached\_agents** `array of objects` The agent attachments submitted with the run. Each object contains `eval_agent_id`, `eval_agent_version_id`, `weight`, and `target_level_keys`. **workbench\_setup\_id** `string or null` The associated workbench setup, if provided. **workbench\_setup\_version\_id** `string or null` The pinned workbench setup version, if provided. **resolved\_call\_count** `integer` Number of calls resolved for the run. **resolved\_agent\_count** `integer` Number of eval agents resolved for the run. **resolved\_atom\_count** `integer` Total call-by-agent evaluations to perform. **completed\_atom\_count** `integer` Number of evaluations completed so far. **summary** `null` Always `null` at creation time. **billable\_cost\_usd** `null` Always `null` at creation time. **error\_code** `string or null` Error code if the run failed, otherwise `null`. **error\_message** `string or null` Human-readable error message if the run failed, otherwise `null`. **workflow\_id** `string or null` Internal workflow identifier, if applicable. **metadata** `object` Key-value metadata attached to the run. **created\_at** `string` ISO 8601 timestamp when the run was created. **started\_at** `null` Always `null` at creation time. **completed\_at** `null` Always `null` at creation time. ```json Response theme={null} { "data": { "id": "e5f6a7b8-c9d0-1234-efab-345678901234", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "status": "PENDING", "triggered_by": "manual", "run_mode": "text", "submitted_call_ids": [ "a1b2c3d4-0000-0000-0000-000000000001", "a1b2c3d4-0000-0000-0000-000000000002" ], "submitted_attached_agents": [ { "eval_agent_id": "11111111-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_version_id": "22222222-aaaa-bbbb-cccc-dddddddddddd", "weight": 100, "target_level_keys": ["pass"] } ], "workbench_setup_id": null, "workbench_setup_version_id": null, "resolved_call_count": 2, "resolved_agent_count": 1, "resolved_atom_count": 2, "completed_atom_count": 0, "summary": null, "billable_cost_usd": null, "error_code": null, "error_message": null, "workflow_id": null, "metadata": {}, "created_at": "2026-05-27T10:00:00.000Z", "started_at": null, "completed_at": null }, "errors": null } ``` # Estimate Eval Run Source: https://docs.bland.ai/api-v1/post/evals-runs-estimates POST https://api.bland.ai/v1/evals/runs/estimates Preview the size and cost of a run before starting it. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters Accepts the same body as [Create Eval Run](/api-v1/post/evals-runs). Key fields: **call\_ids** `array of string` *required* The call IDs to include in the estimate. Between 1 and 5000 calls. **attached\_agents** `array of objects` The eval agents to score with. Required when `workbench_setup_version_id` is not provided. **workbench\_setup\_version\_id** `string` Pinned workbench setup version whose agent roster supplies the agents. Required when `attached_agents` is not provided. Must be provided together with `workbench_setup_id`. ### Response **resolved\_atom\_count** `integer` Number of call-by-agent evaluations the run will perform. **estimated\_input\_tokens** `integer` Estimated number of input tokens consumed by judge calls. **estimated\_output\_tokens** `integer` Estimated number of output tokens produced by judge calls. **estimated\_cost\_usd\_cents** `number` Estimated billable cost in USD cents. ```json Response theme={null} { "data": { "resolved_atom_count": 150, "estimated_input_tokens": 420000, "estimated_output_tokens": 15000, "estimated_cost_usd_cents": 87.5 }, "errors": null } ``` # Cancel Eval Run Source: https://docs.bland.ai/api-v1/post/evals-runs-id-cancel POST https://api.bland.ai/v1/evals/runs/{run_id}/cancellations Cancel a pending, queued, or running eval run. Cancels an eval run in the `PENDING`, `QUEUED`, or `RUNNING` status. Runs in a terminal status return a `409` error. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The ID of the eval run to cancel. The run must be in the `PENDING`, `QUEUED`, or `RUNNING` status. ### Response **id** `string` Unique identifier for the eval run. **org\_id** `string` The organization that owns this run. **status** `string` Updated status of the run. Will be `CANCELLED`. **triggered\_by** `string` How the run was triggered. One of `manual`, `auto`, `backfill`. **run\_mode** `string` The scoring modality. One of `text`, `audio`, `full`. **submitted\_call\_ids** `array of string` The call IDs that were submitted for scoring. **submitted\_attached\_agents** `array of objects` The agent attachments submitted with the run. **workbench\_setup\_id** `string or null` The associated workbench setup, if any. **workbench\_setup\_version\_id** `string or null` The pinned workbench setup version, if any. **resolved\_call\_count** `integer` Number of calls resolved for the run. **resolved\_agent\_count** `integer` Number of eval agents resolved for the run. **resolved\_atom\_count** `integer` Total call-by-agent evaluations in the run. **completed\_atom\_count** `integer` Number of evaluations completed before cancellation. **summary** `object or null` Partial scoring summary if any atoms completed before cancellation, otherwise `null`. **billable\_cost\_usd** `number or null` Billable cost for evaluations completed before cancellation, or `null` if not yet finalized. **error\_code** `string or null` Error code if applicable, otherwise `null`. **error\_message** `string or null` Human-readable error message if applicable, otherwise `null`. **workflow\_id** `string or null` Internal workflow identifier, if applicable. **metadata** `object` Key-value metadata attached to the run. **created\_at** `string` ISO 8601 timestamp when the run was created. **started\_at** `string or null` ISO 8601 timestamp when the run started, or `null` if it never started. **completed\_at** `string or null` ISO 8601 timestamp when the run was cancelled. ```json Response theme={null} { "data": { "id": "e5f6a7b8-c9d0-1234-efab-345678901234", "org_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "status": "CANCELLED", "triggered_by": "manual", "run_mode": "text", "submitted_call_ids": [ "a1b2c3d4-0000-0000-0000-000000000001", "a1b2c3d4-0000-0000-0000-000000000002", "a1b2c3d4-0000-0000-0000-000000000003" ], "submitted_attached_agents": [ { "eval_agent_id": "11111111-aaaa-bbbb-cccc-dddddddddddd", "eval_agent_version_id": "22222222-aaaa-bbbb-cccc-dddddddddddd", "weight": 100, "target_level_keys": ["pass"] } ], "workbench_setup_id": null, "workbench_setup_version_id": null, "resolved_call_count": 3, "resolved_agent_count": 1, "resolved_atom_count": 3, "completed_atom_count": 1, "summary": null, "billable_cost_usd": 0.01, "error_code": null, "error_message": null, "workflow_id": null, "metadata": {}, "created_at": "2026-05-27T10:00:00.000Z", "started_at": "2026-05-27T10:00:05.000Z", "completed_at": "2026-05-27T10:00:38.000Z" }, "errors": null } ``` # Create User Template Source: https://docs.bland.ai/api-v1/post/evals-user-templates POST https://api.bland.ai/v1/evals/user-templates Save a new eval agent template, from scratch or by snapshotting an existing eval agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` Display name for the template. Maximum 120 characters. **description** `string` Description of the template. Maximum 4000 characters. Pass `null` to leave blank. **category** `string` Category label for the template. Maximum 64 characters. Pass `null` to leave blank. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` System prompt for the eval agent, in Markdown. Maximum 50000 characters. **prompt\_md** `string` Evaluation prompt, in Markdown. Maximum 50000 characters. **levels** `array` Ordered scoring levels. Each level object requires `level_key` (string, 1-64 chars), `label` (string, 1-80 chars), and `prompt_md` (string). The `color` field is optional: one of `rose`, `amber`, `gold`, `emerald`, `blue`, `indigo`, `violet`, or `fog`. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold. **visibility** `string` Access scope for the template. One of `private`, `org`, or `public`. **from\_agent\_id** `string` UUID of an existing eval agent to snapshot content from. **from\_version\_id** `string` UUID of a specific version of the eval agent to snapshot. Only used when `from_agent_id` is provided. Defaults to the agent's current version if omitted. > [!NOTE] > > There are two creation paths. Pass `from_agent_id` (optionally with `from_version_id`) to snapshot an existing agent's content into the template, or pass inline content fields to build one from scratch. When both are supplied, `from_agent_id` provides the content and inline fields act as overrides. ### Response **id** `string` Unique identifier (UUID) for the new template. **org\_id** `string` UUID of the organization that owns this template. **key** `string` Short key used to reference the template. **name** `string` Display name of the template. **description** `string` Description of the template, or `null`. **category** `string` Category of the template, or `null`. **modality** `string` Evaluation modality. Either `text` or `audio`. **system\_prompt\_md** `string` System prompt for the eval agent, in Markdown. **prompt\_md** `string` Evaluation prompt, in Markdown. **levels** `array` Ordered scoring levels. **target\_level\_keys** `array` Array of `level_key` strings that represent the passing threshold. **visibility** `string` Access scope. One of `private`, `org`, or `public`. **source\_agent\_id** `string` UUID of the eval agent this template was snapshotted from, or `null`. **source\_version\_id** `string` UUID of the specific version snapshotted, or `null`. **created\_by** `string` UUID of the user who created the template, or `null`. **created\_at** `string` ISO 8601 timestamp of when the template was created. **updated\_at** `string` ISO 8601 timestamp of when the template was last updated. ```json Response theme={null} { "data": { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "key": "my_hallucination_check", "name": "My Hallucination Check", "description": "Customized hallucination detection for our product domain.", "category": "quality", "modality": "text", "system_prompt_md": "You are an expert evaluator assessing whether an AI agent fabricated information.", "prompt_md": "Review the conversation and identify any claims that were factually incorrect or unsupported.", "levels": [ { "level_key": "no_hallucination", "label": "No Hallucination", "prompt_md": "The agent made no factually incorrect or unsupported claims.", "color": "emerald" }, { "level_key": "hallucination_detected", "label": "Hallucination Detected", "prompt_md": "The agent stated something factually incorrect or unsupported.", "color": "rose" } ], "target_level_keys": ["no_hallucination"], "visibility": "org", "source_agent_id": null, "source_version_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Workbench Setup Source: https://docs.bland.ai/api-v1/post/evals-workbench-setups POST https://api.bland.ai/v1/evals/workbench-setups Create a new workbench setup with an empty draft version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` Display name for the setup. Between 1 and 200 characters. **description** `string | null` Optional description of the setup. ### Response Returns `201` on success. **data** `object` An object containing the new setup and its draft version. **setup** **data.setup.id** `string` Unique identifier for the workbench setup. **data.setup.org\_id** `string` ID of the organization that owns this setup. **data.setup.key** `string` Stable slug key for the setup. **data.setup.name** `string` Display name of the setup. **data.setup.description** `string | null` Description of the setup, or `null` if not set. **data.setup.current\_version\_id** `string` ID of the current editable draft version. **data.setup.active\_version\_id** `string | null` ID of the published version, or `null` if never published. **data.setup.metadata** `object` Key-value metadata. Values are strings. **data.setup.created\_at** `string` ISO 8601 timestamp for when the setup was created. **data.setup.updated\_at** `string` ISO 8601 timestamp for when the setup was last updated. **data.setup.deleted\_at** `string | null` ISO 8601 timestamp for when the setup was deleted, or `null` if not deleted. **current\_version** **data.current\_version.id** `string` Unique identifier for this version. **data.current\_version.org\_id** `string` ID of the organization that owns this version. **data.current\_version.workbench\_setup\_id** `string` ID of the parent workbench setup. **data.current\_version.version\_number** `integer` Monotonically increasing version number. **data.current\_version.name** `string` Display name of this version. **data.current\_version.description** `string | null` Description of this version, or `null` if not set. **data.current\_version.state** `string` `"editable"` for a draft, `"archived"` for a published snapshot. **data.current\_version.attached\_agents** `array` Eval agents attached to this version. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **data.current\_version.pass\_threshold\_pct** `integer | null` Percentage of calls that must pass for a run to be considered passing (0-100), or `null` if not set. **data.current\_version.run\_mode** `string` How calls are evaluated. One of `text`, `audio`, or `full`. **data.current\_version.default\_test\_config\_id** `string | null` ID of the default test configuration, or `null` if not set. **data.current\_version.default\_call\_ids** `array of strings` Default call IDs to evaluate against. Up to 5000 entries. **data.current\_version.created\_from\_version\_id** `string | null` ID of the version this was forked from, or `null` if it is the first version. **data.current\_version.created\_by** `string | null` Identifier of the user who created this version, or `null`. **data.current\_version.created\_at** `string` ISO 8601 timestamp for when this version was created. **data.current\_version.updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "setup": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "key": "onboarding-quality-check", "name": "Onboarding Quality Check", "description": "Evaluates tone, accuracy, and resolution rate across onboarding calls.", "current_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "active_version_id": null, "metadata": {}, "created_at": "2026-05-27T09:00:00.000Z", "updated_at": "2026-05-27T09:00:00.000Z", "deleted_at": null }, "current_version": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 1, "name": "Onboarding Quality Check", "description": "Evaluates tone, accuracy, and resolution rate across onboarding calls.", "state": "editable", "attached_agents": [], "pass_threshold_pct": null, "run_mode": "text", "default_test_config_id": null, "default_call_ids": [], "created_from_version_id": null, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T09:00:00.000Z", "updated_at": "2026-05-27T09:00:00.000Z" } } } ``` # Publish Workbench Setup Source: https://docs.bland.ai/api-v1/post/evals-workbench-setups-id-publish POST https://api.bland.ai/v1/evals/workbench-setups/{setup_id}/publications Publish the setup's current draft as a new active version. > [!NOTE] > > A setup must have at least one attached agent before it can be published. Each attached agent must also have at least one target level key assigned. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup to publish. ### Response **data.workbench\_setup\_id** `string` ID of the workbench setup that was published. **data.current\_version\_id** `string` ID of the new editable draft version created after publishing. **data.active\_version\_id** `string` ID of the newly published (archived) version. This is now the active version. **data.published\_version** `object` Summary of the version that was published. **published\_version fields** **id** `string` Unique identifier for the published version. **workbench\_setup\_id** `string` ID of the parent workbench setup. **version\_number** `integer` Version number of the published snapshot. **name** `string` Display name of the version. **state** `string` Always `"archived"` for a published version. **attached\_agent\_count** `integer` Number of eval agents in this version. **created\_by** `string | null` Identifier of the user who created this version, or `null`. **created\_at** `string` ISO 8601 timestamp for when this version was created. **latest\_run** `object | null` The most recent run against this version, or `null` if none exist. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "current_version_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "active_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "published_version": { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 3, "name": "Onboarding Quality Check", "state": "archived", "attached_agent_count": 4, "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-20T14:00:00.000Z", "latest_run": null } } } ``` # Create Workbench Setup Version Source: https://docs.bland.ai/api-v1/post/evals-workbench-setups-id-versions POST https://api.bland.ai/v1/evals/workbench-setups/{setup_id}/versions Fork a new editable draft version of a workbench setup. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **setup\_id** `string` *required* The ID of the workbench setup to fork a new version from. ### Body Parameters All fields are optional. **name** `string` Display name for the new version. Between 1 and 200 characters. Defaults to the source version's name. **description** `string | null` Optional description for the new version. **from\_version\_id** `string` ID of the version to fork from. Defaults to the current draft if not provided. ### Response Returns `201` on success. **data** `object` The full newly created version object. **version fields** **id** `string` Unique identifier for this version. **org\_id** `string` ID of the organization that owns this version. **workbench\_setup\_id** `string` ID of the parent workbench setup. **version\_number** `integer` Monotonically increasing version number. **name** `string` Display name of this version. **description** `string | null` Description of this version, or `null` if not set. **state** `string` Always `"editable"` for a newly created version. **attached\_agents** `array` Eval agents inherited from the source version. Each item contains `eval_agent_id`, `eval_agent_version_id`, `weight` (0-100), and `target_level_keys` (array of strings). **pass\_threshold\_pct** `integer | null` Inherited pass threshold percentage (0-100), or `null` if not set. **run\_mode** `string` Inherited run mode. One of `text`, `audio`, or `full`. **default\_test\_config\_id** `string | null` Inherited default test configuration ID, or `null` if not set. **default\_call\_ids** `array of strings` Inherited default call IDs. Up to 5000 entries. **created\_from\_version\_id** `string | null` ID of the version this was forked from. **created\_by** `string | null` Identifier of the user who created this version, or `null`. **created\_at** `string` ISO 8601 timestamp for when this version was created. **updated\_at** `string` ISO 8601 timestamp for when this version was last updated. **errors** `null` `null` on success. ```json Response theme={null} { "errors": null, "data": { "id": "f7a8b9c0-d1e2-3456-abcd-567890123456", "org_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "workbench_setup_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "version_number": 5, "name": "Onboarding Quality Check", "description": null, "state": "editable", "attached_agents": [ { "eval_agent_id": "e5f6a7b8-c9d0-1234-efab-345678901234", "eval_agent_version_id": "f6a7b8c9-d0e1-2345-fabc-456789012345", "weight": 50, "target_level_keys": ["good", "excellent"] } ], "pass_threshold_pct": 80, "run_mode": "audio", "default_test_config_id": null, "default_call_ids": [], "created_from_version_id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "created_by": "9a8b7c6d-5e4f-3210-9876-543210fedcba", "created_at": "2026-05-27T10:00:00.000Z", "updated_at": "2026-05-27T10:00:00.000Z" } } ``` # Create Guard Rail Source: https://docs.bland.ai/api-v1/post/guard-rails POST https://api.bland.ai/v1/guard_rails Create a new guard rail for compliance monitoring. Guard rails monitor AI responses during calls to catch compliance violations and trigger automated actions. Learn more in the [Guard Rails documentation](/tutorials/guard-rails). ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters #### TCPA Guard Rails **type** `string` *required* The type of TCPA guard rail: * `tcpa:ai_disclosure` - AI must disclose it's an AI * `tcpa:recording_disclosure` - Must disclose the call is being recorded * `tcpa:self_introduction` - Must identify who is calling * `tcpa:opt_out` - Monitors for user opt-out requests The `tcpa:opt_out` type is different from the others: it's not time-based and instead monitors the entire conversation to detect if the agent continues to engage after the user opts out. The `config.end_seconds` field is not needed for this type. **config** `object` Configuration object. Required for time-based TCPA guard rails (`tcpa:ai_disclosure`, `tcpa:recording_disclosure`, `tcpa:self_introduction`). * `end_seconds` (number) - Time window in seconds. If the required disclosure is not made within this time, the configured actions will trigger. **attachments** `array` Array of sources to attach this guard rail to. * `source_type` (string, required) - Type of source: `PERSONA`, `PATHWAY`, or `INBOUND` * `source_id` (string, required) - ID of the source to attach to * `actions` (array, required) - Actions to take when the guard rail triggers #### Custom Guard Rails (Enterprise) Custom guard rails use your own detection prompt. Limited to 5 per organization. **type** `string` *required* Must be `custom` for custom guard rails. **name** `string` *required* Display name for the guard rail. This doesn't affect the behaviour and is only for your reference. **description** `string` *required* Description of what this guard rail detects. This doesn't affect the behaviour and is only for your reference. **prompt** `string` *required* Detection prompt that describes what to flag. #### Action Types Each attachment requires an `actions` array. Available action types: | Action Type | Description | Config | | - | - | - | | `end_call` | Immediately terminate the call | None | | `transfer` | Transfer to a human agent | `{ "phone_number": "+15551234567" }` | | `move_to_node` | Jump to a specific pathway node | `{ "node_id": "node-uuid" }` | ### Response **data** `object` The created guard rail object containing `id`, `org_id`, `type`, `name`, `description`, `prompt`, `config`, `attachments`, `created_at`, and `updated_at`. **errors** `array` Any errors that occurred (null if none). ```json TCPA Time-based theme={null} { "type": "tcpa:ai_disclosure", "config": { "end_seconds": 30 }, "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "end_call" } ] } ] } ``` ```json TCPA Opt-Out theme={null} { "type": "tcpa:opt_out", "attachments": [ { "source_type": "PATHWAY", "source_id": "11111111-2222-3333-4444-555555555555", "actions": [ { "type": "end_call" } ] } ] } ``` ```json Custom (Enterprise) theme={null} { "type": "custom", "name": "No Medical Advice", "description": "Prevents the agent from providing medical advice", "prompt": "Flag if the agent provides any medical advice, diagnosis, or treatment recommendations", "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "transfer", "config": { "phone_number": "+15551234567" } } ] } ] } ``` ```json Success Response theme={null} { "data": { "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "org_id": "12345678-1234-1234-1234-123456789012", "type": "tcpa:ai_disclosure", "name": null, "description": null, "prompt": null, "config": { "end_seconds": 30 }, "attachments": [ { "source_type": "PERSONA", "source_id": "98765432-1234-1234-1234-123456789012", "actions": [ { "type": "end_call" } ] } ], "created_at": "2025-01-15T10:30:00.000Z", "updated_at": "2025-01-15T10:30:00.000Z" }, "errors": null } ``` ```json Error Response (Duplicate Type) theme={null} { "data": null, "errors": [ { "error": "INVALID_PARAMETER", "message": "Cannot create multiple guard rails of the same type" } ] } ``` ```json Error Response (Enterprise Required) theme={null} { "data": null, "errors": [ { "error": "ENTERPRISE_REQUIRED", "message": "Creating custom guard rails are only available for enterprise users" } ] } ``` ```json Error Response (Max Custom Guard Rails) theme={null} { "data": null, "errors": [ { "error": "INVALID_PARAMETER", "message": "Cannot create more than 5 custom guard rails" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload Inbound Phone Numbers Source: https://docs.bland.ai/api-v1/post/inbound-insert POST https://api.bland.ai/v1/inbound/insert Add inbound numbers to Bland from your own Twilio account. See [Custom Twilio Integration](/tutorials/custom-twilio) for more information. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` *required* The encrypted\_key of the Twilio account you want to upload numbers from. Learn more about BYOT [here](/tutorials/custom-twilio). ### Body **numbers** `string[]` *required* **properties** An array of phone numbers you want to upload to Bland. Include the leading `'+'`, country code and the phone number without any special characters. Example: `["+12223334444", "+13334445555"]` ### Response **status** `string` Can be `success` or `error`. **message** `string` A message saying whether the insertion succeeded, or a helpful message describing why it failed. **inserted** `array` An array of phone numbers that were successfully inserted. Any phone numbers that failed to be inserted will not be included in this array - for example if they are already in your account or not associated with the sepcified Twilio account. ```json theme={null} { "status": "success", "message": "Successfully inserted numbers", "inserted": [ "+12223334444", "+13334445555" ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Inbound Phone Number Source: https://docs.bland.ai/api-v1/post/inbound-number-delete POST https://api.bland.ai/v1/inbound/{phone_number}/delete Remove an inbound number that was uploaded through your own Twilio account. See [Custom Twilio Integration](/tutorials/custom-twilio) for more information. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` *required* The `encrypted_key` for the Twilio account that owns the phone number you want to delete. Learn more about BYOT [here](/tutorials/custom-twilio). ### Path **phone\_number** `string` *required* The phone number you want to remove from Bland's system. ### Response **status** `string` Can be `success` or `error`. **message** `string` A message saying whether the deletion succeeded, or a helpful message describing why it failed. ```json theme={null} { "status": "success", "message": "Successfully deleted number from database: +15555555555" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Inbound Number Details Source: https://docs.bland.ai/api-v1/post/inbound-number-update POST https://api.bland.ai/v1/inbound/{phone_number} Update your inbound agent's settings, prompt and other details. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` The `encrypted_key` for the Twilio account that owns the phone number you want to modify. Not required if you are using a Bland phone number. Learn more about BYOT [here](/tutorials/custom-twilio). ### Path Parameters **phone\_number** `string` The inbound phone number you wish to update. Formatting Notes: * The `'+'` or `'%2B'` prefix is optional. * Will assume a US country code if no country code is provided. Valid Examples for `+13334445555`: * `%2B13334445555` * `13334445555` * `3334445555` ### Body **prompt** `string` *required* Provide instructions, relevant information, and examples of the ideal conversation flow. For inbound numbers, consider including additional context about the purpose of the call, and what types of callers to expect. > [accordion] Best Practices > > #### Out-of-the-Box Behaviors (Summarized): > > * Speech pattern: Direct, concise, casual > * Spells out symbols, acronyms, abbreviations, percentages, etc. (\$4,000,000 -> "four million dollars") > * Asks clarifying questions > > #### Prompting Tips: > > * Want to easily test out exactly how your agent will behave? > * [Try out Agent Testing!](https://app.bland.ai/home?page=testing) > * Aim for less than >2,000 characters where possible. > * Simple, direct prompts are the most predictable and reliable. > * Frame instructions positively: > * `"Do this"` rather than `"Don't do this"`. > * Ex. "Keep the conversation casual" rather than "Don't be too formal". > * This gives concrete examples of what to do, instead of leaving expected behavior open to interpretation. **pathway\_id** `string` Set the pathway that your agent will follow. This will override the `prompt` field, so there is no need to pass the 'prompt' field if you are setting a pathway. Warning: Setting a pathway will set the following fields to `null` / their default value - `prompt`, `first_sentence`, `model`, `dynamic_data`, `tools`, `transfer_list` Set to `null` or an empty string to clear the pathway. **pathway\_version** `integer` The version number of the pathway to use for the call. Defaults to the production version. ### Agent Parameters (Body) **voice** `string` Set your agent's voice - all available voices can be found with the [List Voices](/api-v1/get/voices) endpoint. **background\_track** `string` Select an audio track that you'd like to play in the background during the call. The audio will play continuously when the agent isn't speaking, and is incorporated into it's speech as well. Use this to provide a more natural, seamless, engaging experience for the conversation. We've found this creates a significantly smoother call experience by minimizing the stark differences between total silence and the agent's speech. Options: * `null` - Default, will play audible but quiet phone static. * `office` - Office-style soundscape. Includes faint typing, chatter, clicks, and other office sounds. * `cafe` - Cafe-like soundscape. Includes faint talking, clinking, and other cafe sounds. * `restaurant` - Similar to `cafe`, but more subtle. * `none` - Minimizes background noise **first\_sentence** `string` Makes your agent say a specific phrase or sentence for its first response. **summary\_prompt** `string` (Optional) Custom instructions for how the call summary should be generated after the call completes. Use this to provide specific guidance or context for the AI when writing the post-call summary. Maximum length: 2000 characters. Example: ```json theme={null} { "summary_prompt": "Summarize the call in 2-3 sentences, focusing on the customer's main concern and any next steps discussed." } ``` **block\_interruptions** `boolean` (default: false) When set to `true`, the AI will not respond or process interruptions from the user. **interruption\_threshold** `number` (default: 500) Adjusts how patient the AI is when waiting for the user to finish speaking. Lower values mean the AI will respond more quickly, while higher values mean the AI will wait longer before responding. Recommended range: 50-200 * 50: Extremely quick, back and forth conversation * 100: Balanced to respond at a natural pace * 200: Very patient, allows for long pauses and interruptions. Ideal for collecting detailed information. Try to start with 100 and make small adjustments in increments of \~10 as needed for your use case. **model** `string` (default: base) Select a model to use for your call. Options: `base` or `turbo`. In nearly all cases, `base` is the best choice for now. > [accordion] Model Differences > > There are two different ways to use Bland: > > * `model: base` > * The original, follows scripts/procedures most effectively. > * Supports all features and capabilities. > * Best for Custom Tools > * `model: turbo` > * The absolute fastest latency possible, can be verbose at times > * Limited capabilities currently (excludes Transferring, IVR navigation, Custom Tools) > * Extremely realistic conversation capabilities **request\_data** `object` (default: \{}) Request data fields are available to the AI agent during the call when referenced in the associated pathway or task. This data is accessible in variables if the call is answered. For example, let's say in your app you want to programmatically set the name of the person you're calling. You could set `request_data` to: ```json Example theme={null} { "task": "Say hello to the user, who's name is {{name}}", // also works in the prompt, tools, etc. "request_data": { "name": "John Doe" } } ``` **tools** `array` Interact with the real world through API calls. Detailed tutorial here: [Custom Tools](/tutorials/custom-tools) **language** `string` (default: en-US) Select a supported language of your choice. Optimizes every part of our API for that language - transcription, speech, and other inner workings. > [accordion] Expand to view language options > > The available language options are as follows: > > * `auto` - Auto Detect > * `en` - English > * `en-US` - English (US) > * `en-GB` - English (UK) > * `en-AU` - English (Australia) > * `en-NZ` - English (New Zealand) > * `en-IN` - English (India) > * `zh` - Chinese (Mandarin, Simplified) > * `zh-CN` - Chinese (Mandarin, Simplified, China) > * `zh-Hans` - Chinese (Mandarin, Simplified, Hans) > * `zh-TW` - Chinese (Mandarin, Traditional) > * `zh-Hant` - Chinese (Mandarin, Traditional, Hant) > * `es` - Spanish > * `es-419` - Spanish (Latin America) > * `fr` - French > * `fr-CA` - French (Canada) > * `de` - German > * `el` - Greek > * `hi` - Hindi > * `hi-Latn` - Hindi (Latin script) > * `ja` - Japanese > * `ko` - Korean > * `ko-KR` - Korean (Korea) > * `pt` - Portuguese > * `pt-BR` - Portuguese (Brazil) > * `pt-PT` - Portuguese (Portugal) > * `it` - Italian > * `nl` - Dutch > * `pl` - Polish > * `ru` - Russian > * `sv` - Swedish > * `sv-SE` - Swedish (Sweden) > * `da` - Danish > * `da-DK` - Danish (Denmark) > * `fi` - Finnish > * `id` - Indonesian > * `ms` - Malay > * `tr` - Turkish > * `uk` - Ukrainian > * `bg` - Bulgarian > * `cs` - Czech > * `ro` - Romanian > * `sk` - Slovak > * `hu` - Hungarian > * `no` - Norwegian > * `vi` - Vietnamese > * `babel` - Babel (Experimental) **timezone** `string` (default: America/Los\_Angeles) Set the timezone for the call. Handled automatically for calls in the US. This helps significantly with use cases that rely on appointment setting, scheduling, or behaving differently based on the time of day. Timezone options are [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) in the TZ identifier column. **transfer\_phone\_number** `string` A phone number that the agent can transfer to under specific conditions - such as being asked to speak to a human or supervisor. Set to `null` to remove. > [accordion] Prompting Notes > > For best results: > > * Specify conditions that the agent should transfer to a human under (examples are great!) > * In the `task`, refer to the action solely as "transfer" or "transferring". > * Alternate phrasing such as "swap" or "switch" can mislead the agent, causing the action to be ignored. **fallback\_number** `string` A phone number to forward inbound calls to during Bland maintenance windows. Configure this ahead of any announced maintenance period. Setting this field does not affect normal call routing, your agent will continue to handle calls as usual. Bland activates the redirect only during maintenance, at which point calls are immediately forwarded to this number instead of reaching the agent. Set to `null` or an empty string to remove the configured fallback. **memory\_id** `string` Attach a [memory store](/api-v1/post/memory-create) to the inbound agent so calls to this number share context across sessions. Pass the `memory_id` returned by [Create Memory](/api-v1/post/memory-create). Set to `null` or an empty string to detach. **pronunciation\_guide** `array` Array of objects that guides the agent on how to say specific words. Use this to improve clarity for acronyms, names, brand terms, or jargon. ```json theme={null} [ { "word": "example", "pronunciation": "ex-am-ple", "case_sensitive": false, "spaced": false }, { "word": "API", "pronunciation": "A P I", "case_sensitive": true, "spaced": true } ] ``` > [accordion] Object Parameters > > * `word`: the word you want to guide the LLM on how to pronounce > * `pronunciation`: how the AI should pronounce the word, using syllables or space-separated characters. For example, `"A P I"` ensures each letter is spoken clearly rather than read as a word. > * `case_sensitive`: whether or not to consider case. Particularly useful with names. EG: 'Max' the name versus 'max' the word. Defaults to false. `Not required`. > * `spaced`: whether to match whole words only. When true, "high" will match "high" but not "hightop". When false, it will match any word that contains "high". Defaults to true. `Not required`. **transfer\_list** `object` Give your agent the ability to transfer calls to a set of phone numbers. Overrides `transfer_phone_number` if a `transfer_list.default` is specified. Will default to `transfer_list.default`, or the chosen phone number. Example usage to route calls to different departments: ```json theme={null} "transfer_list": { "default": "+12223334444", "sales": "+12223334444", "support": "+12223334444", "billing": "+12223334444" } ``` **dynamic\_data** `object` Integrate data from external APIs into your agent's knowledge. Set to `null` or an empty string to clear dynamic data settings. Detailed usage in the [Send Call](/api-v1/post/calls#param-dynamic-data) endpoint. **interruption\_threshold** `number` (default: 500) Adjusts how patient the AI is when waiting for the user to finish speaking. Lower values mean the AI will respond more quickly, while higher values mean the AI will wait longer before responding. Recommended range: 50-200 * 50: Extremely quick, back and forth conversation * 100: Balanced to respond at a natural pace * 200: Very patient, allows for long pauses and interruptions. Ideal for collecting detailed information. Try to start with 100 and make small adjustments in increments of \~10 as needed for your use case. **keywords** `string[]` (default: \[]) These words will be boosted in the transcription engine - recommended for proper nouns or words that are frequently mis-transcribed. For example, if the word "Reece" is frequently transcribed as a homonym like "Reese" you could do this: ```json theme={null} { "keywords": ["Reece"] } ``` For stronger keyword boosts, you can place a colon then a boost factor after the word. The default boost factor is 2. ```json theme={null} { "keywords": ["Reece:3"] } ``` **noise\_cancellation** `boolean` (default: false) Toggles noise filtering or suppression in the audio stream to filter out background noise. **ignore\_button\_press** `boolean` (default: false) When `true`, DTMF (digit) presses are ignored, disabling menu navigation or call transfers triggered by keypad input. ### Call Settings (Body) **max\_duration** `integer` (default: 30) When the call starts, a timer is set for the `max_duration` minutes. At the end of that timer, if the call is still active it will be automatically ended. Example Values: `20, 2` **webhook** `string` When the call ends, we'll send the call details in a POST request to the URL you specify here. The request body will match the response from the [GET /v1/calls/:call\_id](/api-v1/get/calls-id) endpoint. **webhook\_events** `array` Specify which events you want to stream to the webhook, during the call. Options: * `queue` * `call` * `latency` * `webhook` * `tool` * `dynamic_data` * `citations` (Sent separately, Enterprise only) Example payloads: ```json queue theme={null} // ex 1 { "message": "Call enqueued", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "queue", "log_level": "info" } ``` ```json call theme={null} // ex 1 { "message": "Call connected", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 2 { "message": "Sending first sentence: Hello, thank you for reaching out. I'd like to get to know you a bit better. How are you feeling today?", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 3 { "message": "Agent speech: Hello, thank you for reaching out.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 4 { "message": "Handling user speech: Yeah. I'm thirty six. And I'm five foot nine.", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "call", "log_level": "info" } // ex 5 { "message": "Webhook Response: 200 | Webhook Response Data: [object Object] | Response Time: 689ms", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json latency theme={null} // ex 1 { "message": "TTS: 218ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } // ex 2 { "message": "LLM: 266ms", "call_id": "12345678-1234-1234-1234-123456789abc", "category": "latency", "log_level": "performance" } ``` ```json webhook theme={null} { "message": "Storing dynamic data messages: \n\n answer : \"true\"", "call_id": "87654321-4321-4321-4321-cba987654321", "category": "call", "log_level": "info" } ``` ```json tool theme={null} { "message": "Executing custom tool: Test Tool 4 with input: [object Object]", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json dynamic_data theme={null} { "message": "Storing dynamic data: \n\n vector_data : {\"data\":{\"results\":[{\"id\":\"fedcba98-7654-3210-fedc-ba9876543210\",\"input_text\":\"Here are details on the restaurant...\",\"similarity\":0.103339002763233,\"chunk_index\":0}]},\"errors\":null}", "call_id": "abcdef12-3456-7890-abcd-ef1234567890", "category": "call", "log_level": "info" } ``` ```json citations theme={null} { "call_id": "12345678-1234-1234-1234-123456789abc", "user_id": "11111111-2222-3333-4444-555555555555", "event_type": "citations", "timestamp": "2025-07-03T16:41:15.231Z", "citations": [ { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "User height", "variable_type": "boolean", "value": true, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller Age", "variable_type": "number", "value": 36, "cited_utterances": [ { "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "idx": 3, "start_time": 24.096, "end_time": 27.424, "confidence": 0.17166666666666666, "channel": 1, "transcript": "I am 36 and I am 5'9\".", "speaker_id": "SPEAKER_1_0", "speaker_name": null, "speaker_description": null, "topics": [ "customer_information_provided" ], "topics_meta": "{\"customer_information_provided\":\"customer providing personal details\"}", "utterance_type": "answer" }, { "id": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff", "idx": 4, "start_time": 30.56, "end_time": 35.455, "confidence": 0.5672727272727273, "channel": 0, "transcript": "All right. So you're 36 years old and five foot nine. That's great. How's your day been so far? Anything exciting happened?", "speaker_id": "SPEAKER_0_0", "speaker_name": null, "speaker_description": null, "topics": [ "day_review_inquiry" ], "topics_meta": "{\"day_review_inquiry\":\"agent inquiring about the customer's day and any exciting events\"}", "utterance_type": "question" } ], "schema_id": "99999999-8888-7777-6666-555555555555" }, { "call_id": "12345678-1234-1234-1234-123456789abc", "variable_name": "Caller feeling", "variable_type": "string", "value": null, "cited_utterances": [], "schema_id": "99999999-8888-7777-6666-555555555555" } ] } ``` **metadata** `object` Add any additional information you want to associate with the call. This can be useful for tracking or categorizing calls. **summary\_prompt** `string` At the end of each call, a `summary` is generated based on the transcript - you can use this field to add extra instructions and context for how it should be summarized. For example: `"Summarize the call in French instead of English."` **record** `boolean` (default: true) Controls whether inbound calls to this number are recorded. New phone numbers have recording enabled by default. Set `record` to `false` to turn recording off for this number. When a call completes, you can access the recording through the `recording_url` field in the call details or your webhook. **citation\_schema\_ids** `string[]` The citation schema is an incredibly powerful tool for running ***post call analysis***, including specific variable extractions, conditional logic, and more. You can build a citation schema [here](https://app.bland.ai/dashboard/analytics?tab=citations). > Note: Citation schemas are very powerful and accurate, but also are more resource intensive to run. As such, for the time being, they are an enterprise-only feature. ### Response **status** `string` Whether the update was successful or not - will be `success` or `error`. **message** `string` A message describing the status of the update. **updates** `object` An object containing the updated settings for the inbound number. **failed\_updates** `object` If the update was unsuccessful, this will contain the settings that failed to update. Useful to determine how your request is being interpreted on our end. ```json Response theme={null} { "status": "success", "message": "Successfully updated number +18584139939.", "updates": { "prompt": "(Your prompt)", "voice": "Karen", "webhook": null, "first_sentence": "Roberta speaking, how can I help you?", "record": false, "max_duration": 30, "model": "base", //... } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Set Voice Pool Source: https://docs.bland.ai/api-v1/post/inbound-number-voice-pool POST https://api.bland.ai/v1/inbound/{phone_number}/voice-pool Replace the voice pool on an inbound number. ## Overview Sets the voices an inbound number rotates through. Each inbound call picks one voice from the pool at random, so the same number can answer in a different voice each time. This replaces the whole pool rather than adding to it. Send the full set of voices you want every time, and send an empty array to clear the pool. Read the current pool with [Get Voice Pool](/api-v1/get/inbound-number-voice-pool). A rejected request leaves the current pool untouched, so a validation error cannot cost you the voices already set. > [!NOTE] > > Two things override the pool: an agent attached to the number, and a `voice` passed to [Create Inbound Session](/api-v1/post/inbound-session) when the call starts from a session. In either case the pool is ignored. > > The number's own voice setting does not override it. Where a pool is set, it takes the place of that voice on every call. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **phone\_number** `string` *required* The inbound number to configure, in E.164 format (for example `+15551234567`). SIP DIDs are matched in the form they are stored, so a numeric DID such as `9994221001` also resolves. *** ## Body Parameters **voice\_ids** `array` *required* The voices to put in the pool. At most 20, or the request is rejected with a 400. Each must be a voice `id` from [List Voices](/api-v1/get/voices), which is a UUID, not the provider-facing `voice_id` string on the same object. You can use any public voice, plus the cloned voices your organization owns. ```json theme={null} { "voice_ids": [ "bad67584-9418-4c30-acf2-eb07d4f4fac7", "89bf6194-d860-4126-be95-190d5bf2d0f9", "76c0d2ee-8e9d-40a1-83f7-aa39244a004c" ] } ``` An ID that is a well-formed UUID but does not match a voice you can use is dropped without an error. Compare `count` in the response against the number you sent to catch this. *** ## Response **data** `object` **data fields** **count** `integer` How many voices are now in the pool. Lower than the number of IDs you sent if any were dropped or duplicated. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "count": 3 }, "errors": null } ``` ```json Too Many Voices theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Maximum number of voices is 20" } ] } ``` ```json Invalid Request theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "invalid voice_ids" } ] } ``` ```json Unauthorized Voices theme={null} { "data": null, "errors": [ { "error": "UNAUTHORIZED", "message": "Unauthorized voices" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Inbound number not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Purchase Phone Number Source: https://docs.bland.ai/api-v1/post/inbound-purchase POST https://api.bland.ai/numbers/purchase Purchase a new phone number (inbound/outbound). ($15/mo. subscription using your stored payment method). ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **area\_code** `string` (default: 415) Choose a three-digit area code for your phone number. If set as a parameter, a number will only be purchased by exact match if available. **country\_code** `string` (default: US) Choose a country code for your phone number. Options: `"US"` or `"CA"` for Canada. For others, please contact support. **phone\_number** `string` Specify an exact phone number you'd like to use. If provided, will override the `area_code` parameter and does not fall back to any other number. Example of the correct format (Note the `"+1"` is mandatory): `"+12223334444"` *** Docs for agents: [llms.txt](/llms.txt) # Create Inbound Session Source: https://docs.bland.ai/api-v1/post/inbound-session POST https://api.bland.ai/v1/inbound/session Create a session token that can be used to pass variables to inbound calls via SIP headers. This allows you to tie specific data to a call session before the call is initiated. This endpoint creates a session token that can be used to pass variables to inbound calls when connecting via SIP. When you create a session using this endpoint, you receive a token that can be passed as the `x-bland-session-id` SIP header. Any call made to your inbound number with this header will automatically include the variables you specified when creating the session. **Use Case**: This is particularly useful when you need to pass context or variables to an inbound call before the caller connects. For example, you might want to include customer information, campaign data, or other relevant context that your pathway can access during the call. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The inbound phone number that this session will be associated with. This should be a phone number you own and have configured for inbound calls. Example format: `"+12223334444"` **request\_data** `object` Optional variables that will be available in your pathway when a call is made using this session token. These variables can include any data you want to pass to the call context. Example: ```json theme={null} { "customer_id": "12345", "campaign_name": "summer_promotion", "user_tier": "premium" } ``` **voice** `string` The voice of the agent to use for the call. This can be the name, or the ID of the voice. Example: ```json theme={null} { "voice": "June" } ``` ### Response **token** `string` The session token that should be passed as the `x-bland-session-id` SIP header when making the inbound call. **expires\_at** `string` ISO 8601 timestamp indicating when this session token expires. Sessions have a limited lifetime for security purposes. The default is 1 hour. ### SIP Integration To use the session token: 1. Create a session using this endpoint 2. When making a SIP call to your inbound number, include the header: `x-bland-session-id: ` 3. Your Bland call will have access to any variables you specified in the `request_data` field, in addition to any variables you had initially set up for the inbound number. ### Example ```bash theme={null} curl -X POST https://api.bland.ai/v1/inbound/session \ -H "authorization: Bearer sk-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+12223334444", "request_data": { "customer_id": "12345", "campaign_name": "summer_promotion", "priority": "high" }, "voice": "June" }' ``` Response: ```json theme={null} { "token": "550e8400-e29b-41d4-a716-446655440000", "expires_at": "2024-01-15T10:30:00Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Inbound Number Label Source: https://docs.bland.ai/api-v1/post/inbound-update-label POST https://api.bland.ai/inbound/update_label Update the label shown for one of your inbound phone numbers. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phoneNumber** `string` *required* The inbound phone number whose label you want to update. Required format: E.164 (for example, `+12223334444`). **newLabel** `string` *required* The new label to assign to this inbound number. Constraints: * Max length: `150` characters * Set to an empty string (`""`) to clear the label ### Response **data** `object` Success response data. **data.message** `string` Success message. **data.phone\_number** `string` The inbound phone number that was updated. **data.label** `string` The updated label value. **errors** `null` Error array (null on success). ```json Success theme={null} { "data": { "message": "Label updated successfully", "phone_number": "+18669659045", "label": "apitest" }, "errors": null } ``` ```json Invalid request body (400) theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Invalid request body" } ] } ``` ```json Label too long (400) theme={null} { "data": null, "errors": [ { "error": "LABEL_TOO_LONG", "message": "Label is too long" } ] } ``` ```json Auth failure (401) theme={null} { "data": null, "errors": [ { "error": "AUTH_FAILURE", "message": "Unauthorized" } ] } ``` ```json Not found (404) theme={null} { "error": "Phone number not found" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create API Key Source: https://docs.bland.ai/api-v1/post/keys-create POST https://api.bland.ai/keys/create Create a full-access or restricted API key for your organization. ### Headers **authorization** `string` *required* Your API key for authentication. Restricted keys cannot create keys, so use a full-access key. ### Body **type** `string` *required* The kind of key to create. Use `org` for an organization key. Restricted keys require `org`. **target\_id** `string` The ID of your organization. Required when `type` is `org`. The key is created for the organization your credentials belong to, and you must be an owner or admin of it. **name** `string` A label for the key, up to 64 characters. Omit it or pass `null` to leave the key unnamed. **scopes** `string[]` The permissions for a restricted key. Omit it to create a full-access key. When present, it must be a non-empty list of the permissions in [Restricted keys](#restricted-keys), which also says what each one allows. Restricted key creation is rolling out by organization. When it is not enabled for yours, the request returns `403` with the error `SCOPED_KEYS_NOT_ENABLED`. When your organization runs on a pinned deployment, the request returns `409` with the error `RESTRICTED_KEYS_UNAVAILABLE`. See [Pinned deployments](#pinned-deployments). When your organization has no full-access key, the request returns `409` with the error `NO_FULL_ACCESS_KEY`. See [Keep one full-access key](#keep-one-full-access-key). ### Response **data** `object` The created key. **data.key** `string` The full API key. This is the only time the full value is returned, so store it securely. Restricted keys start with `org_s_`. **data.name** `string | null` The key's name, or `null` if it has none. **data.scopes** `string[] | null` The permissions the key holds, with implied permissions included. `null` means the key has full access. **errors** `null | array` `null` on success, or a list of errors. ## Restricted keys A restricted key can only call the endpoints its permissions cover. Use one when you hand a key to a contractor, a CI job, or an integration that needs part of your account and not all of it. For short-lived access tokens instead of a long-lived key, use an [OAuth client](/api-v1/oauth-client-credentials). Clients use the same permissions. Permissions are named by resource and action. Every resource has a read permission. Most also have a write permission, or an action permission for work that spends credits or sends messages. The table lists what each permission opens for a restricted key, and what stays closed to every restricted key no matter which permissions it holds. | Resource | Scopes | What they open | What stays denied | | - | - | - | - | | Agents | `agents:read`, `agents:write` | `agents:read` reads agents and pathways, their versions, folders, branches, and the node library, and a call's node snapshot. `agents:write` adds creating, editing, deleting, publishing, promoting, and rolling back pathways and agents, plus folders, library blocks, deleting node-library entries, and branch rebase and merge. It can use your organization's stored secrets and connected credentials in webhooks, tools, and dynamic data. | Cloning pathways, creating or editing node-library entries, sharing and access changes, collaboration sessions, migrations, copilot and prompt generation, prompt improvement, test agents, pathway SMS, node flagging, simulations, experiments, rollouts, and the GitHub integration. | | Calls | `calls:read`, `calls:create`, `calls:stop` | `calls:read` reads the call list, call details, transcripts, recordings, pathway events, prompts, model contexts, analysis, the event stream, batch logs, and call exports. `calls:create` places calls and batches, billed to your organization. It can use your organization's stored secrets and connected credentials in webhooks, tools, and dynamic data. `calls:stop` stops one call or one batch. | The batch list and batch detail, live call lists, metrics and settings, listening in, transcript streams and tokens, transcript correction, bulk stop and transfer, simulated calls, call voice reads, and call deletion. | | Knowledge | `knowledge:read`, `knowledge:write` | `knowledge:read` reads sources, the map, the gap list and counts, the query log, the version list, and a knowledge base's suggestion list. `knowledge:write` adds sources (file, text, web, or integration), crawls, edits, replaces, reindexes, syncs, restores, deletes, and answers or triages gaps. | Content reads, single-version reads and their storage URLs, a single gap or suggestion, model answers (chat and answer), anchor suggestions, improve, feedback, the legacy vector migration, analytics, download, and the org file store. | | Dispositions | `dispositions:read`, `dispositions:write` | `dispositions:read` reads an agent's dispositions, extractors, versions, the judge, variable, model-profile, and extractor catalogues, and test-run results and annotations, plus the legacy dispositions list. `dispositions:write` adds authoring, publishing, rolling back, disabling, and deleting them, cost estimates, and writing test-run annotations. A published disposition runs on every call, billed to your organization. | Test runs, backfills, align, legacy disposition writes and script runs, script generation, and dispositions migrations. | | Evals | `evals:read`, `evals:run` | `evals:read` reads judge templates (built-in and saved), call sets, setups and their versions, and the evaluation status. `evals:run` creates, edits, and deletes saved judge templates, call sets, and setups, and publishes setups and their versions. | Judges themselves (creating, reading, editing, and aligning them), runs (starting, estimating, cancelling, correcting, applying run labels, and reading results), post-run AI analysis, AI judge drafts from triage, and voicemail evaluation. Starting a run needs a full-access key. | | SMS | `sms:read`, `sms:send` | `sms:read` lists SMS conversations and reads messaging number settings and iMessage app capabilities. `sms:send` sends messages, including as a persona, which rebinds the number to that persona; triggers and batches conversations; and hands conversations to a human, lets the human reply, hands them back, or ends them, all billed to your organization. | Conversation detail and messages, webhook logs and resend, SMS number settings and number updates, A2P and RCS registration, SMS configuration writes, and pathway SMS. | | Analytics | `analytics:read` | Organization and agent summaries, caller geography, pathway flow and loops, call citations, conversation selections, saved boards, and panel templates. | Analytics queries (`POST /v2/analytics/query`), which can start a Norm session. Board, panel, and conversation-selection writes, and shared reports. | | Voices | `voices:read`, `voices:generate` | `voices:read` reads the voice catalogue, cost quotes, name checks, instant-clone transcripts and source audio, migration info, generation history and usage, and languages. `voices:generate` generates speech from text through `POST /v2/tts` and `POST /v2/audio/speech`, billed to your organization. | Single-voice detail, settings, and samples; deleting, renaming, and configuring voices; editing clone and sample transcripts; saving a catalogue voice to your library; the legacy `/v1/speak` endpoints; voice training and datasets, draft-voice samples, migration between services, publishing and duplicating, legacy clone sample audio, the Creator Program, and Speech limit-raise requests. | | Tests | `tests:read`, `tests:run` | `tests:read` reads test cases, their eval agents and source calls, runs, and simulation results. `tests:run` creates, edits, deletes, and reassigns cases, sets their eval agents, attaches source calls, and runs and simulates cases. A run dispatches the agent's webhook and tool nodes for real, billed to your organization. | Model-driven case generation, regeneration, and run analysis, template seeding, batch, simulation-set, and tornado runs, and the Test Bed. | Personas, phone numbers, tools, alerts, and automations have no permissions yet. Their responses can carry stored credentials (tool headers, webhook authentication, imported-number credentials, alert delivery inputs, and pipeline webhook configuration), so they stay full-access only until their reads hide those values. ### Create a restricted key in the dashboard You must be an owner or admin of your organization. 1. Go to Settings > API keys and select **Create API key**. 2. Optionally, enter a name. Under **Permissions**, choose **Restricted**. If you don't see **Restricted**, see [Pinned deployments](#pinned-deployments). 3. Pick at least one permission. In the grid, a resource and an action together make a permission. For example, **Calls** and **Read** is `calls:read`, and **Evals** and **Manage** is `evals:run`. A permission that another pick includes shows as checked and locked. 4. Select **Create API key**, then copy the key. Bland shows the full key only once. ### Permissions that include others A write permission includes its resource's read permission. The action permissions `evals:run`, `sms:send`, `tests:run`, and `voices:generate` include their resource's read permission too. `calls:create` includes `calls:stop`, so a key can end the calls it places. The `scopes` field in the response and in [List API Keys](/api-v1/post/keys-list) shows the full set. The dashboard's key list hides a permission when another permission on the same key includes it. ### Names shared with the hosted MCP server `calls:create`, `calls:stop`, and `evals:run` are also OAuth scopes for the hosted MCP server. Placing and stopping calls mean the same thing on both. For a key, `evals:run` opens creating, editing, and deleting saved judge templates, call sets, and setups, and starting a run still needs a full-access key. For an MCP app it runs evaluations. ### Permissions you can grant Key creation accepts only permissions that open something today, which is every permission in the table. Any other value returns `400` with the error `INVALID_SCOPES`, and the message lists the accepted set. Every restricted key can also read your account details (`GET /v1/me`), the voice catalogue (`GET /v1/voices`), and the list and details of your knowledge bases without their description or metadata (`GET /v1/knowledge` and `GET /v1/knowledge/:id`), since pathways reference voices and knowledge bases. The model list (`GET /v1/models`) needs no key. ### Requests outside a key's permissions A request to an endpoint the key's permissions do not cover returns `403` with a `WWW-Authenticate: Bearer error="insufficient_scope"` header. The body names the permission that would allow the request when one exists. ```json 403 Response theme={null} { "data": null, "errors": [ { "error": "INSUFFICIENT_SCOPE", "message": "string", "required_scope": "calls:create" } ] } ``` New endpoints are denied to restricted keys until they are assigned a permission. ### What restricted keys cannot do * Create, list, rename, or delete API keys. * Use the hosted MCP server at `/v1/mcp`. * Exchange the key for a session token or another key. ### Restricted keys belong to the organization A restricted key keeps working when the member who created it leaves the organization, changes role, or is banned. The key list shows who created each key so an admin can review it, and an admin revokes a key with [Delete API Key](/api-v1/delete/keys-delete). Someone who leaves with a copy of a key keeps its access until an admin deletes it, so revoke keys as part of offboarding. ### Pinned deployments Restricted keys are not available to organizations on a pinned deployment. When restricted key creation is enabled for your organization, creating one returns `409` with the error `RESTRICTED_KEYS_UNAVAILABLE`, and the dashboard shows Restricted disabled with an upgrade explanation. When the rollout is not enabled, the dashboard hides Restricted and creation returns `403` with `SCOPED_KEYS_NOT_ENABLED`. Full-access keys work as usual. ### Keep one full-access key Your organization must keep at least one full-access key while it has restricted keys. Live calls and dashboard sessions depend on it. [Delete API Key](/api-v1/delete/keys-delete) refuses to delete the last one, and creating a restricted key while your organization has none returns `409` with the error `NO_FULL_ACCESS_KEY`. ```json Full access theme={null} { "data": { "key": "org_9f3c...", "name": "Production server", "scopes": null }, "errors": null } ``` ```json Restricted theme={null} { "data": { "key": "org_s_4b1e...", "name": "Pathway CI", "scopes": ["agents:read", "agents:write", "calls:create", "calls:stop"] }, "errors": null } ``` ```json Restricted Keys Unavailable theme={null} { "data": null, "errors": [ { "error": "RESTRICTED_KEYS_UNAVAILABLE", "message": "string" } ] } ``` ```json Invalid Scopes theme={null} { "data": null, "errors": [ { "error": "INVALID_SCOPES", "message": "string" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List API Keys Source: https://docs.bland.ai/api-v1/post/keys-list POST https://api.bland.ai/keys/list List your organization's API keys and the permissions each one holds. ### Headers **authorization** `string` *required* Your API key for authentication. Restricted keys cannot list keys. ### Body **type** `string` *required* The kind of keys to list. Use `org` for organization keys. **target\_id** `string` The ID of your organization. Required when `type` is `org`. You must be an owner or admin of it. ### Response **data.keys** `array` The organization's keys. Each entry identifies a key by its first 14 characters and never includes the full value. **data.keys\[].key** `string` The first 14 characters of the key. Pass this value to [Rename API Key](/api-v1/patch/keys-rename) and [Delete API Key](/api-v1/delete/keys-delete). **data.keys\[].owner** `string` The ID of the user who created the key, when known. A restricted key belongs to the organization and keeps working after its creator leaves. **data.keys\[].name** `string | null` The key's name, or `null` if it has none. **data.keys\[].scopes** `string[] | null` The permissions the key holds, with implied permissions included. `null` means the key has full access. See [Restricted keys](/api-v1/post/keys-create#restricted-keys). **data.scoped\_keys\_enabled** `boolean` Whether your organization can create restricted keys. When `false`, `POST /keys/create` with `scopes` returns `403` with the error `SCOPED_KEYS_NOT_ENABLED`. **data.restricted\_keys\_available** `boolean` Whether restricted key creation is currently available for your organization. This is `false` when the rollout is not enabled, your organization runs on a pinned deployment, or the availability check fails. `POST /keys/create` checks again: it returns `403` with `SCOPED_KEYS_NOT_ENABLED` when the rollout is not enabled, or `409` with `RESTRICTED_KEYS_UNAVAILABLE` when enabled but blocked by a pinned deployment. A `false` value alone does not identify the reason. See [Pinned deployments](/api-v1/post/keys-create#pinned-deployments). **errors** `null | array` `null` on success, or a list of errors. ```json Response theme={null} { "data": { "keys": [ { "key": "org_9f3c1a7b2d", "owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f", "name": "Production server", "scopes": null }, { "key": "org_s_4b1e9c07", "owner": "3c2f7a91-1b4e-4d6a-9e0f-5a8b7c6d5e4f", "name": "Pathway CI", "scopes": ["agents:read", "agents:write"] } ], "scoped_keys_enabled": true, "restricted_keys_available": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Chat with Knowledge Base Item Source: https://docs.bland.ai/api-v1/post/knowledge-chat POST https://api.bland.ai/v1/knowledge/chat Performs a conversational query against knowledge base items with context. Query a knowledge base item using natural language and receive contextual responses. This endpoint supports both direct queries and conversational context through message history. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `application/json`. ### Body Parameters **messages** `array` Array of chat messages for conversational context. Use this for multi-turn conversations. **messages\[].role** `string` *required* The role of the message sender (e.g., "user", "assistant", "system"). **messages\[].content** `string` *required* The content of the message. **knowledge\_base\_id** `string` *required* The ID of the knowledge base item to query against. ### Response **data** `object` Chat response with contextual information. **data.response** `string` The AI-generated response based on the knowledge base item content. **data.context** `string` Additional context information used to generate the response. **data.sources** `array` Array of source documents that were used to generate the response. **data.sources\[].id** `string` Unique identifier of the source document. **data.sources\[].content** `string` Relevant content from the source document. **data.sources\[].metadata** `object` Additional metadata about the source document. **errors** `null` Will be `null` on successful query. ```json Success Response theme={null} { "data": { "response": "Our refund policy allows for full refunds within 30 days of purchase. For products purchased more than 30 days ago, we offer store credit or exchanges. Please contact our customer service team at support@example.com to initiate a refund request.", "context": "Based on company policy documentation regarding refunds and returns", "sources": [ { "id": "doc_01H8X9QK5R2N7P3M6Z8W4Y1V7V", "content": "Refund Policy: Full refunds are available within 30 days of purchase...", "metadata": { "document_type": "policy", "section": "refunds", "last_updated": "2025-01-01" } } ] }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "KB_ERROR", "message": "Knowledge base not found or not accessible" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Discover Sitemap URLs Source: https://docs.bland.ai/api-v1/post/knowledge-crawl POST https://api.bland.ai/v1/knowledge/crawl Discovers URLs from a website's sitemap for web scraping. Analyzes a website to discover available URLs from its sitemap. This is useful for finding all the pages available on a website before creating a web scraping knowledge base item. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `application/json`. ### Body Parameters **url** `string` *required* The base URL of the website to discover sitemap URLs from. ### Response **data** `object` Discovered URLs and sitemap information. **data.urls** `string[]` Array of discovered URLs from the website's sitemap. **data.sitemap\_url** `string` The sitemap URL that was found and processed (if any). **errors** `null` Will be `null` on successful discovery. ```bash cURL theme={null} curl -X POST https://api.bland.ai/v1/knowledge/crawl \ -H "authorization: Bearer YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{ "url": "https://example.com" }' ``` ```json Request Body theme={null} { "url": "https://docs.example.com" } ``` ```json Success Response theme={null} { "data": { "urls": [ "https://example.com/", "https://example.com/about", "https://example.com/products", "https://example.com/contact", "https://example.com/docs/getting-started", "https://example.com/docs/api-reference", "https://example.com/docs/tutorials" ], "sitemap_url": "https://example.com/sitemap.xml" }, "errors": null } ``` ```json No Sitemap Found theme={null} { "data": { "urls": [], "sitemap_url": null }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "INVALID_INPUT", "message": "Invalid URL provided" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload File Source: https://docs.bland.ai/api-v1/post/knowledge-learn-file POST https://api.bland.ai/v1/knowledge/learn Creates a new knowledge base item by uploading a file. Upload a file to create a knowledge base item that can be used to provide contextual information to your AI agents. Supported file formats include PDF, Word documents, text files, and more. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `multipart/form-data` for file uploads. ### Body Parameters (multipart/form-data) **type** `string` *required* (default: file) Must be `"file"` for file uploads. **name** `string` KB name (defaults to filename if not provided). **description** `string` Optional description of the knowledge base item content. **file** `file` *required* The file to upload and process into a knowledge base item. ### Response **data** `object` The created knowledge base item object. **data.id** `string` Unique identifier for the knowledge base item. **data.name** `string` Name of the knowledge base item. **data.description** `string` Description of the knowledge base item (if provided). **data.status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.type** `string` Will be `"FILE"` for file-based knowledge base items. **data.created\_at** `string` ISO timestamp of creation. **data.updated\_at** `string` ISO timestamp of last update. **data.error\_message** `string` Error message if status is `"FAILED"`. **data.file** `object` File information for the uploaded file. **data.file.file\_name** `string` Original filename. **data.file.file\_size** `number` File size in bytes. **data.file.file\_type** `string` MIME type of the file. **errors** `null` Will be `null` on successful creation. ```bash cURL theme={null} curl -X POST https://api.bland.ai/v1/knowledge/learn \ -H "authorization: Bearer YOUR_API_KEY" \ -F "type=file" \ -F "name=Company FAQs" \ -F "description=Frequently asked questions and policies" \ -F "file=@company_faqs.pdf" ``` ```bash With Default Name theme={null} curl -X POST https://api.bland.ai/v1/knowledge/learn \ -H "authorization: Bearer YOUR_API_KEY" \ -F "type=file" \ -F "description=Product documentation" \ -F "file=@product_docs.pdf" ``` ```json Success Response theme={null} { "data": { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T", "name": "Company FAQs", "description": "Frequently asked questions and policies", "status": "PROCESSING", "type": "FILE", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T10:30:00Z", "file": { "file_name": "company_faqs.pdf", "file_size": 2048576, "file_type": "application/pdf" } }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "KB_UPLOAD_LIMIT_EXCEEDED", "message": "You have reached your knowledge base upload limit" } ] } ``` ```json Rate Limited Response theme={null} { "data": null, "errors": [ { "error": "KB_UPLOAD_RATE_LIMITED", "message": "Please wait 10 seconds between knowledge base uploads, or wait for your current upload to complete." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload Text Source: https://docs.bland.ai/api-v1/post/knowledge-learn-text POST https://api.bland.ai/v1/knowledge/learn Creates a new knowledge base item from direct text input. Create a knowledge base item by providing text content directly in the request. This is ideal for when you have structured text content that you want to make searchable for your AI agents. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `application/json` for text-based knowledge base items. ### Body Parameters **type** `string` *required* (default: text) Must be `"text"` for text-based knowledge base items. **name** `string` *required* Name for the knowledge base item. **description** `string` Optional description of the knowledge base item content. **text** `string` *required* Text content to be stored in the knowledge base item (maximum 1MB). ### Response **data** `object` The created knowledge base item object. **data.id** `string` Unique identifier for the knowledge base item. **data.name** `string` Name of the knowledge base item. **data.description** `string` Description of the knowledge base item (if provided). **data.status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.type** `string` Will be `"TEXT"` for text-based knowledge base items. **data.created\_at** `string` ISO timestamp of creation. **data.updated\_at** `string` ISO timestamp of last update. **data.error\_message** `string` Error message if status is `"FAILED"`. **errors** `null` Will be `null` on successful creation. ```bash cURL theme={null} curl -X POST https://api.bland.ai/v1/knowledge/learn \ -H "authorization: Bearer YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{ "type": "text", "name": "Product Information", "description": "Product specifications and features", "text": "Our flagship product offers advanced AI capabilities with industry-leading accuracy. It supports multiple languages, real-time processing, and seamless integration with existing systems. The product includes comprehensive APIs, detailed documentation, and 24/7 support." }' ``` ```json Request Body theme={null} { "type": "text", "name": "Company Policies", "description": "Internal policies and procedures", "text": "1. Work Hours: Standard work hours are 9 AM to 5 PM, Monday through Friday.\n2. Remote Work: Employees may work remotely up to 3 days per week with manager approval.\n3. Time Off: All employees accrue 15 days of PTO annually.\n4. Equipment: Company laptops must be returned within 30 days of termination." } ``` ```json Success Response theme={null} { "data": { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V6U", "name": "Product Information", "description": "Product specifications and features", "status": "PROCESSING", "type": "TEXT", "created_at": "2025-01-15T11:00:00Z", "updated_at": "2025-01-15T11:00:00Z" }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "INVALID_INPUT", "message": "Text content exceeds maximum size of 1MB" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Scrape Websites Source: https://docs.bland.ai/api-v1/post/knowledge-learn-web POST https://api.bland.ai/v1/knowledge/learn Creates a new knowledge base item by scraping content from web URLs. Create a knowledge base item by scraping content from one or more web URLs. This is perfect for creating knowledge base items from documentation sites, blog posts, or other web-based content. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `application/json` for web scraping knowledge base items. ### Body Parameters **type** `string` *required* (default: web) Must be `"web"` for web scraping knowledge base items. **name** `string` *required* Name for the knowledge base item. **description** `string` Optional description of the knowledge base item content. **urls** `string[]` *required* Array of URLs to scrape (maximum 100 URLs). ### Response **data** `object` The created knowledge base item object. **data.id** `string` Unique identifier for the knowledge base item. **data.name** `string` Name of the knowledge base item. **data.description** `string` Description of the knowledge base item (if provided). **data.status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.type** `string` Will be `"WEB_SCRAPE"` for web scraping knowledge base items. **data.source\_urls** `string` Source URLs that were scraped (comma-separated). **data.base\_url** `string` Base URL derived from the provided URLs. **data.created\_at** `string` ISO timestamp of creation. **data.updated\_at** `string` ISO timestamp of last update. **data.error\_message** `string` Error message if status is `"FAILED"`. **errors** `null` Will be `null` on successful creation. ```bash cURL theme={null} curl -X POST https://api.bland.ai/v1/knowledge/learn \ -H "authorization: Bearer YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{ "type": "web", "name": "Documentation", "description": "Complete product documentation", "urls": [ "https://docs.example.com/overview", "https://docs.example.com/api-reference", "https://docs.example.com/tutorials" ] }' ``` ```json Single URL theme={null} { "type": "web", "name": "Blog Posts", "description": "Latest company blog posts", "urls": [ "https://example.com/blog/latest-features" ] } ``` ```json Multiple URLs theme={null} { "type": "web", "name": "Support Documentation", "description": "Customer support and FAQ pages", "urls": [ "https://support.example.com/faq", "https://support.example.com/troubleshooting", "https://support.example.com/getting-started", "https://support.example.com/advanced-features" ] } ``` ```json Success Response theme={null} { "data": { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V7V", "name": "Documentation", "description": "Complete product documentation", "status": "PROCESSING", "type": "WEB_SCRAPE", "source_urls": "https://docs.example.com/overview,https://docs.example.com/api-reference,https://docs.example.com/tutorials", "base_url": "https://docs.example.com", "created_at": "2025-01-15T12:00:00Z", "updated_at": "2025-01-15T12:00:00Z" }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "INVALID_INPUT", "message": "URLs array cannot exceed 100 items" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Contact Memory Source: https://docs.bland.ai/api-v1/post/memory-contact POST https://api.bland.ai/v1/memory/contact Create a memory record for a contact scoped to a persona or agent number. If a record already exists for that pair, it is returned instead of creating a duplicate. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **contact\_id** `string` *required* The unique identifier of the contact. **persona\_id** `string` The persona ID for memory scoping. Either `persona_id` or `agent_number` is required. **agent\_number** `string` The agent phone number for memory scoping. Either `persona_id` or `agent_number` is required. ### Response **data** `object` Response containing the memory and creation status. **data.memory** `object` The contact memory object. **data.memory.id** `string` Unique identifier for the contact memory. **data.memory.org\_id** `string` Organization ID this memory belongs to. **data.memory.contact\_id** `string` Contact ID this memory is associated with. **data.memory.persona\_id** `string` Persona ID this memory is scoped to (null if agent-based). **data.memory.agent\_number** `string` Agent phone number this memory is scoped to (null if persona-based). **data.memory.summary** `string` Rolling summary (empty for new memories). **data.memory.facts** `object` Structured facts (empty object for new memories). **data.memory.recent\_messages** `array` Recent messages array (empty for new memories). **data.created** `boolean` Whether a new memory was created (true) or an existing one was returned (false). **errors** `null` Error array (null on success). ```json New Memory Created theme={null} { "data": { "memory": { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": null, "facts": {}, "recent_messages": [], "open_items": [], "memory_history": [], "created_at": "2025-07-22T10:30:00.000Z", "updated_at": "2025-07-22T10:30:00.000Z" }, "created": true }, "errors": null } ``` ```json Existing Memory Found theme={null} { "data": { "memory": { "id": "mem-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "org_id": "11111111-2222-3333-4444-555555555555", "contact_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "persona_id": "persona-12345678", "agent_number": null, "summary": "Customer called about order #8821 which was delayed. Promised a follow-up within 24 hours.", "facts": { "name": "Sarah Chen", "phone": "+14155550192", "preferred_contact": "phone" }, "recent_messages": [ { "role": "user", "content": "Hi, I'm calling about my order", "channel": "call", "timestamp": "2025-07-22T10:30:00.000Z" } ], "open_items": [ { "type": "follow_up", "description": "Follow up on order #8821 delay status", "created_at": "2025-07-22T10:30:00.000Z", "priority": "high", "related_to": { "entity_type": "order", "entity_id": "order-8821" } } ], "memory_history": [], "created_at": "2025-07-20T10:30:00.000Z", "updated_at": "2025-07-22T15:45:00.000Z" }, "created": false }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "persona_id or agent_number is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Memory Source: https://docs.bland.ai/api-v1/post/memory-create POST https://api.bland.ai/v1/memory/create Create a new memory to organize and track call interactions by phone numbers. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* The name for the new memory. Used to identify and organize your memories. ### Response **data** `object` The created memory object. **data.id** `string` Unique identifier for the newly created memory. **data.created\_at** `string` ISO timestamp when the memory was created. **data.user\_id** `string` Unique identifier for the user who owns the memory. **data.name** `string` Name of the created memory. **data.memory\_duration** `null` Duration setting for the memory (null indicates no duration limit). **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "created_at": "2025-07-21T07:24:49.883Z", "user_id": "87654321-4321-4321-4321-210987654321", "name": "Docs Example", "memory_duration": null }, "errors": null } ``` ```json Missing Name theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Memory name is required." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_CREATE_ERROR", "message": "Failed to create memory." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Enable or Disable Memory Source: https://docs.bland.ai/api-v1/post/memory-enable POST https://api.bland.ai/v1/memory/enable Enable or disable memory for a pathway or persona version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters Provide **either** pathway **or** persona identifiers (not both). **pathway\_id** `string` Pathway ID. Use with `version_number` and `memory_enabled`. **version\_number** `number` Pathway version number. Required when `pathway_id` is provided. **persona\_id** `string` Persona ID. Use with `version_id` and `memory_enabled`. **version\_id** `string` Persona version ID (UUID). Required when `persona_id` is provided. **memory\_enabled** `boolean` *required* Set to `true` to enable memory, `false` to disable. ### Response **data** `object` Success response data. **data.message** `string` Success message. **errors** `null` Error array (null on success). ```json Response (pathway) theme={null} { "data": { "message": "Memory enabled successfully for pathway." }, "errors": null } ``` ```json Response (persona) theme={null} { "data": { "message": "Memory enabled successfully for persona." }, "errors": null } ``` ```json Missing or invalid body theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "memory_enabled (boolean) is required." } ] } ``` ```json Neither or both pathway/persona theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Exactly one of pathway_id or persona_id is required." } ] } ``` ```json Not found / Forbidden theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Pathway not found." } ] } ``` ### Behavior When memory is **enabled**, the system automatically refreshes entity schemas in the background — no additional action required. From that point on, memory is populated automatically on every call or SMS conversation that runs through the pathway or persona version. When memory is **disabled**, no new memory is written. Existing memory data is preserved. *** Docs for agents: [llms.txt](/llms.txt) # Add Call to Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-add-call POST https://api.bland.ai/v1/memory/{memory_id}/add-call Add an existing call to a memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to add the call to. ### Body Parameters **call\_id** `string` *required* The unique identifier of the call to add to the memory. Must be an existing call in your account. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` Response data confirming call addition. **data.message** `string` Success message confirming call was added to memory. **data.call** `object` Information about the call that was added. **data.call.call\_id** `string` The call identifier that was added. **data.call.memory\_id** `string` The memory identifier the call was added to. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "message": "Call added to memory successfully", "call": { "call_id": "call_abc123", "memory_id": "mem_123abc" } }, "errors": null } ``` ```json Missing Call ID theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Call ID is required." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_ADD_CALL_ERROR", "message": "Failed to add call to memory." } ] } ``` ### Notes * The call must already exist in your account before it can be added to a memory * The call must be connected to a user existing in the memory * Adding a call to a memory will automatically associate it with the phone number involved in the call *** Docs for agents: [llms.txt](/llms.txt) # Add User to Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-add-user POST https://api.bland.ai/v1/memory/{memory_id}/add-user Add a new user/phone number to an existing memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to add the user to. ### Body Parameters **phone\_number** `string` *required* The phone number of the user to add to the memory. **metadata** `string` Custom metadata text to associate with this user in the memory. **summary** `string` Initial summary text for this user's interactions. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` Response data confirming user addition. **data.message** `string` Success message confirming user was added to memory. **data.user** `object` The user object that was added to the memory. **data.user.id** `string` Unique identifier for the user entry in the memory. **data.user.memory\_id** `string` The memory identifier this user was added to. **data.user.phone\_number** `string` The phone number that was added. **data.user.metadata** `string` The metadata text associated with this user. **data.user.summary** `string` The summary text for this user. **data.user.created\_at** `string` ISO timestamp when this user was added to the memory. **data.user.call\_count** `number` Number of calls associated with this user. **data.user.last\_call\_at** `string|null` ISO timestamp of the most recent call, or null if no calls yet. **errors** `null` Error array (null on success). ```json Request theme={null} { "phone_number": "+12345678900", "metadata": "25 year old customer", "summary": "The user described their age" } ``` ```json Response theme={null} { "data": { "message": "User added to memory successfully", "user": { "id": "11111111-2222-3333-4444-555566667777", "memory_id": "12345678-1234-1234-1234-123456789012", "phone_number": "+12345678900", "metadata": "25 year old customer", "summary": "The user described their age", "created_at": "2025-07-22T05:26:49.139Z", "call_count": 0, "last_call_at": null } }, "errors": null } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_ADD_USER_ERROR", "message": "Failed to add user to memory." } ] } ``` ### Notes * If the phone number already exists in the memory, this endpoint will error with a `MEMORY_ADD_USER_ERROR` * Metadata can be any text string relevant to your use case * The summary will be enhanced over time as more calls are added to this user's record *** Docs for agents: [llms.txt](/llms.txt) # Remove Call from Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-call-call-id-delete POST https://api.bland.ai/v1/memory/{memory_id}/call/{call_id}/delete Remove a specific call from a memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory containing the call. **call\_id** `string` *required* The unique identifier of the call to remove from the memory. ### Body Parameters **phone\_number** `string` *required* The phone number associated with the call to be removed. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` Response data confirming call removal and updated summary. **data.message** `string` Success message confirming call was removed and summary updated. **data.summary** `string` The updated AI-generated summary for the user after call removal. **data.call\_count** `number` The updated call count for the user after removal. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "message": "Call removed from memory successfully and updated summary", "summary": "Customer had initial billing inquiry which was resolved. Prefers email communication for follow-ups.", "call_count": 2 }, "errors": null } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_REMOVE_CALL_ERROR", "message": "Failed to remove call from memory." } ] } ``` ### Notes * Removing a call will automatically update the user's summary to reflect the remaining interactions * The call itself is not deleted from your account, only its association with this memory is removed *** Docs for agents: [llms.txt](/llms.txt) # Delete Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-delete POST https://api.bland.ai/v1/memory/{memory_id}/delete Permanently delete an entire memory and all associated data including users, calls, and metadata. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to delete. ### Response **data** `object` Response data confirming memory deletion. **data.message** `string` Success message confirming memory was deleted. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "message": "Memory deleted successfully" }, "errors": null } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_DELETE_ERROR", "message": "Failed to delete memory." } ] } ``` ### ⚠️ Warning This action is **irreversible**. Deleting a memory will permanently remove: * The memory itself and all its metadata * All user entries and their associated data * All call associations and summaries * Any custom metadata and summaries ## Make sure you have backed up any important data before proceeding with deletion. Docs for agents: [llms.txt](/llms.txt) # Update Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-update POST https://api.bland.ai/v1/memory/{memory_id}/update Update the name of an existing memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to update. ### Body Parameters **name** `string` *required* The new name for the memory. Cannot be null or undefined. ### Response **data** `object` The updated memory object. **data.id** `string` Unique identifier for the memory. **data.name** `string` Updated name of the memory. **data.created\_at** `string` ISO timestamp when the memory was originally created. **data.user\_id** `string` Unique identifier for the organization that owns the memory. **data.memory\_duration** `number` Currently under development. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "created_at": "2025-07-21T07:24:49.883Z", "user_id": "87654321-4321-4321-4321-210987654321", "name": "Test Memory", "memory_duration": null }, "errors": null } ``` ```json Missing or Invalid Data theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "No update data provided." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_UPDATE_ERROR", "message": "Failed to update memory." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get User Memory Details Source: https://docs.bland.ai/api-v1/post/memory-memory-id-user POST https://api.bland.ai/v1/memory/{memory_id}/user Retrieve detailed memory information for a specific user or phone number in a memory store. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory. ### Body Parameters **phone\_number** `string` *required* The phone number of the user to retrieve memory details for. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` User memory data. **data.metadata** `string` Custom metadata text associated with this user's memory entry. **data.summary** `string` AI-generated summary of interactions with this user. **data.last\_call\_at** `string` ISO timestamp of the most recent call with this user. **data.call\_count** `number` Total number of calls with this user. **data.calls** `array` Array of call objects associated with this user. **data.calls\[].c\_id** `string` Unique identifier for the call. **data.calls\[].created\_at** `string` ISO timestamp when the call was made. **data.calls\[].summary** `string` AI-generated summary of this specific call. **data.calls\[].answered\_by** `string` Who answered the call (e.g., "human", "ai"). **data.calls\[].call\_length** `number` Call duration in minutes. **data.calls\[].inbound** `boolean` Whether this was an inbound call (true) or outbound call (false). **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "metadata": "25 year old customer from New York", "summary": "The user had previously discussed their startup and had a follow-up conversation, asking questions about AI and the future of their business.", "last_call_at": "2025-07-22T05:19:46.000Z", "call_count": 1, "calls": [ { "c_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeffffgggg", "created_at": "2025-07-22T05:19:37.314Z", "summary": "The call appears to be a follow-up conversation about the user's startup, asking questions about AI and the future of their business.", "answered_by": "human", "call_length": 0.3, "inbound": false } ] }, "errors": null } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_ERROR", "message": "Failed to retrieve memory data." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Remove User from Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-user-delete POST https://api.bland.ai/v1/memory/{memory_id}/user/delete Remove a specific user/phone number and all their associated data from a memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to remove the user from. ### Body Parameters **phone\_number** `string` *required* The phone number of the user to remove from the memory. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` Response data confirming user removal. **data.message** `string` Success message confirming user was removed from memory. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "message": "User +1234567890 removed from memory successfully" }, "errors": null } ``` ```json Missing Phone Number theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Phone number is required." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_REMOVE_USER_ERROR", "message": "Failed to remove user from memory." } ] } ``` ### ⚠️ Warning This action will permanently remove: * The user's entry from the memory * All associated metadata for this user * The user's summary and interaction history * All call associations for this user within this memory ## The actual calls will remain in your account, but their association with this memory will be removed. Docs for agents: [llms.txt](/llms.txt) # Search User Calls in Memory Source: https://docs.bland.ai/api-v1/post/memory-memory-id-user-search POST https://api.bland.ai/v1/memory/{memory_id}/user/search Retrieve call history and data for a specific user/phone number within a memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory to search within. ### Body Parameters **phone\_number** `string` *required* The phone number of the user to search for calls. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `array` Array of call objects for this user within the memory. **data\[].c\_id** `string` Unique identifier for the call. **data\[].created\_at** `string` ISO timestamp when the call was made. **data\[].summary** `string` AI-generated summary of this specific call. **data\[].answered\_by** `string` Who answered the call (e.g., "human", "ai"). **data\[].call\_length** `number` Call duration in minutes. **data\[].inbound** `boolean` Whether this was an inbound call (true) or outbound call (false). **errors** `null` Error array (null on success). ```json Response theme={null} { "data": [ { "c_id": "aaaaaaaa-bbbb-cccc-dddd-eeeeffffgggg", "created_at": "2025-07-22T05:19:37.314Z", "summary": "The call appears to be a follow-up conversation about the user's startup, asking questions about AI and the future of their business.", "answered_by": "human", "call_length": 0.3, "inbound": false } ], "errors": null } ``` ```json Missing Phone Number theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "Phone number is required in request body." } ] } ``` ```json Memory Not Found theme={null} { "data": null, "errors": [ { "error": "MEMORY_NOT_FOUND", "message": "Memory not found or you don't have access to it." } ] } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_ERROR", "message": "Failed to retrieve memory user data." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update User Memory Data Source: https://docs.bland.ai/api-v1/post/memory-memory-id-user-update POST https://api.bland.ai/v1/memory/{memory_id}/user/update Update the metadata and summary information for a specific user within a memory. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **memory\_id** `string` *required* The unique identifier of the memory containing the user to update. ### Body Parameters **phone\_number** `string` *required* The phone number of the user to update within the memory. **metadata** `string` Updated metadata to associate with this user. Can include any key-value pairs relevant to your use case. **summary** `string` Updated summary text for this user's interactions. **external\_memory\_key** `string` Optional external key for additional memory validation or cross-referencing. ### Response **data** `object` Response data confirming user update. **data.message** `string` Success message confirming user memory data was updated. **data.user** `object` The updated user object. **data.user.id** `string` Unique identifier for the user entry in the memory. **data.user.memory\_id** `string` The memory identifier this user belongs to. **data.user.phone\_number** `string` The phone number that was updated. **data.user.metadata** `string` The updated metadata text associated with this user. **data.user.summary** `string` The updated summary text for this user. **data.user.created\_at** `string` ISO timestamp when this user was originally added to the memory. **data.user.call\_count** `number` Number of calls associated with this user. **data.user.last\_call\_at** `string|null` ISO timestamp of the most recent call, or null if no calls yet. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "message": "User memory data updated successfully", "user": { "id": "11111111-2222-3333-4444-555566667777", "memory_id": "12345678-1234-1234-1234-123456789012", "phone_number": "+12345678900", "metadata": "Test here with string metadtata", "summary": "I'm thinking yeah...", "created_at": "2025-07-22T05:32:32.233Z", "call_count": 0, "last_call_at": null } }, "errors": null } ``` ```json Server Error theme={null} { "data": null, "errors": [ { "error": "MEMORY_UPDATE_USER_ERROR", "message": "Failed to update user memory data." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Reset Contact Memory Source: https://docs.bland.ai/api-v1/post/memory-reset POST https://api.bland.ai/v1/memory/reset Permanently delete all memory for a contact scoped to a specific persona or agent number. All conversation history, facts, summaries, and entities for that pair are removed. This cannot be undone. > [!WARNING] > > This action is **irreversible**. All memory data (recent messages, summary, facts, entities) for this contact/persona pair will be permanently deleted. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **contact\_id** `string` *required* The unique identifier of the contact whose memory should be reset. **persona\_id** `string` The persona ID for memory scoping. Either `persona_id` or `agent_number` is required. **agent\_number** `string` The agent phone number for memory scoping. Either `persona_id` or `agent_number` is required. ### Response **data** `object` Success confirmation. **data.success** `boolean` Whether the reset was successful. **errors** `null` Error array (null on success). ```json Response theme={null} { "data": { "success": true }, "errors": null } ``` ```json Error Response theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "persona_id or agent_number is required" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Move Pathway Source: https://docs.bland.ai/api-v1/post/move-pathway-folder POST https://us.api.bland.ai/v1/pathway/folders/move Moves a pathway to a different folder or to the root level. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **pathway\_id** `string` *required* The ID of the pathway to move. **folder\_id** `string` The ID of the destination folder. If null, the pathway will be moved to the root level. ### Response **pathway\_id** `string` The ID of the moved pathway. **old\_folder\_id** `string` The ID of the original folder. **new\_folder\_id** `string` The ID of the new folder, or null if moved to root level. ```json Response theme={null} { "pathway_id": "pathway_123", "old_folder_id": "old_folder_456", "new_folder_id": "new_folder_789" } ``` ``` --- Docs for agents: [llms.txt](/llms.txt) ``` # Invoke Node Test Run Source: https://docs.bland.ai/api-v1/post/node_test_invoke POST https://api.bland.ai/v1/node_tests/invoke Start a node test run for a given node and pathway with a new prompt and sample conversations. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **new\_prompt** `string` The new prompt to test for this node. This will be used to simulate the agent's responses against the pinned and auto-selected conversations. Either `new_prompt` or `static_text` can be provided, but not both. **static\_text** `string` Static text that the agent will always reply with. Either `static_text` or `new_prompt` can be provided, but not both. This is useful to test variable extractions on static text nodes. **judge\_prompt** `string` The judge prompt to evaluate the test results. If not provided, the default judge prompt will be used. The default judge prompt will evaluate the agent responses against the node prompt. **loop\_prompt** `string` The prompt for the node loop condition. **extract\_variables** `array` Array of variables to extract from the conversation. **extract\_variables\[].name** `string` *required* The name of the variable to extract. **extract\_variables\[].type** `string` *required* The type of the variable. Must be one of: `"string"`, `"integer"`, or `"boolean"`. **extract\_variables\[].description** `string` *required* A description of what the variable represents. **extract\_variables\[].spelling\_precision** `boolean` *required* Whether spelling precision should be enforced for this variable. **conversations** `array` *required* Array of conversation references to include in the test. The system may automatically add up to 4 additional recent completed calls for the same node and pathway. **conversations\[].id** `string` *required* Unique identifier of a call to include in the test run. **conversations\[].type** `string` *required* Type of the conversation. We only support `"call"` for now. **node\_id** `string` *required* Identifier of the node to test within the specified pathway. **pathway\_id** `string` *required* Identifier of the pathway that the node and conversations belong to. **pathway\_version** `string` The version of the pathway to test against. **n\_permutations** `number` Optional number of permutations to generate for each conversation. If omitted, this defaults to `5`. The total generations per conversation will be `n_permutations + 1` (one for the original user messages plus one per permutation). ### Response **data.run\_id** `string` Identifier of the created node test run. Use this ID with `GET /v1/node_tests/run/:id` to retrieve the full results. ```json Request theme={null} { "new_prompt": "You are the best financial advisor...", "judge_prompt": "Evaluate if the response is helpful and accurate.", "loop_prompt": "Continue if the user has more questions.", "extract_variables": [ { "name": "user_name", "type": "string", "description": "The name of the user", "spelling_precision": true } ], "conversations": [ { "type": "call", "id": "330d8a20-27bc-4d00-b67a-8474c9a6d4e1" }, { "type": "call", "id": "906f16de-2719-4b7e-864b-a4b002586e7c" } ], "node_id": "a7bbd409-504b-4ba3-a9d1-12f6bc270f58", "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad", "pathway_version": "2", "n_permutations": 5 } ``` ```json Response theme={null} { "data": { "run_id": "727a85f1-1959-4ec1-95a4-248a2eecf1ae" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Organization Source: https://docs.bland.ai/api-v1/post/orgs POST https://api.bland.ai/v1/orgs/create Create a new organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **name** `string` *required* The name of the organization. ### Response **data** `object` The created organization details. **data.id** `string` A unique identifier for the organization. **data.org\_slug** `string` A randomly generated unique slug for the organization. **data.org\_display\_name** `string` The display name of the organization. **data.org\_image\_url** `string | null` URL of the organization's image (if set). **data.org\_plan** `string` The organization's plan. Default: `"starter"`. **data.org\_creation\_date** `string (ISO 8601)` The timestamp of when the organization was created. **data.kyc\_level** `integer` The KYC (Know Your Customer) verification level. Default: `0`. **data.placement\_group** `string` The placement group of the organization. Default: `"blandshared"`. **data.is\_deleted** `boolean` Whether the organization is deleted. Default: `false`. **data.is\_stripe\_overdue** `boolean` Whether the organization has overdue Stripe payments. Default: `false`. **data.is\_suspended** `boolean` Whether the organization is suspended. Default: `false`. **data.org\_rate\_limit** `integer` The organization's request rate limit. Default: `5`. **data.org\_type** `string` The type of the organization. Default: `"normal"`. **data.entitlements** `array` A list of entitlements granted to the organization. Default: `[]`. **data.preferences.use\_bland\_url** `boolean` Whether the organization prefers to use the Bland URL. Default: `true`. **errors** `null | array` Contains error details if the request fails. ```json Response theme={null} { "data": { "id": "00705195-d5f2-4483-829e-07bb34df3625", "org_slug": "efbfd0c0-5017-4945-9156-16b56c11848e", "org_display_name": "Org Name", "org_image_url": null, "org_plan": "starter", "org_creation_date": "2025-02-14T06:06:01.504Z", "kyc_level": 0, "placement_group": "blandshared", "is_deleted": false, "is_stripe_overdue": false, "is_suspended": false, "org_rate_limit": 5, "org_type": "normal", "entitlements": [], "preferences": { "use_bland_url": true } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Pathway Chat Source: https://docs.bland.ai/api-v1/post/pathway-chat POST https://us.api.bland.ai/v1/pathway/chat/{id} Send a message to a pathway and receive a response. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `uuid` *required* The chat ID created from the /pathway/chat/create endpoint. ### Body **message** `string` The message to send to the pathway (optional) ### Response **data** `object` Contains the response data for the pathway chat message. **data properties** **chat\_id** `uuid` The ID of the chat instance. **assistant\_responses** `array` An array of strings containing the assistant's responses to the message sent. **current\_node\_id** `string` The ID of the current node in the pathway after processing the message. **current\_node\_name** `string` The name of the current node in the pathway. **chat\_history** `array` An array of objects containing the role and content of each message in the external chat history. **pathway\_id** `string` The ID of the pathway the chat is associated with. **pathway\_version** `string | null` The version of the pathway being used, or null if not specified. **use\_candidate\_model** `boolean` Whether the candidate model is being used for this pathway chat. **variables** `object` The current state of variables in the pathway execution. **completed** `boolean` Whether the pathway has completed execution. **errors** `null | array` Will be `null` on success. Contains error details if the request failed. ```json Response theme={null} { "data": { "chat_id": "12345678-1234-1234-1234-123456789012", "assistant_responses": ["Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"], "current_node_id": "1", "current_node_name": "Start", "chat_history": [ {"role": "user", "content": "hello"}, {"role": "assistant", "content": "Hey there, this is the Bland Bistro reservation line. Do you want to make a reservation?"} ], "pathway_id": "87654321-4321-4321-4321-210987654321", "pathway_version": null, "use_candidate_model": false, "variables": { "callID": "12345678-1234-1234-1234-123456789012" }, "completed": false }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Pathway Chat Source: https://docs.bland.ai/api-v1/post/pathway-chat-create POST https://us.api.bland.ai/v1/pathway/chat/create Create an instance of a pathway chat, which can be used to send and receive messages to the pathway. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **pathway\_id** `string` *required* Pathway ID of the pathway to create a chat instance for. **start\_node\_id** `string` The start node ID of the pathway. If not provided, the pathway will start from the node marked as the start node in the pathway configuration. **request\_data** `object` Custom key-value data to initialize the pathway chat with. This object will be stored as the pathway's initial variables and can be referenced within pathway nodes. The `request_data` must be a valid JSON object (not an array or null). This works the same as [request\_data in v1/calls](/api-v1/post/calls#param-request-data) where variables can be accessed using `{{variable_name}}` syntax within your pathway nodes. ```json theme={null} { "user_name": "John Doe", "account_id": "12345", "preference": "email" } ``` **use\_candidate\_model** `boolean` Whether to use the candidate model for this pathway chat. When enabled, the pathway will use an experimental model version for enhanced performance and capabilities. **pathway\_version** `number` The specific version number of the pathway to use for this chat instance. If not provided, the production version will be used. ### Response **data** `object` Contains the response data for the created pathway chat instance. **data properties** **chat\_id** `uuid` The ID of the chat instance created. This will be used to send and receive messages to the pathway via the `/v1/pathway/chat/:id` endpoint. **message** `string` A confirmation message. Will say "Chat instance created successfully" on success. **variables** `object | null` The initial variables that were set for this pathway chat instance. This will contain the `request_data` object if it was provided in the request, otherwise it will be `null`. **errors** `null | array` Will be `null` on success. Contains error details if the request failed. ```json Response theme={null} { "data": { "chat_id": "9f8e7d6c-5b4a-3c2d-1e0f-a1b2c3d4e5f6", "message": "Chat instance created successfully", "variables": { "user_name": "John Doe", "account_id": "12345", "preference": "email" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Generate Pathway Source: https://docs.bland.ai/api-v1/post/pathway-generate POST https://api.bland.ai/v1/pathway/generate Create an asynchronous pathway generation job from a detailed prompt. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **input\_prompt** `string` *required* A detailed pathway generation prompt. Server-side requirements: * Must be at least 100 characters * Must be 8000 characters or fewer for non-enterprise organizations **input\_name** `string` Optional name to use for the generated pathway ### How it works This endpoint only queues generation and returns a `jobId`. Use `GET /v1/pathway/generate/status/{job_id}` to start processing and poll until generation is complete. ### Response **data** `object` Response object containing the generation job identifier. **data.jobId** `string` The job ID for this pathway generation request. **errors** `null | array` `null` on success, or a list of errors. ```json Success theme={null} { "data": { "jobId": "7a9e684f-6a50-4de5-bd95-9fa5f8121ddf" }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "message": "PATHWAY_GENERATION_ERROR", "error": "Prompt must be greater than 100 characters." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Promote Pathway Version Source: https://docs.bland.ai/api-v1/post/pathway-promote POST https://api.bland.ai/v1/pathway/{pathway_id}/publish Promote a pathway version for a pathway ID to either staging or production environment. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path **pathway\_id** `string` *required* The ID of the pathway you want to promote ### Body **version\_id** `number` *required* The version number of the pathway you want to promote **environment** `string` The environment you want to promote the pathway to. Can be `production` or `staging`. Default is `production`. ### Response **message** `string` A message indicating the status of the request. ```json Response theme={null} { "message": "Pathway published successfully" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Pathway Source: https://docs.bland.ai/api-v1/post/pathways POST https://api.bland.ai/v1/pathway/create Create a new conversational pathway ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **name** `string` *required* The name of the conversational pathway you want to create **description** `string` A description of the conversational pathway you want to create ### Response **status** `string` Can be `success` or `error`. **pathway\_id** `string` A unique identifier for the pathway (present only if status is `success`). ```json Response theme={null} { "status": "success", "pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Persona Source: https://docs.bland.ai/api-v1/post/personas POST https://api.bland.ai/v1/personas Create a new persona. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* Display name for the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose and use case. **tags** `array` Array of tags to associate with the persona. **image\_url** `string` URL of the persona's profile image. **call\_config** `object` Call configuration settings for the persona. **call\_config** **voice** `string` Voice identifier to use for calls. **record** `boolean` Whether to record calls. **language** `string` Language code for the persona. **background** `string` Background audio setting. **max\_duration** `number` Maximum call duration in minutes. **wait\_for\_greeting** `boolean` Whether to wait for greeting before starting. **interruption\_threshold** `number` Interruption sensitivity threshold. **orchestration\_prompt** `string` Orchestration prompt for the persona (optional). **personality\_prompt** `string` Personality and behavior prompt for the persona. **default\_tools** `array` Array of default tools enabled for the persona. **pathway\_conditions** `array` Array of pathway routing conditions for the persona. **pathway condition** **name** `string` *required* Name of the pathway condition. **prompt** `string` *required* Prompt that triggers this pathway condition. **pathway\_id** `string` *required* ID of the pathway to route to. **pathway\_version** `string` *required* Version of the pathway to use. **start\_node\_id** `string` *required* Starting node ID within the pathway. **kb\_ids** `array` Array of knowledge base item IDs to connect to the persona. ### Response **data** `object` The created persona object. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose. **tags** `array` Array of tags associated with the persona. **image\_url** `string` URL of the persona's profile image (null if none). **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **deleted\_at** `string` ISO 8601 timestamp of when the persona was deleted (null if active). **user\_id** `string` ID of the user who owns this persona. **current\_production\_version\_id** `string` ID of the current production version. **current\_draft\_version\_id** `string` ID of the current draft version. **current\_production\_version** `object` Complete production version object. **current\_draft\_version** `object` Complete draft version object. **errors** `string` Any errors that occurred (null if none). ```json Response (Success) theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Blandie", "role": null, "description": null, "tags": [], "image_url": null, "created_at": "2025-09-23T15:13:36.348Z", "updated_at": "2025-09-23T15:13:36.412Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789012", "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 1, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": null, "promoted_at": "2025-09-23T15:13:36.368Z", "promoted_by": null, "created_at": "2025-09-23T15:13:36.369Z", "updated_at": "2025-09-23T15:13:36.369Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-23T15:13:36.390Z", "updated_at": "2025-09-23T15:13:36.390Z" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Attach Phone Numbers to Persona Source: https://docs.bland.ai/api-v1/post/personas-id-inbound-attach POST https://api.bland.ai/v1/personas/{persona_id}/inbound/attach Attach one or more inbound phone numbers to a persona. The same endpoint handles voice, SMS, and WhatsApp numbers — channel capability is determined by the number's own configuration, not by this call. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona to attach numbers to. ### Body Parameters **inbound\_numbers** `string[]` *required* Array of E.164 formatted phone numbers to attach to this persona. All numbers must already belong to your account. ### Response **data** `object` The updated persona object with the newly attached inbound numbers. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **user\_id** `string` ID of the user who owns this persona. **inbound\_numbers** `array` Array of inbound number objects now attached to this persona. **inbound number object** **phone\_number** `string` The E.164 formatted phone number. **label** `string` Display label for the number, if set. **persona\_id** `string` The persona this number is attached to. **persona\_settings** `object` Per-number persona settings (e.g. pathway overrides), if configured. **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Response (Success) theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Support Agent", "user_id": "12345678-1234-1234-1234-123456789012", "inbound_numbers": [ { "phone_number": "+14155551234", "label": "Support Line", "persona_id": "12345678-1234-1234-1234-123456789012", "persona_settings": null }, { "phone_number": "+14155555678", "label": null, "persona_id": "12345678-1234-1234-1234-123456789012", "persona_settings": null } ], "created_at": "2025-09-23T15:13:36.348Z", "updated_at": "2025-09-23T15:13:36.412Z" }, "errors": null } ``` ```json Error Response (Number not found) theme={null} { "data": null, "errors": [ { "error": "INVALID_INBOUND_NUMBERS", "message": "Some phone numbers were not found or do not belong to you" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Detach Phone Numbers from Persona Source: https://docs.bland.ai/api-v1/post/personas-id-inbound-detach POST https://api.bland.ai/v1/personas/{persona_id}/inbound/detach Detach one or more inbound phone numbers from a persona. Detached numbers will no longer use the persona's configuration and will have their persona settings cleared. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona to detach numbers from. ### Body Parameters **inbound\_numbers** `string[]` *required* Array of E.164 formatted phone numbers to detach from this persona. Only numbers currently attached to this persona will be affected. ### Response **data** `object` The updated persona object after detaching the specified numbers. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **inbound\_numbers** `array` Array of inbound number objects still attached to this persona (after detaching the specified ones). **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Response (Success) theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Support Agent", "user_id": "12345678-1234-1234-1234-123456789012", "inbound_numbers": [], "created_at": "2025-09-23T15:13:36.348Z", "updated_at": "2025-09-23T15:20:00.000Z" }, "errors": null } ``` ```json Error Response (Persona not found) theme={null} { "data": null, "errors": [ { "error": "PERSONA_NOT_FOUND", "message": "Persona not found or access denied" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Promote Persona Version Source: https://docs.bland.ai/api-v1/post/personas-id-versions-promote POST https://api.bland.ai/v1/personas/{persona_id}/versions/promote Promote a persona's draft version to production. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **persona\_id** `string` *required* The unique identifier of the persona whose draft version should be promoted. ### Response **data** `object` The updated persona object after promotion. **persona object** **id** `string` Unique identifier for the persona. **name** `string` Display name of the persona. **role** `string` Role assigned to the persona. **description** `string` Description of the persona's purpose. **tags** `array` Array of tags associated with the persona. **image\_url** `string` URL of the persona's profile image (null if none). **created\_at** `string` ISO 8601 timestamp of when the persona was created. **updated\_at** `string` ISO 8601 timestamp of when the persona was last modified. **deleted\_at** `string` ISO 8601 timestamp of when the persona was deleted (null if active). **user\_id** `string` ID of the user who owns this persona. **current\_production\_version\_id** `string` ID of the current production version (updated after promotion). **current\_draft\_version\_id** `string` ID of the current draft version. **current\_production\_version** `object` Complete production version object (the newly promoted version). **current\_draft\_version** `object` Complete draft version object (same as before promotion). **errors** `string` Any errors that occurred (null if none). ```json Response theme={null} { "data": { "id": "12345678-1234-1234-1234-123456789012", "name": "Blandy", "role": null, "description": "Helpful Agent for Bland Documentation", "tags": [], "image_url": null, "created_at": "2025-09-23T15:13:36.348Z", "updated_at": "2025-09-23T15:55:57.284Z", "deleted_at": null, "user_id": "12345678-1234-1234-1234-123456789012", "current_production_version_id": "12345678-1234-1234-1234-123456789012", "current_draft_version_id": "12345678-1234-1234-1234-123456789013", "current_production_version": { "id": "12345678-1234-1234-1234-123456789012", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "production", "version_number": 3, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789013", "promoted_at": "2025-09-23T15:55:57.262Z", "promoted_by": "12345678-1234-1234-1234-123456789012", "created_at": "2025-09-23T15:55:57.263Z", "updated_at": "2025-09-23T15:55:57.263Z" }, "current_draft_version": { "id": "12345678-1234-1234-1234-123456789013", "persona_id": "12345678-1234-1234-1234-123456789012", "version_type": "draft", "version_number": 2, "orchestration_prompt": null, "personality_prompt": "You are a helpful assistant", "pathway_conditions": null, "kb_ids": [], "call_config": null, "default_tools": [], "promoted_from_version_id": "12345678-1234-1234-1234-123456789012", "promoted_at": null, "promoted_by": null, "created_at": "2025-09-23T15:13:36.390Z", "updated_at": "2025-09-23T15:13:36.390Z" } }, "errors": null } ``` ```json Error Response (No Draft) theme={null} { "data": null, "errors": [ { "error": "NO_DRAFT_VERSION", "message": "No draft version to promote", "details": { "persona_id": "12345678-1234-1234-1234-123456789012" } } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Post Call Webhook Source: https://docs.bland.ai/api-v1/post/postcall-webhooks-create POST https://api.bland.ai/v1/postcall/webhooks/create Create and send post call webhooks for specified calls. ## Overview Create and send post call webhooks for one or more call IDs. This endpoint allows you to create webhooks for calls that don't already have webhooks configured. The webhooks will be sent immediately after creation to the specified webhook URL. If the call has already sent a post call webhook, this endpoint will return an error. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **call\_ids** `string[]` *required* Array of call IDs to create and send webhooks for. Each call ID must be unique within the array. **Array Item Properties** **call\_id** `string` The unique identifier of a call to create a webhook for. **webhook\_url** `string` *required* The URL where the webhook payloads should be sent. *** ## Response **data** `array` Array of webhook objects for each created webhook. **Array Item Properties** **call\_id** `string` The unique identifier of the call this webhook is for. **payload** `object` The webhook payload data that was sent. **url** `string` The URL the webhook was sent to. **user\_id** `string` The ID of the user/org that owns this webhook. **created\_at** `string` Timestamp of when the webhook was created. **metadata** `array` Array of metadata objects about webhook send attempts. **Array Item Properties** **sent\_at** `string` Timestamp of when this webhook attempt was sent. **response\_code** `integer` HTTP response code received from the webhook endpoint. **response\_time** `string` Time taken to receive a response from the webhook endpoint. **send\_type** `string` How this webhook was triggered (will be "create" in this case). **errors** `array` Array of error objects if any errors occurred. **Array Item Properties** **error** `string` The error code. Possible values: * "invalid\_parameter": Invalid request parameters * "INTERNAL\_SERVER\_ERROR": Server error occurred **message** `string` Detailed error message. *** Docs for agents: [llms.txt](/llms.txt) # Resend Post Call Webhook Source: https://docs.bland.ai/api-v1/post/postcall-webhooks-resend POST https://api.bland.ai/v1/postcall/webhooks/resend Resend post call webhooks for specified calls. ## Overview Resend post call webhooks for one or more call IDs. This endpoint allows you to manually trigger a resend of webhooks that were previously sent when calls completed. This endpoint can only re-send webhooks that were previously sent when calls completed. Webhooks will be re-sent to the same URL they were previously sent to. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **call\_ids** `string[]` *required* Array of call IDs to resend webhooks for. Each call ID must be unique within the array. **Array Item Properties** **call\_id** `string` The unique identifier of a call to resend the webhook for. *** ## Response **data** `array` Array of webhook log objects for each resent webhook. **Array Item Properties** **call\_id** `string` The unique identifier of the call this webhook is for. **payload** `object` The webhook payload data that was resent. **url** `string` The URL the webhook was resent to. **user\_id** `string` The ID of the user/org that owns this webhook. **created\_at** `string` Timestamp of when the webhook was originally created. **metadata** `array` Array of metadata objects about webhook send attempts. **Array Item Properties** **sent\_at** `string` Timestamp of when this webhook attempt was sent. **response\_code** `integer` HTTP response code received from the webhook endpoint. **response\_time** `string` Time taken to receive a response from the webhook endpoint. **send\_type** `string` How this webhook was triggered (will be "resend" in this case). **errors** `array` Array of error objects if any errors occurred. **Array Item Properties** **error** `string` The error code. Possible values: * "invalid\_parameter": Invalid request parameters * "INTERNAL\_SERVER\_ERROR": Server error occurred **message** `string` Detailed error message. *** Docs for agents: [llms.txt](/llms.txt) # Create Prompt Source: https://docs.bland.ai/api-v1/post/prompts POST https://api.bland.ai/v1/prompts Create and store a prompt for future use. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **prompt** `string` *required* Prompt to store. **name** `string` Name of prompt you want to store as reference. ### Response Prompt object. Prompt to store. Name of prompt you want to store as reference. ```json Response theme={null} { "status": "success", "prompt": { "prompt": "# Final Test", "name": "demo", "id": "PT-02b2ecdi-39f2-443f-8cb0-a6c854c65fc0" } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Attach SIP Configuration Source: https://docs.bland.ai/api-v1/post/sip-attach POST https://api.bland.ai/v1/sip/attach Attach SIP configuration to one or more phone numbers for inbound and/or outbound routing. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` A single phone number to configure. PSTN numbers are normalized to E.164 (e.g., `+14150000000`); when bound to a trunk (`trunk_id`), non-E.164 SIP identities such as DIDs and extensions are also accepted. Use either `phone_number` or `phone_numbers`, not both. **phone\_numbers** `string[]` An array of phone numbers or DIDs to configure (up to 100). PSTN numbers are normalized to E.164; trunk-bound numbers also accept DIDs and extensions. Use either `phone_number` or `phone_numbers`, not both. **directions** `array` *required* An array of direction objects. Each specifies either `inbound` or `outbound` routing configuration. **service** `string` *required* Must be set to `"sip"`. **trunk\_id** `string` Bind the numbers to a reusable trunk. When set, outbound endpoint and authentication are inherited from the trunk (no need to repeat `sip_endpoint`/auth per number), and non-E.164 DIDs and extensions are accepted. #### Inbound Direction Object **directions\[].type** `string` *required* Set to `"inbound"`. **directions\[].auth\_mode** `string` Authentication mode: `"ip"` (default) or `"register"`. When set to `"register"`, you must also provide `register_auth`. **directions\[].register\_auth** `object` Required when `auth_mode` is `"register"`. Contains `username` (string) and `password` (string, min 8 characters). **directions\[].sip\_endpoint** `string` Your SIP server address for inbound call forwarding (optional). Format: `sip:host` or `host`. **directions\[].headers** `object` Custom SIP header mappings. See header configuration examples below. **directions\[].options** `object` Connection options: `port` (number), `transport` (`"udp"`, `"tcp"`, or `"tls"`), `secure_media` (boolean), `sip_username` (string), `sip_password` (string). #### Outbound Direction Object **directions\[].type** `string` *required* Set to `"outbound"`. **directions\[].sip\_endpoint** `string` *required* Your SIP provider's endpoint, as a valid SIP URI (e.g., `sip:your.provider.com`). Required for outbound unless the numbers are bound to a `trunk_id`, in which case it is inherited from the trunk. **directions\[].headers** `object` Custom SIP header mappings. **directions\[].options** `object` Connection options: `port` (number), `transport` (`"udp"`, `"tcp"`, or `"tls"`), `secure_media` (boolean), `sip_username` (string), `sip_password` (string). ### Response **configured** `array` Array of successfully configured phone numbers. **failed** `array` Array of phone numbers that failed to configure, with error reasons. **register\_password\_for\_pbx** `string` Only returned when using registration-based auth. This is the derived password you must configure in your PBX. ### Header Configuration Examples Headers allow you to map SIP headers to Bland pathway variables and vice versa. On an inbound mapping, set `"external_id": true` on one `custom` entry to store that header's value as the call's `external_id`. The header is still mapped into its variable as usual. You can then find the call with [`GET /v1/calls?external_id=`](/api-v1/get/calls) or [`GET /v1/calls/{external_id}`](/api-v1/get/calls-id). In the dashboard, select **External ID** on the inbound header row. ```json theme={null} { "type": "custom", "key": "X-Session-Id", "value": "session_id", "external_id": true } ``` ```json Example Request (Outbound with Headers) theme={null} curl -X POST https://api.bland.ai/v1/sip/attach \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14150000000", "directions": [ { "type": "inbound", "headers": { "direction": "inbound", "headers": [ { "type": "custom", "key": "X-Cool-Guy", "value": "First_Name" }, { "type": "custom", "key": "Account_Type", "value": "VIP", "passthrough": true }, { "type": "uui", "target": "CustomerId", "purpose": "bland", "encoding": "hex", "content": "id" } ] } }, { "type": "outbound", "sip_endpoint": "sip:your.provider.com", "options": { "port": 5061, "transport": "tls", "secure_media": true, "sip_username": "bland", "sip_password": "password" }, "headers": { "direction": "outbound", "headers": [ { "type": "custom", "key": "Favorite_Color", "value": "X-Favorite-Color" }, { "type": "custom", "key": "x-custom-id", "value": "12345", "passthrough": true }, { "type": "uui", "target": "CustomerKV", "purpose": "bland", "content": "customerid_1234", "encoding": "hex" } ] } } ], "service": "sip" }' ``` ```json Example Request (Batch Attach) theme={null} curl -X POST https://api.bland.ai/v1/sip/attach \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+14150000001", "+14150000002", "+14150000003"], "directions": [ { "type": "outbound", "sip_endpoint": "sip:trunk.provider.com", "options": { "transport": "tls", "secure_media": true } } ], "service": "sip" }' ``` ```json Example Request (Bind to a Trunk) theme={null} curl -X POST https://api.bland.ai/v1/sip/attach \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+14155550100", "2001"], "directions": [{ "type": "inbound" }, { "type": "outbound" }], "service": "sip", "trunk_id": "" }' ``` ```json Response theme={null} { "data": { "configured": ["+14150000001", "+14150000002", "+14150000003"], "failed": [] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Detach SIP Configuration Source: https://docs.bland.ai/api-v1/post/sip-detach POST https://api.bland.ai/v1/sip/detach Remove SIP configuration from a phone number for specified directions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The phone number to detach SIP routing from. Must be in E.164 format. **directions** `array` *required* Direction(s) to remove. Each object must have a `type` field set to `"inbound"` or `"outbound"`. **service** `string` *required* Must be set to `"sip"`. ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/detach \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14150000000", "directions": [ { "type": "outbound" } ], "service": "sip" }' ``` *** Docs for agents: [llms.txt](/llms.txt) # Discover SIP Endpoint Source: https://docs.bland.ai/api-v1/post/sip-discover POST https://api.bland.ai/v1/sip/discover Auto-discover optimal SIP connection settings by probing your endpoint with DNS resolution and SIP OPTIONS. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **host** `string` *required* The hostname or IP address of your SIP endpoint. **port** `number` Specific port to probe. If omitted, ports 5060, 5061, and 5080 are tested. **transport** `string` Specific transport to test: `"udp"`, `"tcp"`, or `"tls"`. If omitted, both UDP and TCP are tested. ### Response **discovery\_id** `string` Unique identifier for this discovery session. **status** `string` Discovery status: `"running"`, `"completed"`, or `"failed"`. **host** `string` The host that was probed. **resolved\_addresses** `array` IP addresses resolved from DNS A/AAAA lookups. **srv\_records** `array` SRV records found for `_sip._udp`, `_sip._tcp`, `_sips._tcp`. **attempts** `array` Details of each probe attempt including port, transport, response time, response code, and user agent. **recommended** `object` Recommended connection settings: `port`, `transport`, `user_agent`, `detected_system` (e.g., "Asterisk", "FreeSWITCH", "Kamailio"), `codecs`, and `methods`. Only one discovery can run per organization at a time. Discovery results are cached for 10 minutes. ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/discover \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "host": "sip.example.com" }' ``` ```json Response theme={null} { "data": { "discovery_id": "disc_abc123", "status": "completed", "host": "sip.example.com", "resolved_addresses": ["203.0.113.10"], "srv_records": [], "attempts": [ { "port": 5060, "transport": "udp", "response_time_ms": 45, "response_code": 200, "user_agent": "Asterisk PBX 18.0.0" } ], "recommended": { "port": 5060, "transport": "udp", "detected_system": "Asterisk", "codecs": ["PCMU", "PCMA", "G.722"], "methods": ["INVITE", "ACK", "BYE", "CANCEL", "OPTIONS"] }, "started_at": "2026-03-09T12:00:00Z", "completed_at": "2026-03-09T12:00:05Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Parse SIP Destination Source: https://docs.bland.ai/api-v1/post/sip-parse-destination POST https://api.bland.ai/v1/sip/parse-destination Parse and validate a raw SIP destination string into its host, port, user, and transport before attaching it to a trunk. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **input** `string` *required* The SIP destination to parse. Accepts flexible formats — a hostname or IP (`sip.provider.com`, `203.0.113.10`), a full SIP URI (`sip:user@host:5061;transport=tls`), or shorthand (`tls://host`, `host:5061`). ### Response **valid** `boolean` Whether the input could be parsed into a usable SIP destination. **parsed** `object` The parsed destination when `valid` is `true`, otherwise `null`. **parsed** **host** `string` The resolved host or IP address. **port** `number` The port, when present in the input. **user** `string` The user part of the SIP URI, when present. **transport** `string` The transport: `"udp"`, `"tcp"`, or `"tls"`, when present. **is\_private\_ip** `boolean` `true` if the host is a private/non-routable IP address. **normalized** `string` The normalized SIP destination string. Use the parsed `host`, `port`, and `transport` to populate the `sip_endpoint` and `options` of a trunk or a [`POST /v1/sip/attach`](/api-v1/post/sip-attach) request. ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/parse-destination \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "input": "sip:your.provider.com:5061;transport=tls" }' ``` ```json Response theme={null} { "data": { "valid": true, "parsed": { "host": "your.provider.com", "port": 5061, "transport": "tls", "is_private_ip": false, "normalized": "sip:your.provider.com:5061;transport=tls" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload Port Document Source: https://docs.bland.ai/api-v1/post/sip-port-document POST https://api.bland.ai/v1/sip/port/document Upload a Letter of Authorization (LOA) or proof of ownership document for number porting. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body (Multipart Form Data) **file** `file` *required* The document file to upload. Accepted formats: PDF, JPEG, PNG, GIF, WebP. Maximum file size: 10MB. This should be a utility bill or carrier invoice dated within the last 30 days that shows the account name, owner/authorized user name, and service address. ### Response **document\_sid** `string` A unique document identifier to reference when initiating the port request. ```bash Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/port/document \ -H "Authorization: Bearer " \ -F "file=@/path/to/utility-bill.pdf" ``` ```json Response theme={null} { "data": { "document_sid": "doc_abc123" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Initiate Port Request Source: https://docs.bland.ai/api-v1/post/sip-port-initiate POST https://api.bland.ai/v1/sip/port/initiate Submit a number porting request to transfer phone numbers from another carrier to Bland. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_numbers** `array` *required* Array of phone numbers to port. Each must be in E.164 format. You should verify portability first using `GET /v1/sip/port/check`. **losing\_carrier\_information** `object` *required* Information about the account with the current carrier. It must match the carrier's records exactly. * `customer_type` (string, required): `"Business"` or `"Individual"`. Values are case-sensitive. * `customer_name` (string, required): Name on the carrier account. * `account_number` (string): Account number with the losing carrier. * `account_telephone_number` (string, required): Billing telephone number on the carrier account. * `authorized_representative` (string, required): Full name of the person authorized to port the numbers. * `authorized_representative_email` (string, required): Email that receives the Letter of Authorization to sign. * `address` (object, required): Service address with `street`, `street_2` (optional), `city`, `state`, `zip`, and `country`. **target\_port\_in\_date** `string` *required* Requested port date in `YYYY-MM-DD` format. Must be at least 4 days from today. **documents** `array` *required* Array of document SIDs returned from `POST /v1/sip/port/document`. At least one is required. **phone\_number\_pins** `object` Map of phone number to its account PIN with the losing carrier, for example `{"+14150000000": "1234"}`. Required for numbers where the portability check returns `pin_required`. **notification\_emails** `array` Emails that receive port status updates. Defaults to `authorized_representative_email`. ### Response **port\_request\_id** `string` Unique identifier for the port request. **status** `string` Initial status: `"waiting_for_signature"`. **signature\_url** `string` URL for electronically signing the Letter of Authorization. **phone\_numbers** `array` Array of phone numbers included in the port request. Number porting typically takes **7–14 business days**. Track progress via `GET /v1/sip/port` or the SIP Dashboard. **Port status flow:** `waiting_for_signature` → `submitted` → `in_progress` → `completed` ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/port/initiate \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_numbers": ["+14150000000", "+14150000001"], "losing_carrier_information": { "customer_type": "Business", "customer_name": "Acme Corp", "account_number": "ACC-12345", "account_telephone_number": "+14150000000", "authorized_representative": "Jane Doe", "authorized_representative_email": "jane@acme.com", "address": { "street": "123 Main St", "street_2": "Suite 100", "city": "San Francisco", "state": "CA", "zip": "94105", "country": "US" } }, "target_port_in_date": "2026-03-20", "notification_emails": ["it@acme.com"], "documents": ["doc_abc123"] }' ``` ```json Response theme={null} { "data": { "port_request_id": "port_xyz789", "status": "waiting_for_signature", "signature_url": "https://sign.example.com/loa/port_xyz789", "phone_numbers": ["+14150000000", "+14150000001"] }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send SIP Test Call Source: https://docs.bland.ai/api-v1/post/sip-test-call POST https://api.bland.ai/v1/sip/test-call Place a live test call to your SIP endpoint to verify connectivity. Rate limited to 10 calls per 15 minutes. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The phone number with an outbound SIP configuration to test. Must be in E.164 format. ### Response **call\_id** `string` A unique call identifier. Use this to poll the test call status. **message** `string` Confirmation message. Test calls are rate-limited to **10 per 15 minutes** per organization. ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/test-call \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14150000000" }' ``` ```json Response theme={null} { "data": { "call_id": "tc_abc123", "message": "Test call initiated" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update SIP Direction Source: https://docs.bland.ai/api-v1/post/sip-update POST https://api.bland.ai/v1/sip/update Update an existing SIP routing direction for a phone number. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **phone\_number** `string` *required* The phone number to update. Must be in E.164 format. **updates** `object` *required* The updated direction object. Must include `type` (`"inbound"` or `"outbound"`). For outbound updates, you can modify `sip_endpoint`, `options` (port, transport, secure\_media, sip\_username, sip\_password), and `headers`. For inbound updates, you can modify `auth_mode`, `register_auth`, `sip_endpoint`, `options`, and `headers`. ### Response **register\_password\_for\_pbx** `string` Returned when switching to or updating registration-based auth. Configure this password in your PBX. ```json Example Request theme={null} curl -X POST https://api.bland.ai/v1/sip/update \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "phone_number": "+14150000000", "updates": { "type": "outbound", "sip_endpoint": "sip:new.provider.com", "options": { "port": 5061, "transport": "tls", "secure_media": true } } }' ``` *** Docs for agents: [llms.txt](/llms.txt) # SMS Conversation Analysis Source: https://docs.bland.ai/api-v1/post/sms-analyze POST https://api.bland.ai/v1/sms/analyze Answer questions and extract information from an SMS conversation. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **schema\_id** `string` *required* The ID of the citation schema to use for extracting variables from the SMS conversation. **conversation\_id** `string` *required* The ID of the SMS conversation to analyze. ### Response **data** `object` The response data containing analysis results. **data** **status** `string` The status of the analysis operation. Returns "success" on successful completion. **conversation\_id** `string` The ID of the SMS conversation that was analyzed. **schema\_id** `string` The ID of the citation schema that was used for analysis. **schema\_name** `string` The name of the citation schema that was used. **variables\_extracted** `number` The total number of variables that were successfully extracted from the conversation. **extracted\_variables** `object` An object containing the extracted variables as key-value pairs, where keys are variable names and values are the extracted data. **citations** `array` An array of citation objects that reference where each variable was found in the conversation. **citation object** **variable** `string` The name of the variable this citation references. **message** `string` The message text where the variable was found. **confidence** `number` The confidence score (0-1) for this extraction. **messages\_processed** `number` The total number of messages in the conversation that were processed. **errors** `array` An array of error objects. Empty array when the request is successful. ```json Response theme={null} { "data": { "status": "success", "conversation_id": "conv_123456", "schema_id": "schema_789", "schema_name": "Customer Intent Analysis", "variables_extracted": 5, "extracted_variables": { "customer_name": "John Smith", "preferred_time": "morning", "service_type": "moving", "urgency": "high", "budget_range": "$500-1000" }, "citations": [ { "variable": "customer_name", "message": "Hi, this is John Smith calling about...", "confidence": 0.95 } ], "messages_processed": 12 }, "errors": [] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send SMS Batch Source: https://docs.bland.ai/api-v1/post/sms-batch POST https://api.bland.ai/v1/sms/batch Send SMS messages to a large list of recipients from a pre-uploaded CSV file. Processing is handled asynchronously via a background workflow. > [!NOTE] > > **Enterprise Feature** - SMS batch sending is only available on Enterprise plans. Contact your Bland representative for access. ### Before You Begin: Upload Your CSV Before calling this endpoint, you must upload your recipient CSV file and get a `file_id`. Upload your CSV via `POST https://api.bland.ai/v1/files/attach` with `file_type: "batches"`. The response will include a `file_id` (UUID) that you pass to this endpoint. **CSV format requirements:** * Must include a column named exactly **`phone_number`** containing E.164-formatted numbers (e.g. `+14155551234`). Numbers without a leading `+` are automatically prefixed. * The `phone_number` column **cannot be remapped** via `column_mapping` — the column must be named `phone_number` in the CSV itself. * Additional columns become dynamic variables available in your pathway via `{{column_name}}` syntax. * Columns named `request_data.fieldname` (dot notation) are automatically parsed into the recipient's `request_data` object. * JSON arrays of objects are also accepted as an alternative to CSV. Example CSV: ```csv theme={null} phone_number,first_name,request_data.account_id +14155551234,Alice,acc_001 +10987654321,Bob,acc_002 ``` *** ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **file\_id** `string` *required* The ID of a previously uploaded CSV file containing recipient phone numbers. The file must have been uploaded with `file_type: "batches"`. See [Before You Begin](#before-you-begin-upload-your-csv) above. **global** `object` *required* Default SMS parameters applied to every message in the batch. **global object** **agent\_number** `string` *required* The E.164 formatted phone number to send messages from. Must be an SMS-enabled inbound number configured on your account. **agent\_message** `string` The initial outbound message to send to each recipient. If omitted, the pathway configured on the number will handle the opening message. **request\_data** `object` Default request data to associate with each conversation. Per-recipient `request_data` from the CSV is merged on top of this, with recipient values taking precedence. **metadata** `object` Custom metadata to attach to each conversation. Returned in all webhook payloads for correlating conversations with your internal systems. **disposition\_ids** `string[]` An array of outcome IDs to run when each conversation ends. If omitted, the outcomes configured on the SMS number are used. See [Outcomes](/tutorials/outcomes). **citation\_schema\_ids** `string[]` An array of citation schema IDs to extract when each conversation ends. If omitted, the citation schemas configured on the SMS number are used. See [Citations](/enterprise-features/citations). **column\_mapping** `object` Maps column names in your CSV to SMS send parameter names. Use this when your CSV column names don't match the expected field names. Use this to map non-phone columns to `request_data` or other SMS parameters. **Note:** `phone_number` cannot be used as a target — the phone number column in your CSV must be named `phone_number` exactly. Map columns to `request_data` to make them available as pathway variables: ```json theme={null} { "customer_name": "request_data", "preferred_lang": "request_data" } ``` Only `request_data` is supported as a target — per-recipient fields like `pathway_id` or `persona_id` cannot be overridden from the CSV. Alternatively, use dot notation column names in your CSV directly (e.g. `request_data.customer_name`) to avoid needing `column_mapping` at all. ### Response **data** `object` Confirmation that the batch was accepted for processing. **data object** **message** `string` Confirmation message indicating the batch was queued. **batch\_id** `string` The `file_id` used for this batch, for reference. **workflow\_id** `string` The ID of the background workflow processing this batch. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Request theme={null} { "file_id": "file_abc123", "global": { "agent_number": "+14155551234", "pathway_id": "pathway_xyz789", "channel": "sms" }, "column_mapping": { "customer_name": "request_data" } } ``` ```json Response (Success) theme={null} { "data": { "message": "SMS batch processing initiated via Temporal workflow", "batch_id": "file_abc123", "workflow_id": "workflow_def456" }, "errors": null } ``` ```json Error Response (Missing file_id) theme={null} { "data": null, "errors": [ { "error": "MISSING_FILE_ID", "message": "file_id is required" } ] } ``` ```json Error Response (File not found) theme={null} { "data": null, "errors": [ { "error": "FILE_NOT_FOUND", "message": "File not found or invalid file type for SMS batches" } ] } ``` ```json Error Response (Agent number not found) theme={null} { "data": null, "errors": [ { "error": "AGENT_NUMBER_NOT_FOUND", "message": "Agent number not found or not configured for SMS" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # End Conversation Source: https://docs.bland.ai/api-v1/post/sms-conversations-end POST https://api.bland.ai/v1/sms/conversations/{conversation_id}/end Close a conversation for good, typically when a human rep is done with it. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Ends the conversation without handing it back to the agent. Use it when a human rep has finished a thread they [took over](/api-v1/post/sms-conversations-handoff) and the agent should not resume, or whenever your platform wants to close an active thread cleanly. It also works on threads that were never handed off. The conversation is marked inactive, any human handoff is cleared (its audit trail is kept in the conversation's `metadata.last_human_handoff`), the inactivity timer is cancelled, post-conversation analysis runs (summary, citations, dispositions), and a single `status: "ended"` [status webhook](/tutorials/post-call-webhooks#sms-webhooks) fires with the same payload an End Call node produces. No `human_handoff_ended` webhook is sent; `ended` is the final event. > [!NOTE] > > Nothing is sent to the customer. If the rep wants to say goodbye, send it first with [Send Message on Conversation](/api-v1/post/sms-conversations-messages), then call this. The next inbound text from the customer starts a fresh conversation with the agent. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **conversation\_id** `string` *required* The conversation to end. ### Body Parameters **reason** `string` Surfaced as `status_reason` on the `ended` webhook. Max 500 characters. Defaults to "Conversation ended by the human rep" when a handoff was active, otherwise "Conversation ended via API". **actor** `string` Who ended the thread, for the audit trail. ### Response **data.was\_active** `boolean` `false` when the conversation was already over. Nothing is changed and no webhook fires in that case; whatever ended it already sent one. **data.was\_handed\_off** `boolean` `true` when a human owned the thread at the moment it was ended. ```json Response theme={null} { "data": { "message": "Conversation ended", "was_active": true, "was_handed_off": true, "conversation": { "id": "8f1c2a4e-1b7d-4f2a-9c1e-2d3f4a5b6c7d", "is_active": false, "current_node_id": "transfer-to-human", "human_handoff_at": null, "human_handoff_reason": null, "human_handoff_metadata": null, "updated_at": "2026-09-11T20:14:37.000Z" }, "workflow_id": "sms-end:8f1c2a4e-1b7d-4f2a-9c1e-2d3f4a5b6c7d:3d2f1c0b-..." }, "errors": null } ``` # Hand Off Conversation to a Human Source: https://docs.bland.ai/api-v1/post/sms-conversations-handoff POST https://api.bland.ai/v1/sms/conversations/{conversation_id}/handoff Pause the agent on a conversation so a human can take over the thread. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Hands a live messaging thread to a human. After this call: * The agent stops replying on this conversation. Inbound messages are still stored, and each one still fires the [message webhook](/tutorials/post-call-webhooks#sms-webhooks) with `sender: "USER"`, so your system sees every reply in real time. * The inactivity timeout is suspended. * Your human replies on the same thread, from the same number, with [Send Message on Conversation](/api-v1/post/sms-conversations-messages). * A `status: "human_handoff"` webhook fires once at the transition. Call [Resume Conversation](/api-v1/post/sms-conversations-resume) to hand the thread back to the agent. The conversation keeps its ID throughout, unlike setting `is_active: false`, which makes the next inbound message start a new conversation. You can also trigger a handoff from inside a pathway with the **Transfer to Human** node. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **conversation\_id** `string` *required* The conversation to hand off. ### Body Parameters **reason** `string` Why the thread was handed off. Returned as `reason` on the `human_handoff` status webhook and shown in the dashboard. **metadata** `object` Free-form data about the handoff (rep id, ticket, lane, and so on). Merged into `metadata.human_handoff` on every webhook for this conversation while the handoff is active. **actor** `string` Who took the thread, for the audit trail (an email, a rep id). **webhook** `string` Replace the conversation's webhook URL at handoff time, for example to route relayed messages to your live-agent service. **notify\_number** `string` E.164 number to text a heads-up to, from the agent number, with the conversation ID and reason. ### Response **data.already\_active** `boolean` `true` when the conversation was already handed off. The call is idempotent. **data.conversation** `object` `id`, `is_active`, `current_node_id`, `human_handoff_at`, `human_handoff_reason`, `human_handoff_metadata`, `updated_at`. ```json Response theme={null} { "data": { "message": "Conversation handed off to a human", "already_active": false, "conversation": { "id": "8f1c2a4e-1b7d-4f2a-9c1e-2d3f4a5b6c7d", "is_active": true, "current_node_id": "transfer-to-human", "human_handoff_at": "2026-09-02T18:04:11.000Z", "human_handoff_reason": "Final rate negotiation", "human_handoff_metadata": { "source": "api", "actor": "broker@example.com", "load_id": "L-77" }, "updated_at": "2026-09-02T18:04:11.000Z" } }, "errors": null } ``` # Send Message on Conversation Source: https://docs.bland.ai/api-v1/post/sms-conversations-messages POST https://api.bland.ai/v1/sms/conversations/{conversation_id}/messages Send a message on an existing conversation from the agent number, as a human rep or as the agent. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Sends a fixed message on a specific conversation. The message goes out from the conversation's agent number to the user's number, is stored on the thread, and fires the message webhook with `sender` set to `"HUMAN"` (default) or `"AGENT"`. Unlike [Send SMS](/api-v1/post/sms-send), this is keyed on the conversation ID rather than the number pair, so it always lands on this thread, including while the conversation is handed off to a human. ### Headers **authorization** `string` *required* Your API key for authentication. **idempotency-key** `string` Safe retries: repeated requests with the same key do not send a second message. ### Path Parameters **conversation\_id** `string` *required* The conversation to send on. ### Body Parameters **message** `string` *required* The text to send. Up to 1600 characters. **sender** `string` `"HUMAN"` (default) attributes the message to a human rep in the transcript and webhooks. `"AGENT"` attributes it to the agent, the same as `agent_message` on Send SMS. ### Response **data.message\_id** `string` Use with delivery status webhooks. **data.human\_handoff\_active** `boolean` Whether the conversation is currently handed off. ```json 202 Accepted theme={null} { "data": { "status": "processing", "message": "Message accepted for delivery", "conversation_id": "8f1c2a4e-1b7d-4f2a-9c1e-2d3f4a5b6c7d", "sender": "HUMAN", "message_id": "b7e2c1d0-3f4a-4b5c-8d9e-0f1a2b3c4d5e", "human_handoff_active": true }, "errors": null } ``` # Resume Conversation Source: https://docs.bland.ai/api-v1/post/sms-conversations-resume POST https://api.bland.ai/v1/sms/conversations/{conversation_id}/resume Hand a conversation back to the agent after a human handoff. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Clears the human handoff so the agent replies again on the next inbound message. Optionally moves the pathway to a specific node first, and optionally sends a message or generates one right away. A `status: "human_handoff_ended"` webhook fires. > [!NOTE] > > If the pathway is still sitting on the **Transfer to Human** node, pass `node_id` so the agent continues somewhere useful. Otherwise the next inbound message re-enters that node and hands the thread off again. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **conversation\_id** `string` *required* The conversation to resume. ### Body Parameters **node\_id** `string` Pathway node to continue from. **message** `string` A fixed message to send from the agent as it takes the thread back. Cannot be combined with `generate_reply`. **generate\_reply** `boolean` Have the agent generate and send its next turn immediately from the current (or `node_id`) node, rather than waiting for the user to text. **actor** `string` Who returned the thread, for the audit trail. ### Response **data.was\_active** `boolean` `false` when no handoff was active (the node jump still applies). ```json Response theme={null} { "data": { "message": "Conversation returned to the agent", "was_active": true, "conversation": { "id": "8f1c2a4e-1b7d-4f2a-9c1e-2d3f4a5b6c7d", "is_active": true, "current_node_id": "confirm-booking", "human_handoff_at": null, "human_handoff_reason": null, "human_handoff_metadata": null, "updated_at": "2026-09-02T18:31:02.000Z" }, "status": "processing", "message_id": "0c9d8e7f-6a5b-4c3d-9e8f-7a6b5c4d3e2f" }, "errors": null } ``` # Create SMS Conversation Source: https://docs.bland.ai/api-v1/post/sms-create POST https://api.bland.ai/v1/sms/create Create an SMS conversation with specific pathway state without triggering immediate message sending. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **user\_number** `string` *required* The E.164 formatted phone number of the user in the conversation. **agent\_number** `string` *required* The E.164 formatted phone number used by the agent (must belong to the authenticated account). **message** `string` *required* The content of the message to be stored in the conversation history. **message\_sid** `string` Optional Twilio message SID for tracking and correlation purposes. **curr\_pathway\_id** `string` The UUID of the current pathway being used in this conversation. **curr\_pathway\_version** `string` The specific version of the pathway to use (e.g., "latest", "v1.0"). **current\_node\_id** `string` The ID of the current node in the conversational pathway where this conversation is positioned. **request\_data** `object` Optional metadata to associate with the conversation. Used for custom routing or analytics. **new\_conversation** `boolean` When set to true, forces creation of a new conversation, archiving any existing active conversation between these numbers. **sender** `string` Specifies who sent this message. Allowed values: "USER" or "AGENT". Defaults to "USER" if not specified. **time\_out** `number` Per-conversation timeout override, in seconds. When the user goes silent for this long after an agent message, the timeout flow fires (warning message and/or conversation end). Takes priority over the `time_out` on the number's sms\_config/whatsapp\_config. Persists on the conversation, so subsequent turns use the same override until another `/send` or `/create` replaces it. **timeout\_message** `string` Per-conversation override for the message sent when the timeout fires. Takes priority over `timeout_message` on sms\_config/whatsapp\_config. **warning\_time** `number` Per-conversation override for how long, in seconds, to wait before sending the warning message. Must be less than `time_out`; the request is rejected with `INVALID_TIMEOUT_CONFIG` otherwise. Takes priority over `warning_time` on sms\_config/whatsapp\_config. **warning\_message** `string` Per-conversation override for the warning message sent at `warning_time`. Takes priority over `warning_message` on sms\_config/whatsapp\_config. ### Response **data** `object` An object confirming the conversation was created successfully. **data.message** `string` Confirmation text for the successful conversation creation. **data.conversation\_id** `string` ID of the conversation that was created. **data.workflow\_id** `string` ID of the Temporal workflow triggered to process the conversation setup. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "message": "SMS conversation created successfully", "conversation_id": "conv_abc123", "workflow_id": "workflow_xyz789" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send SMS Message Source: https://docs.bland.ai/api-v1/post/sms-send POST https://api.bland.ai/v1/sms/send Send an SMS message from an agent to a user. This creates or resumes a conversation and triggers processing workflows. > [!NOTE] > > SMS is available on Enterprise plans and on the [Agent Phone Plan](/platform/agent-phone-plan). WhatsApp and iMessage are Enterprise only. Contact your Bland representative for Enterprise access. ### Headers **authorization** `string` *required* Your API key for authentication. **idempotency-key** `string` A unique key to prevent duplicate message sends. When provided, repeated requests with the same key will return successfully but will not send an additional message or incur extra charges. Useful for safely retrying failed requests without risk of double-sending. ### Body Parameters **user\_number** `string` *required* The E.164 formatted phone number of the user receiving the message. **agent\_number** `string` *required* The E.164 formatted phone number used to send the message (must belong to the authenticated account). **agent\_message** `string` The content of the SMS message to send. If not passed in, the message is generated from the conversation's pathway, persona, or `objective`, or from the number's prompt. **objective** `string` The goal of this conversation, for example "Book a haircut for Tuesday afternoon and confirm the price." Replies in the conversation are generated from it instead of the number's prompt, and so is the first message when you omit `agent_message`. Up to 20,000 characters. A later send to the same conversation with a new `objective` replaces it, and a send without one keeps it. Set `new_conversation` to `true` to start a thread without it. A `persona_id` or `pathway_id`, on the request or on the number, takes priority: those replies don't use the objective. An objective that is not a string, is empty, or is longer than 20,000 characters is rejected with a `400` and error code `INVALID_OBJECTIVE`. **request\_data** `object` Optional metadata to associate with the conversation or message. Used for custom routing or analytics. **new\_conversation** `boolean` Allows you to create a new conversation, archiving the existing conversation and ignores existing sms messages. **persona\_id** `string` UUID of a persona to use for this conversation. When provided, the persona's configuration is applied instead of the number's SMS config. Use `persona_version` to select which version to use. Cannot be used as a substitute for `agent_number` — the agent number must still belong to your account. The persona\_id controls *how* the conversation is handled, not *which number* sends it. **persona\_version** `string` Which version of the persona to use. Allowed values: `"production"` (default), `"draft"`. **persona\_settings** `object` Per-dispatch persona overrides. Takes priority over any pathway settings on the persona version or the `pathway_id` field below. **persona\_settings object** **pathway\_id** `string` Override the persona's pathway for this dispatch. **pathway\_version** `number` Specific version of the override pathway to use. **start\_node\_id** `string` Specific node to start from within the override pathway. **pathway\_id** `string` ID of the pathway to use for generating the SMS response. If `persona_id` is provided, this is used as a pathway override within the persona context (lower priority than `persona_settings`). **pathway\_version** `number` Version of the pathway to use. **start\_node\_id** `string` ID of the specific node within the pathway to start from. **webhook** `string` This overrides the webhook for the conversation, instead of using the webhook attached to the phone number. **metadata** `object` Custom metadata to attach to the conversation. This data is returned in all webhook payloads (message and status webhooks), making it useful for correlating conversations with your internal systems. **disposition\_ids** `string[]` An array of outcome IDs to run when the conversation ends. If omitted, the outcomes configured on the SMS number are used. If provided, overrides the number's configuration. See [Outcomes](/tutorials/outcomes) for details. **citation\_schema\_ids** `string[]` An array of citation schema IDs to extract when the conversation ends. If omitted, the citation schemas configured on the SMS number are used. If provided, overrides the number's configuration. See [Citations](/enterprise-features/citations) for details. **channel** `string` The channel to send the message on. Defaults to "sms". Allowed values: "sms", "whatsapp", "imessage". For numbers provisioned for iMessage, the channel is auto-derived from the number's configuration, so you don't need to set this explicitly. See [iMessage](/tutorials/messaging/imessage) for details. **content\_sid** `string` The Twilio SID of the content to send, usually in HXXXX format. **content\_variables** `object` The variables to send with the content. Example: ```json theme={null} { "1": "John", "2": "Smith", "3": "Premium Plan" } ``` **time\_out** `number` Per-conversation timeout override, in seconds. When the user goes silent for this long after an agent message, the timeout flow fires (warning message and/or conversation end). Takes priority over the `time_out` on the number's sms\_config/whatsapp\_config. Persists on the conversation, so subsequent turns use the same override until another `/send` or `/create` replaces it. **timeout\_message** `string` Per-conversation override for the message sent when the timeout fires. Takes priority over `timeout_message` on sms\_config/whatsapp\_config. **warning\_time** `number` Per-conversation override for how long, in seconds, to wait before sending the warning message. Must be less than `time_out`; the request is rejected with `INVALID_TIMEOUT_CONFIG` otherwise. Takes priority over `warning_time` on sms\_config/whatsapp\_config. **warning\_message** `string` Per-conversation override for the warning message sent at `warning_time`. Takes priority over `warning_message` on sms\_config/whatsapp\_config. ### Response **data** `object` An object confirming the message was sent and referencing the triggered workflow. **data.message** `string` Confirmation text for the successful send. **data.conversation\_id** `string` ID of the conversation that was created or resumed. **data.message\_id** `string` ID of the message that was sent, if a single message was sent, to track message delivery and status. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "message": "SMS sent successfully", "conversation_id": "convo_abc123", "workflow_id": "workflow_xyz789" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update SMS Configuration Source: https://docs.bland.ai/api-v1/post/sms-update POST https://api.bland.ai/v1/sms/number/update Update the SMS configuration for a phone number owned by the authenticated user. > [!NOTE] > > **Enterprise Feature** - SMS is only available on Enterprise plans. Contact your Bland representative for access. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **phone\_number** `string` *required* The E.164 formatted phone number to update (must belong to the authenticated user). **webhook** `string` When the agent sends a response, we’ll send the message details in a POST request to the URL you specify here, along with chat history. **request\_data** `object|array` Request data fields are available to the AI agent during the call when referenced in the associated pathway or task. **time\_out** `number` Maximum time to wait for a user response, in seconds, before the timeout flow fires. Default is no timeout. Can be overridden per-conversation via `/v1/sms/send` or `/v1/sms/create`. **timeout\_action** `string` What to do when the timeout fires. Allowed values depend on your configuration (e.g. `"send_sms"` to send `timeout_message`). **timeout\_message** `string` Message sent when the timeout fires. Can be overridden per-conversation via `/v1/sms/send` or `/v1/sms/create`. **warning\_time** `number` Seconds to wait before sending the warning message. Must be less than `time_out`, otherwise the update is rejected. Can be overridden per-conversation via `/v1/sms/send` or `/v1/sms/create`. **warning\_message** `string` Message sent at `warning_time`. Can be overridden per-conversation via `/v1/sms/send` or `/v1/sms/create`. **messaging\_service\_sid** `string` Twilio Messaging Service SID, if set. **objective** `string` Assistant system prompt or conversational goal. **tools** `array` List of tools available to the assistant. **temperature** `number` The model’s temperature setting, controlling creativity. **pathway\_id** `string` The ID of the linked conversational pathway (if any). **pathway\_version** `string` The specific version of the pathway to use. **start\_node\_id** `string` Entry point node ID for the pathway. **restart\_after\_end\_call** `boolean` When `true`, a new conversation is automatically started if the user texts after the current conversation has ended. When `false`, subsequent messages are stored in the ended conversation without triggering a new reply. **timezone** `string` The timezone used for time-based variables in the conversation (e.g. `"America/New_York"`). **summary\_prompt** `string` Custom prompt used to generate a conversation summary when the conversation ends. When set, an AI-generated summary is included in the status webhook and stored on the conversation. **disposition\_ids** `string[]` An array of outcome IDs to run when conversations end on this number. See [Outcomes](/tutorials/outcomes). **citation\_schema\_ids** `string[]` An array of citation schema IDs to extract when conversations end on this number. See [Citations](/enterprise-features/citations). ### Response **data** `object` Contains a confirmation message and the updated SMS configuration. **data.message** `string` Success message confirming the update. **data.sms\_config** `object` The updated and sanitized SMS configuration object. **errors** `null|array` `null` on success. If an error occurs, this will be an array of error objects. **errors\[].message** `string` A human-readable description of the error. **errors\[].error** `string` A machine-readable error code. ```json Response theme={null} { "data": { "message": "SMS config updated for number +15550001111", "sms_config": { "webhook": null, "request_data": [], "time_out": null, "timeout_action": null, "timeout_message": null, "warning_time": null, "warning_message": null, "messaging_service_sid": null, "objective": "Chat with the user", "tools": [], "temperature": 0, "pathway_id": null, "pathway_version": null, "start_node_id": null, "restart_after_end_call": true, "timezone": null, "summary_prompt": null, "disposition_ids": null, "citation_schema_ids": null } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create a Custom Tool Source: https://docs.bland.ai/api-v1/post/tools POST https://api.bland.ai/v1/tools Create a Custom Tool that can take AI input and call external APIs. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **name** `string` *required* This is the name that the AI using the tool will see. Some other internal tools are named `Speak`, `Wait`, `Transfer` and `Finish` - Custom Tools cannot share these names. We've made a list of reserved words that can confuse the AI that cannot be included: * `input` * `speak` * `transfer` * `switch` * `wait` * `finish` * `press` * `button` * `say` * `pause` * `record` * `play` * `dial` * `hang` Choosing too similar of names to the default tools could cause the AI to select the wrong one, so decriptive two to three-word names are preferred. **description** `string` *required* This is the description that the AI using the tool will see. Describe the effect of what the tool does or any special instructions. For reference, here are the default tools' descriptions: * `Speak`: Talk to the person on the other end of the line * `Press Buttons`: Presses buttons on phone. Each character is a different button. * `Wait`: Wait and go silent for an extended period of time (only use if absolutely necessary). * `Finish`: Say a goodbye message and end the call once completed. **speech** `string` This is the text that the AI will say while it uses the tool. For example, if the tool is a "GenerateQuote" tool, the speech might be "Please wait while I get you your quote." Since tools can be verbally interrupted, shorter messages that tell the user what the tool/AI are doing are best. Special Note: You can have the AI dynamically generate speech by defining `input.speech` in the `input_schema`. > [accordion] Dynamic Speech Example > > ```json theme={null} > { > "input_schema": { > "example": { > "speech": "Checking your account details right now John!", > "name": "John Doe", > "email": "johndoe@gmail.com" > }, > "type": "object", > "properties": { > "speech": { > "type": "string" > }, > "name": { > "type": "string" > }, > "email": { > "type": "string", > "format": "email" > } > }, > "required": ["speech", "name", "email"] > } > } > ``` **url** `string` *required* This is the endpoint of the external API that the tool will call. It must begin with `https://` and be a valid URL. **method** `string` (default: GET) This is the HTTP method that the tool will use to call the external API. Valid options are `GET` and `POST`. **headers** `object` `SUPPORTS PROMPT VARIABLES` These are the headers that the tool will send to the external API. The headers must be in JSON format. Since prompt variables are supported, you can use them in the headers to send dynamic information to the external API. > [accordion] Prompt Variables Example (Headers) > > ```json theme={null} > // At the top level of your send call request you can define variables that you can access later using the double curly braces/dot syntax. > { > "request_data": { > "api_key": "sk-1234567890", > }, > "tools": [ > { > "headers": { > "Authorization": "Bearer {{api_key}}" > } > } > ] > } > ``` **body** `object` `SUPPORTS PROMPT VARIABLES` This is the body that the tool will send to the external API. The body must be in JSON format. This is the most common place to use Prompt Variables with AI input. Note: `GET` requests do not have a body. > [accordion] Prompt Variables Example (Body) > > ```json theme={null} > // AI-generated input is created as the `input` Prompt Variable - and the structure is defined by the input schema. > // `input` will match the structure of `input_schema.example` if it is defined. > { > "input_schema": { > "example": { > "name": "John Doe", > "email": "johndoe@gmail.com" > } > } > "body": { > "name": "{{input.name}}", > "email": "{{input.email}}" > } > } > ``` **query** `object` `SUPPORTS PROMPT VARIABLES` Append query parameters to the URL. The query must be in JSON format. This is generally used with GET requests and built-in Prompt Variables like `"{{phone_number}}"` or `"{{call_id}}"`. > [accordion] Prompt Variables Example (Query) > > ```json theme={null} > // appends ?pn={{phone_number}}&callId={{call_id}} to the URL > { > "query": { > "pn": "{{phone_number}}", > "callId": "{{call_id}}" > } > } > ``` **input\_schema** `object` This is the schema that the AI input must match for the tool to be used. The schema must be in JSON format. The schema is used to validate the AI input before the tool is used. If the AI input does not match the schema, the tool will not be used and the AI will move on to the next tool. `input_schema.example` can be used to enhance the AI's understanding of the input structure and helps significantly with structured or nested data. Special Note: `input_schema` does not require strict JSON schema structure, and creativity is encouraged. [Look here for a general guide on JSON schema structures.](https://json-schema.org/learn/getting-started-step-by-step) Non-traditional JSON schema structures are supported as well, like these examples: * "options": "monday, wednesday, friday" * "date": "YYYY-MM-DD" * "time": "HH:MM:SS (AM|PM)" * "phone\_number": "+1XXX-XXX-XXXX" Agent input can be nested, and the will be transformed into JSON even if it's initially a string. > [accordion] Schema Example > > ```json theme={null} > { > "input_schema": { > "example": { > "name": "John Doe", > "email": "johndoe@gmail.com" > }, > "type": "object", > "properties": { > "name": { > "type": "string" > }, > "email": { > "type": "string", > "format": "email" > } > }, > "required": ["name", "email"] > }, > // both of these methods are identical, since {{input}} will be transformed into JSON > "body": "{{input}}", > "body": { > "name": "{{input.name}}", > "email": "{{input.email}}" > } > } > ``` **response** `object` Define how you would like to extract data from the response. By default, the entire response body is stored in the `{{data}}` Prompt Variable. The path to the data you want must be in JSON Path format. Generally this means using dot notation to traverse the JSON object and is only required if you need to use that information on other tools or the response is too large. Example: ```json theme={null} // If the external API response is: { "available_times": [ { "time": "10:00 AM", "date": "2022-01-01" }, { "time": "11:00 AM", "date": "2022-01-01" } ], "store_hours": { "open": "9:00 AM", "close": "5:00 PM" }, "address_info": { "street": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345" } } // You can extract new Prompt Variables like this: { "response": { "available_times": "$.available_times", "store_hours": "$.store_hours", "address_info": "$.address_info", "zip_code": "$.address_info.zip" } } // And then it'll automatically replace them elsewhere (like in the `task`/`prompt`) { "task": "The store is open from {{store_hours.open}} to {{store_hours.close}}.", "prompt": "The store is located at {{address_info.street}}, {{address_info.city}}, {{address_info.state}} {{zip_code}}." } ``` **timeout** `number` (default: 10000) This is the maximum time in milliseconds that the tool will wait for a response from the external API. If the external API does not respond within this time, the tool will fail and the AI will move on to the next tool. The default timeout is 10 seconds (10000 milliseconds). To always wait for a response, set the timeout to an extremely high value like 99999999. ### Response **status** `string` Whether the tool creation succeeded. **tool\_id** `string` A tool id that you can use to reference the tool in the future. In a Send Call request, you could pass this tool id in instead of the full Custom Tool object like so: ```json theme={null} { "tools": [ "TL-1234567890" // tool_id (instead of the full Custom Tool object) ] } ``` ```json theme={null} { "status": "success", "tool_id": "TL-1234567890" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Custom Tool Source: https://docs.bland.ai/api-v1/post/tools-tool-id POST https://api.bland.ai/v1/tools/{tool_id} Change your Custom Tool's parameters and characteristics. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **tool\_id** `string` *required* The ID of the Custom Tool you want to update. ### Body **name** `string` *required* This is the name that the AI using the tool will see. Some other internal tools are named `Speak`, `Wait`, `Transfer` and `Finish` - Custom Tools cannot share these names. We've made a list of reserved words that can confuse the AI that cannot be included: * `input` * `speak` * `transfer` * `switch` * `wait` * `finish` * `press` * `button` * `say` * `pause` * `record` * `play` * `dial` * `hang` Choosing too similar of names to the default tools could cause the AI to select the wrong one, so decriptive two to three-word names are preferred. **description** `string` *required* This is the description that the AI using the tool will see. Describe the effect of what the tool does or any special instructions. For reference, here are the default tools' descriptions: * `Speak`: Talk to the person on the other end of the line * `Press Buttons`: Presses buttons on phone. Each character is a different button. * `Wait`: Wait and go silent for an extended period of time (only use if absolutely necessary). * `Finish`: Say a goodbye message and end the call once completed. **speech** `string` This is the text that the AI will say while it uses the tool. For example, if the tool is a "GenerateQuote" tool, the speech might be "Please wait while I get you your quote." Since tools can be verbally interrupted, shorter messages that tell the user what the tool/AI are doing are best. Special Note: You can have the AI dynamically generate speech by defining `input.speech` in the `input_schema`. > [accordion] Dynamic Speech Example > > ```json theme={null} > { > "input_schema": { > "example": { > "speech": "Checking your account details right now John!", > "name": "John Doe", > "email": "johndoe@gmail.com" > }, > "type": "object", > "properties": { > "speech": { > "type": "string" > }, > "name": { > "type": "string" > }, > "email": { > "type": "string", > "format": "email" > } > }, > "required": ["speech", "name", "email"] > } > } > ``` **url** `string` *required* This is the endpoint of the external API that the tool will call. It must begin with `https://` and be a valid URL. **method** `string` (default: GET) This is the HTTP method that the tool will use to call the external API. Valid options are `GET` and `POST`. **headers** `object` `SUPPORTS PROMPT VARIABLES` These are the headers that the tool will send to the external API. The headers must be in JSON format. Since prompt variables are supported, you can use them in the headers to send dynamic information to the external API. > [accordion] Prompt Variables Example (Headers) > > ```json theme={null} > // At the top level of your send call request you can define variables that you can access later using the double curly braces/dot syntax. > { > "request_data": { > "api_key": "sk-1234567890", > }, > "tools": [ > { > "headers": { > "Authorization": "Bearer {{api_key}}" > } > } > ] > } > ``` **body** `object` `SUPPORTS PROMPT VARIABLES` This is the body that the tool will send to the external API. The body must be in JSON format. This is the most common place to use Prompt Variables with AI input. Note: `GET` requests do not have a body. > [accordion] Prompt Variables Example (Body) > > ```json theme={null} > // AI-generated input is created as the `input` Prompt Variable - and the structure is defined by the input schema. > // `input` will match the structure of `input_schema.example` if it is defined. > { > "input_schema": { > "example": { > "name": "John Doe", > "email": "johndoe@gmail.com" > } > } > "body": { > "name": "{{input.name}}", > "email": "{{input.email}}" > } > } > ``` **query** `object` `SUPPORTS PROMPT VARIABLES` Append query parameters to the URL. The query must be in JSON format. This is generally used with GET requests and built-in Prompt Variables like `"{{phone_number}}"` or `"{{call_id}}"`. > [accordion] Prompt Variables Example (Query) > > ```json theme={null} > // appends ?pn={{phone_number}}&callId={{call_id}} to the URL > { > "query": { > "pn": "{{phone_number}}", > "callId": "{{call_id}}" > } > } > ``` **input\_schema** `object` This is the schema that the AI input must match for the tool to be used. The schema must be in JSON format. The schema is used to validate the AI input before the tool is used. If the AI input does not match the schema, the tool will not be used and the AI will move on to the next tool. `input_schema.example` can be used to enhance the AI's understanding of the input structure and helps significantly with structured or nested data. Special Note: `input_schema` does not require strict JSON schema structure, and creativity is encouraged. [Look here for a general guide on JSON schema structures.](https://json-schema.org/learn/getting-started-step-by-step) Non-traditional JSON schema structures are supported as well, like these examples: * "options": "monday, wednesday, friday" * "date": "YYYY-MM-DD" * "time": "HH:MM:SS (AM|PM)" * "phone\_number": "+1XXX-XXX-XXXX" Agent input can be nested, and the will be transformed into JSON even if it's initially a string. > [accordion] Schema Example > > ```json theme={null} > { > "input_schema": { > "example": { > "name": "John Doe", > "email": "johndoe@gmail.com" > }, > "type": "object", > "properties": { > "name": { > "type": "string" > }, > "email": { > "type": "string", > "format": "email" > } > }, > "required": ["name", "email"] > }, > // both of these methods are identical, since {{input}} will be transformed into JSON > "body": "{{input}}", > "body": { > "name": "{{input.name}}", > "email": "{{input.email}}" > } > } > ``` **response** `object` Define how you would like to extract data from the response. By default, the entire response body is stored in the `{{data}}` Prompt Variable. The path to the data you want must be in JSON Path format. Generally this means using dot notation to traverse the JSON object and is only required if you need to use that information on other tools or the response is too large. Example: ```json theme={null} // If the external API response is: { "available_times": [ { "time": "10:00 AM", "date": "2022-01-01" }, { "time": "11:00 AM", "date": "2022-01-01" } ], "store_hours": { "open": "9:00 AM", "close": "5:00 PM" }, "address_info": { "street": "123 Main St", "city": "Anytown", "state": "CA", "zip": "12345" } } // You can extract new Prompt Variables like this: { "response": { "available_times": "$.available_times", "store_hours": "$.store_hours", "address_info": "$.address_info", "zip_code": "$.address_info.zip" } } // And then it'll automatically replace them elsewhere (like in the `task`/`prompt`) { "task": "The store is open from {{store_hours.open}} to {{store_hours.close}}.", "prompt": "The store is located at {{address_info.street}}, {{address_info.city}}, {{address_info.state}} {{zip_code}}." } ``` **timeout** `number` (default: 10000) This is the maximum time in milliseconds that the tool will wait for a response from the external API. If the external API does not respond within this time, the tool will fail and the AI will move on to the next tool. The default timeout is 10 seconds (10000 milliseconds). To always wait for a response, set the timeout to an extremely high value like 99999999. ### Response **status** `string` Whether the tool creation succeeded. **tool\_id** `string` A tool id that you can use to reference the tool in the future. In a Send Call request, you could pass this tool id in instead of the full Custom Tool object like so: ```json theme={null} { "tools": [ "TL-1234567890" // tool_id (instead of the full Custom Tool object) ] } ``` ```json theme={null} { "status": "success", "tool_id": "TL-1234567890" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Translation Session Source: https://docs.bland.ai/api-v1/post/translation-sessions POST https://api.bland.ai/v1/translation/sessions Create a real-time translation session and receive a WebSocket URL for streaming audio Creates a translation session and returns a single-use WebSocket URL. Stream audio in your source language and receive translated speech back in real time — along with transcript events for every translated utterance. See the [Live Translation API tutorial](/tutorials/translation) for the full streaming protocol, audio formats, and integration walkthrough. ## Authentication **authorization** `string` *required* Your API key for authentication. The key must belong to an organization — user-scoped keys without an organization are rejected with `403 TAAS_ORG_REQUIRED`. ## Body Parameters **source\_language** `string` *required* Language the inbound audio is spoken in. Supported codes: `en`, `es`, `fr`, `de`, `it`, `pt`, `nl`, `pl`, `sv`, `fi`, `da`, `cs`, `el`, `ro`, `ru`, `tr`, `ar`, `hi`, `id`, `tl`, `zh`, `ja`, `ko` **target\_language** `string` *required* Language to translate into. Same supported codes as `source_language`. **voice\_id** `string` UUID of a Bland voice to use for the translated speech. Must belong to your organization. Defaults to a standard voice for the target language. **audio\_protocol** `string` (default: pcm16) Wire format for audio on the WebSocket. One of: * `pcm16` — raw PCM-16 little-endian binary frames * `twilio_ulaw` — Twilio Media Streams JSON envelopes carrying 8kHz μ-law audio, for direct interop with Twilio `` **sample\_rate** `integer` (default: 16000) Sample rate of the audio you will send, in Hz. `pcm16` mode only — integer between `8000` and `48000`. `16000` is recommended. Do not set this for `twilio_ulaw` (Twilio audio is always 8kHz). **max\_duration\_seconds** `integer` (default: 1800) Maximum session length in seconds, between `30` and `1800`. The session ends automatically when this limit is reached. ## Response **data** `object` **data properties** **session\_id** `string` Unique identifier for the session. Use it with the GET and DELETE endpoints. **ws\_url** `string` WebSocket URL to connect to. **Treat this as opaque** — connect to it exactly as returned. Do not parse or reconstruct it. **token** `string` Session token. Already embedded in `ws_url`; returned separately for reference. **expires\_at** `string` ISO timestamp. Connect to `ws_url` before this time (10 minutes after creation) or the session is abandoned. **max\_duration\_seconds** `integer` The resolved maximum session length. **errors** `array` (default: null) Array of error objects if the request failed > [!WARNING] > > The `ws_url` is **single-use**: it authenticates exactly one WebSocket connection. If your connection drops, create a new session — reconnecting with the same URL is rejected with close code `4001`. ## Limits & Billing * Sessions are billed **per minute** of connected time, rounded up. The per-minute rate depends on your plan. * Up to **3 concurrent sessions** per organization (pending sessions count until they expire). Contact us to raise this limit. * A daily translation-minutes rate limit applies per organization. ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v1/translation/sessions" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "source_language": "en", "target_language": "es", "audio_protocol": "pcm16", "sample_rate": 16000 }' ``` ```javascript JavaScript theme={null} const response = await fetch("https://api.bland.ai/v1/translation/sessions", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ source_language: "en", target_language: "es", audio_protocol: "pcm16", sample_rate: 16000, }), }); const { data } = await response.json(); const ws = new WebSocket(data.ws_url); // connect within 10 minutes ``` ```python Python theme={null} import requests response = requests.post( "https://api.bland.ai/v1/translation/sessions", headers={"Authorization": "Bearer YOUR_API_KEY"}, json={ "source_language": "en", "target_language": "es", "audio_protocol": "pcm16", "sample_rate": 16000, }, ) data = response.json()["data"] print(data["ws_url"]) # connect within 10 minutes ``` ```json Success theme={null} { "data": { "session_id": "9592342c-0ed2-4c5e-8ceb-16aa55c804a7", "ws_url": "wss://stream-v2.aws.dc8.bland.ai/ws/translate/eyJhbGciOiJBMjU2R0NNS1ciLCJlbmMiOiJBMjU2R0NN...", "token": "fe120676-1b18-4c87-b6fc-c984e719d3bc", "expires_at": "2026-06-04T18:15:07.885Z", "max_duration_seconds": 1800 }, "errors": null } ``` ```json Concurrency Cap theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "CONCURRENCY_CAP_EXCEEDED" } ] } ``` ## WebSocket Connection After creating a session, connect to the returned `ws_url` within 10 minutes: * **URL**: Use `ws_url` exactly as returned — it is opaque and single-use. Do not parse or reconstruct it. * **Protocol**: WebSocket (WSS) * **Authentication**: Embedded in the URL — no headers required * **Frames**: Binary frames carry audio; text frames carry JSON control events You can start sending audio immediately on connection open — frames are buffered server-side until the pipeline is ready. ### Audio Format: `pcm16` | Direction | Format | | - | - | | Client → Bland | Binary frames of raw PCM-16 little-endian mono audio at your declared `sample_rate` | | Bland → Client | Binary frames of raw PCM-16 little-endian mono audio at **16,000 Hz** | No framing or headers — raw samples only. 20ms chunks (640 bytes at 16kHz) are typical. ### Audio Format: `twilio_ulaw` All frames are JSON text in [Twilio Media Streams](https://www.twilio.com/docs/voice/media-streams) shape — base64 8kHz μ-law audio in `media.payload`. Send a `start` event first so outbound envelopes echo your `streamSid`: ```json theme={null} { "event": "start", "start": { "streamSid": "MZ..." } } { "event": "media", "media": { "payload": "" } } { "event": "stop" } ``` Outbound translated audio arrives as `{"event":"media","streamSid":"","media":{"payload":""}}`. ### Control Events JSON text frames from the server, discriminated by `type`: | Event | When | Key fields | | - | - | - | | `ready` | Pipeline warmed up; transcripts begin flowing after this | `session_id` | | `transcript` | One finalized utterance was translated | `turn_id`, `original`, `translation`, `source_language`, `target_language`, `is_final` | | `tts_complete` | All translated audio for a turn has been written to the WebSocket | `turn_id`, `audio_duration_ms` | | `session_ended` | Terminal notification — last JSON frame before close | `reason`, `session_seconds`, `end_reason` | | `error` | Fatal session failure, followed by `session_ended` and close | `code`, `message`, `fatal` | ```json Example transcript event theme={null} { "type": "transcript", "turn_id": "5862a126-2e88-46b1-bb95-0ed5c57155c1", "original": "Hello. This is a translation test.", "translation": "Hola. Esta es una prueba de traducción.", "source_language": "en", "target_language": "es", "is_final": true } ``` > [!NOTE] > > * `audio_duration_ms` is currently always `0` — a placeholder. Do not rely on it. > * A `tts_complete` may be absent for a turn whose speech synthesis failed — don't block on it. The transcript still arrives. > * Error codes that can fire: `taas/audio_protocol_mismatch` and `taas/internal_error`, both `fatal: true`. > * `session_ended.reason` is one of `client_disconnect`, `max_duration`, `error`, `api_terminated`. ### Close Codes | Code | Meaning | | - | - | | `1000` | Normal close after `session_ended` | | `1011` | Internal server error | | `4001` | Invalid, expired, or already-used session token | | `4002` | Session not found | | `4003` | Session already ended | | `4004` | First frame didn't match the declared `audio_protocol` | | `4005` | `max_duration_seconds` reached | ## Notes * Translated audio can arrive faster than real time — buffer client-side and play at the natural rate * Reconnection is not supported; if the WebSocket drops, create a new session * The WebSocket closes automatically at `max_duration_seconds` # Create Category Source: https://docs.bland.ai/api-v1/post/triage-categories POST https://api.bland.ai/v1/triage/categories Create a custom issue category. ## Overview Adds a category to your org's catalog. Issue `category` is free-form on creation, so this endpoint is only needed when you want a category to appear in pickers before any issue uses it. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **name** `string` *required* Category name. 1-64 characters. Case is preserved. *** ## Response Returns `201 Created` with the new category. **data** `object` **Category fields** **id** `string` UUID of the new category. **org\_id** `string` **name** `string` **created\_at** `string` **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "id": "5cc60a90-dfa3-4bd9-a8e7-5ee4dd1e1b87", "org_id": "5fa6dc9e-ec4d-4f94-9e0e-21f6f6a1e8f1", "name": "Voicemail Detection", "created_at": "2026-05-07T05:32:42.086Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Issue Source: https://docs.bland.ai/api-v1/post/triage-issues POST https://api.bland.ai/v1/triage/issues Create a triage issue. ## Overview Opens a new triage issue, optionally with the calls, SMS conversations, or files that prompted it. Issues are the unit of work in [Triage](https://app.bland.ai/dashboard/monitor/triage). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **title** `string` *required* Short, human-readable summary of the issue. 1-200 characters. **severity** `string` *required* How urgent the issue is. Must be one of: * `critical` * `high` * `medium` * `low` **category** `string` *required* Free-form category label, 1-64 characters. Categories are scoped to your org and reused across issues. The dashboard ships with these defaults out of the box, but you can add your own with [Create Category](/api-v1/post/triage-categories): * `Transcription` * `Speech` * `Dialogue` * `Routing` * `Tools` * `Latency` * `Telephony` * `Bug` **description** `string` Longer explanation of the problem. Maximum 10,000 characters. Shown to Norm as part of the evidence snapshot when you prompt the agent. **status** `string` (default: todo) Initial status. Defaults to `todo` if omitted. Must be one of: * `backlog` * `todo` * `in_progress` * `in_review` * `done` * `closed` **source** `string` (default: manual) Where the issue originated. Must be one of: * `manual`, created by a user from the dashboard or API (default) * `automated`, created by an automated rule (e.g. an alert binding) * `client`, created by a client integration on the user's behalf **owner\_id** `string` User ID of the person ultimately accountable for the issue. **assignee\_id** `string` User ID of the person currently working on the issue. **resource\_links** `array` Evidence to attach to the issue at creation. Each entry links the issue to a call, SMS conversation, or uploaded file. If you attach a call, the issue belongs to the agent that handled that call. It then appears on that agent's Issues page in the dashboard. ```json theme={null} { "resource_links": [ { "resource_type": "call", "resource_id": "d8ef6e50-830b-4c73-a956-3b04a1f28550" }, { "resource_type": "file", "resource_id": "54eaa506-8b68-4be7-8d14-1ff260899eee" } ] } ``` > [accordion] Resource link fields > > * `resource_type`, one of `call`, `sms_conversation`, or `file`. > * `resource_id`, the ID of the resource. For calls this is the `call_id` returned by [Send Call](/api-v1/post/calls). *** ## Response Returns `201 Created` with the newly created issue. **data** `object` The created issue. **Issue fields** **id** `string` Internal UUID of the issue. Use this in all `/v1/triage/issues/{id}/...` endpoints. **triage\_id** `string` Short, human-friendly issue identifier (for example `T-1001`) shown in the dashboard. **org\_id** `string` The org that owns this issue. **number** `number` Sequential issue number within your org. Matches the numeric portion of `triage_id`. **title** `string` **description** `string` **status** `string` One of `backlog`, `todo`, `in_progress`, `in_review`, `done`, `closed`. **severity** `string` One of `critical`, `high`, `medium`, `low`. **source** `string` One of `manual`, `automated`, `client`. **category** `string` **owner\_id** `string | null` **assignee\_id** `string | null` **author\_id** `string` User ID of the caller that created the issue. **external\_link** `object | null` External system link (for example a GitHub issue) bound to this triage issue, if any. **resource\_count** `number` Number of attached resources (calls, SMS, files). **flag\_count** `number` Number of flags raised against attached calls. **relation\_count** `number` Number of related issues linked to this one. **latest\_agent\_session** `object | null` The most recent Norm session bound to this issue, including its run state and any draft pathway version Norm is working against. `null` if Norm has never been prompted for this issue. **is\_processing** `boolean` `true` while Norm is actively running against the issue. **has\_unread\_activity** `boolean` `true` if there is activity since the caller last viewed the issue. **created\_at** `string` ISO 8601 timestamp. **updated\_at** `string` ISO 8601 timestamp. **last\_activity\_at** `string` ISO 8601 timestamp of the most recent activity entry. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "68007859-4325-4ea2-bbd6-e7c8be3a233a", "triage_id": "T-1001", "org_id": "685b69b7-b903-4d98-9755-af3c957df9e3", "number": 1001, "title": "Agent skipped the verification step", "description": "On the Aug 12 demo flow the agent jumped to the closing node without asking for the email confirmation.", "status": "todo", "severity": "high", "source": "manual", "category": "Routing", "owner_id": null, "assignee_id": "beed099d-e493-4142-a68b-af13bd72c035", "author_id": "4d5ac1b5-1f24-46d3-8355-5debfd029a65", "external_link": null, "created_at": "2026-05-06T21:09:57.081Z", "updated_at": "2026-05-06T21:09:57.081Z", "last_activity_at": "2026-05-06T21:09:57.081Z", "resource_count": 1, "flag_count": 0, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": false }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Agent Session Source: https://docs.bland.ai/api-v1/post/triage-issues-id-agent-sessions POST https://api.bland.ai/v1/triage/issues/{id}/agent-sessions Create a Norm agent session on an issue. ## Overview Creates a Norm session on an issue. Most callers can skip this, [Prompt Norm](/api-v1/post/triage-issues-id-agent-sessions-session-id-prompts) creates a session implicitly on the first prompt. Use this only when you want to mount the session in your UI before the first prompt is sent. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Body Parameters This endpoint takes no body parameters. Pass an empty body or `{}`. *** ## Response Returns `201 Created` with a session summary. **data** `object` **Session summary fields** **id** `string` Internal UUID of the session. Pass this as `{session_id}` to [Prompt Norm](/api-v1/post/triage-issues-id-agent-sessions-session-id-prompts). **agent\_profile\_id** `string` ID of the agent profile backing this session, from [List Agents](/api-v1/get/triage-agents). **agent\_name** `string` Always `Norm`. **status** `string` Lifecycle status. New sessions are returned with `status: "active"`. The full set of values that can appear on a session (for example via the issue's `latest_agent_session.status` field) is: `pending`, `active`, `awaiting_input`, `complete`, `error`, `cancelled`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "id": "0431f6ad-fdd3-4408-a6cc-909842d1db41", "agent_profile_id": "66720f06-f492-4ce6-a2f2-cd84fd54613e", "agent_name": "Norm", "status": "active" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Prompt Norm Source: https://docs.bland.ai/api-v1/post/triage-issues-id-agent-sessions-session-id-prompts POST https://api.bland.ai/v1/triage/issues/{id}/agent-sessions/{session_id}/prompts Send a prompt to Norm. Returns 202 with a run ID. ## Overview Dispatches a Norm run against the issue. Asynchronous, returns 202 once queued. Progress, tool calls, and final output stream into the issue's [Activity feed](/api-v1/get/triage-issues-id-activity) as `entry_kind: "agent"` entries. The first word of `detail` is parsed as an intent. Slashes are optional. * `/fix` (default), full read+write toolbelt including pathway editing, tool config, and snippet/pipeline tests. * `/verify`, read-only. Norm checks the current draft against the evidence and reports. * `/status`, read-only. Norm summarizes current state, leading diagnosis, and any draft verification. * `/debug`, alias for `/fix`. The `@norm` mention in [Add Comment](/api-v1/post/triage-issues-id-comments) calls this same flow. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **session\_id** `string` *required* Internal UUID of the agent session, from [Create Agent Session](/api-v1/post/triage-issues-id-agent-sessions) or the `latest_agent_session.id` field on the issue. *** ## Body Parameters **detail** `string` *required* The prompt to send to Norm. 1-4000 characters. Begin with `/fix`, `/verify`, `/status`, or `/debug` to set the intent. The intent prefix is stripped before the message reaches Norm. *** ## Response Returns `202 Accepted`. The body acknowledges the dispatch but does not include Norm's reply. Subscribe to the issue's [Activity feed](/api-v1/get/triage-issues-id-activity) (or refetch it on a poll) to read Norm's progress and final output. **data.session\_id** `string` ID of the session the prompt was dispatched to. Matches the `{session_id}` in the URL. **data.run\_id** `string` ID of the Norm run created for this prompt. Each prompt produces one run; multi-turn conversations on the same session produce multiple runs. **data.intent** `string` The parsed intent. One of `fix`, `verify`, or `status`. `/debug` is normalized to `fix`. **errors** `null | array` `null` on success. Returns 404 if the issue or session does not exist, or if the session does not belong to the named issue. ```json Response theme={null} { "data": { "session_id": "0431f6ad-fdd3-4408-a6cc-909842d1db41", "run_id": "56cae586-0670-4f1b-8113-96a2421d56d5", "intent": "fix" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Add Comment Source: https://docs.bland.ai/api-v1/post/triage-issues-id-comments POST https://api.bland.ai/v1/triage/issues/{id}/comments Comment on an issue. Mention @norm to dispatch a Norm investigation. ## Overview Adds a comment to the issue's activity feed. If the body contains `@norm`, the same call also dispatches a Norm investigation, creating a session if none exists. The mention is stripped before the prompt reaches Norm. The HTTP response returns once the comment is saved, so the comment is durable even if the dispatch fails. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Body Parameters **detail** `string` *required* Comment body. 1-4000 characters. Include `@norm` anywhere in the body to also dispatch a Norm investigation. **resource\_link\_ids** `string[]` Optional array of resource link IDs (from [List Resources](/api-v1/get/triage-issues-id-resources)) to attach to this comment as inline references. The dashboard renders these as chips alongside the comment. *** ## Response Returns `201 Created` with the comment timeline entry. See [List Activity](/api-v1/get/triage-issues-id-activity#response) for the full field list. **data** `object` An `IssueTimelineEntry` with `entry_kind: "issue"` and `type: "comment"`. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "entry_kind": "issue", "id": "5a9d0fa9-27b7-414c-9e49-5fc32f240c01", "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "type": "comment", "actor": { "kind": "user", "id": "1f4cabe4-5f9b-4b30-bc4f-fcd3e94a5b15", "label": "John Bland", "avatar_url": null }, "detail": "@norm please look at the routing logic on the closing node, this looks like the same bug from T-1029.", "from_status": null, "to_status": null, "metadata": null, "resources": [], "referenced_issues": [], "created_at": "2026-05-07T05:26:21.449Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Add Flag Source: https://docs.bland.ai/api-v1/post/triage-issues-id-flags POST https://api.bland.ai/v1/triage/issues/{id}/flags Flag a moment on an attached call. ## Overview Flags pinpoint where on a call something went wrong. The `call_id` must already be attached as a resource on this issue, otherwise the request fails with `409 conflict` and `{ error: "call_not_attached" }`. Flag types accumulate into a reusable per-org catalog (see [List Flag Types](/api-v1/get/triage-flag-types)). *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Body Parameters **call\_id** `string` *required* ID of the attached call this flag points at. Must already be attached as a resource on this issue. **type** `string` *required* Flag type. Free-form, but normalized to lower\_snake\_case before storage. Reusing a type increments its `usage_count` in [List Flag Types](/api-v1/get/triage-flag-types). **note** `string` Free-text note explaining why this moment was flagged. 1-4000 characters. **node\_id** `string` ID of the pathway node the flag is attached to, if known. **node\_name** `string` Display name of the pathway node, captured at flag time so the dashboard can render the node name even if the pathway later changes. **message\_index** `integer` Zero-based index of the message turn in the call transcript that this flag points at. **message\_text** `string` Verbatim text of the flagged message, captured at flag time. *** ## Response Returns `201 Created` with the new flag. **data** `object` **Flag fields** **id** `string` Internal UUID of the flag. **org\_id** `string` **issue\_id** `string` **call\_id** `string` **type** `string` The normalized flag type (lower\_snake\_case). **note** `string` Empty string if no note was provided. **node\_id** `string | null` **node\_name** `string | null` **message\_index** `number | null` **message\_text** `string | null` **author\_id** `string` User ID of the caller that filed the flag. **created\_at** `string` **errors** `null | array` `null` on success. ```json Response theme={null} { "data": { "id": "ad0931e4-b0e1-4bd6-a5b1-09e7c9123dba", "org_id": "f5b40b9e-bc05-4b8a-9af1-d8f6a8a3a201", "issue_id": "9bbe5547-d5b1-4b83-9f80-87c4af7c6b34", "call_id": "3aefc79d-1870-4514-b32b-b9212ae32bc8", "type": "missed_handoff", "note": "Agent transferred without confirming the email.", "node_id": null, "node_name": null, "message_index": 12, "message_text": "OK, transferring you now.", "author_id": "75c5c7da-a5d6-4e26-a51e-1ae8ef2bfa4a", "created_at": "2026-05-07T05:26:11.327Z" }, "errors": null } ``` ```json Call Not Attached theme={null} { "data": null, "errors": [ { "error": "call_not_attached", "message": "Call must be attached to issue first" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Link Related Issue Source: https://docs.bland.ai/api-v1/post/triage-issues-id-relations POST https://api.bland.ai/v1/triage/issues/{id}/relations Link an issue to another issue. ## Overview Creates a typed link from one issue to another. Relations are directed: stored on the source issue (`{id}`) and outgoing to `related_issue_id`. The same relation appears with `direction: "incoming"` when listed from the target issue. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the source issue. *** ## Body Parameters **related\_issue\_id** `string` *required* Internal UUID of the target issue. **relation\_type** `string` *required* Relationship type. Must be one of: * `related_to` * `blocks` * `duplicate_of` *** ## Response Returns `201 Created` with the new relation. **data** `object` **Relation fields** **id** `string` Internal UUID of the relation. **org\_id** `string` **issue\_id** `string` Source issue UUID. **related\_issue\_id** `string` Target issue UUID. **related\_triage\_id** `string` Short identifier of the target issue (e.g. `T-1004`), denormalized for display. **related\_title** `string` Title of the target issue, denormalized for display. **relation\_type** `string` `related_to`, `blocks`, or `duplicate_of`. **direction** `string` Always `outgoing` on creation, since the relation lives on the source issue. **created\_by\_id** `string | null` User ID of the caller that created the relation. **created\_at** `string` **errors** `null | array` `null` on success. Returns 404 if either issue does not exist or is not in your org. ```json Response theme={null} { "data": { "id": "172c839b-130d-4712-a09c-b767a78542ea", "org_id": "f5b40b9e-bc05-4b8a-9af1-d8f6a8a3a201", "issue_id": "9bbe5547-d5b1-4b83-9f80-87c4af7c6b34", "related_issue_id": "849ee9ce-be6b-4f9c-8e55-2736aeeb579f", "related_triage_id": "T-1004", "related_title": "Caller transferred to wrong queue", "relation_type": "duplicate_of", "created_by_id": "75c5c7da-a5d6-4e26-a51e-1ae8ef2bfa4a", "created_at": "2026-05-07T05:28:29.358Z", "direction": "outgoing" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Attach Resource Source: https://docs.bland.ai/api-v1/post/triage-issues-id-resources POST https://api.bland.ai/v1/triage/issues/{id}/resources Attach a call, SMS conversation, or file to an issue. ## Overview Attaches a resource as evidence on an issue. Resources are what Norm reads during an investigation. Attaching the same resource twice is a no-op. If the issue does not belong to an agent yet, attaching a call assigns it to the agent that handled that call. An issue that already belongs to an agent keeps it. For calls specifically, [Attach Call](/api-v1/put/triage-issues-id-calls-call-id) is a shorthand that takes the `call_id` directly. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Body Parameters **resource\_type** `string` *required* Type of resource to attach. One of `call`, `sms_conversation`, or `file`. **resource\_id** `string` *required* ID of the resource. For calls, this is the `call_id` returned by [Send Call](/api-v1/post/calls). *** ## Response Returns `201 Created` with the new resource link. If the resource was already attached, returns the existing link with `200 OK`. **data** `object` **Resource link fields** **id** `string` Internal UUID of the resource link. Use this to detach with [Remove Resource](/api-v1/delete/triage-issues-id-resources-resource-link-id). **issue\_id** `string` **org\_id** `string` **resource\_type** `string` `call`, `sms_conversation`, or `file`. **resource\_id** `string` The original resource ID you attached. **title** `string` Display title resolved from the resource itself. For calls this is typically a one-line summary of the conversation. **status** `string` `available` if the underlying resource still exists and is readable, or `unavailable` if it has been deleted or is not accessible. **metadata** `object | null` Extra metadata snapshotted from the resource at attach time, for example the call's `created_at`. **attached\_by\_id** `string | null` User ID of the caller that attached the resource. **created\_at** `string` ISO 8601 timestamp. **errors** `null | array` `null` on success. Returns 404 if the issue or the underlying resource cannot be found in your org. ```json Response theme={null} { "data": { "id": "1d8cec02-6b7c-43f9-9f1f-86d4f31b6d8a", "issue_id": "9bbe5547-d5b1-4b83-9f80-87c4af7c6b34", "org_id": "f5b40b9e-bc05-4b8a-9af1-d8f6a8a3a201", "resource_type": "call", "resource_id": "3e3af63d-0cc0-4525-b742-72a5367fd072", "title": "Caller asked to be transferred to billing after the agent failed to verify their account.", "status": "available", "metadata": { "created_at": "2026-04-30T14:11:08.000Z" }, "attached_by_id": "75c5c7da-a5d6-4e26-a51e-1ae8ef2bfa4a", "created_at": "2026-05-07T05:25:56.361Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Pathway Version Source: https://docs.bland.ai/api-v1/post/update-pathway-version POST https://api.bland.ai/v1/pathway/{pathway_id}/version/{version_number} Updates a specific version of a pathway, including its version name, nodes, and edges. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The ID of the pathway for which to create a new version. **version\_number** `integer` *required* The version number of the pathway to update. ### Request Body **name** `string` *required* The name of the new pathway version. **nodes** `array of objects` *required* An array of node objects defining the structure of the pathway. > [accordion] Node Object Parameters > > * `id` — Unique identifier of the node > * `type` — Type of the node (e.g., "Default", "End Call", "Webhook") > * `data` — Object containing node-specific data > * `name` — Name of the node > * `text` or `prompt` — Text or prompt associated with the node > * Other properties specific to the node type **edges** `array of objects` *required* An array of edge objects defining the connections between nodes. > [accordion] Edge Object Parameters > > * `id` — Unique identifier of the edge > * `source` — ID of the source node > * `target` — ID of the target node > * `label` — Label for this edge ### Response **status** `string` The status of the operation (e.g., "success"). **message** `string` A message describing the result of the operation. ```json Response theme={null} { "status": "success", "message": "Version updated successfully" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Folder Source: https://docs.bland.ai/api-v1/post/update_pathway_folder PATCH https://us.api.bland.ai/v1/pathway/folders/{folder_id} Updates the name of a specific folder for the authenticated user. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **folder\_id** `string` *required* The ID of the folder to update. ### Body Parameters **name** `string` *required* The new name for the folder. ### Response **folder\_id** `string` The unique identifier of the updated folder. **name** `string` The updated name of the folder. **parent\_folder\_id** `string` The ID of the parent folder, if applicable. ```json Response theme={null} { "folder_id": "updated_folder_123", "name": "Updated Folder Name", "parent_folder_id": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Pathway Source: https://docs.bland.ai/api-v1/post/update_pathways POST https://api.bland.ai/v1/pathway/{pathway_id} Update a conversational pathway's fields - including name, description, nodes and edges. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **pathway\_id** `string` *required* The unique identifier of the conversational pathway you want to update. ### Body **name** `string` The name of the conversational pathway **description** `string` A description of the pathway **nodes** `object[]` An array of node objects representing the conversation flow points in your pathway. Each node contains: **Common Node Structure:** ```json theme={null} { "id": "unique_node_identifier", "type": "Node_Type", "data": { "name": "Display Name", // Node-specific configuration goes here } } ``` **Available Node Types:** `Default`, `End Call`, `Transfer Call`, `Webhook`, `Knowledge Base`, `SMS`, `Custom Code`, `Press Button`, `Wait for Response`, `Transfer Pathway`, `Scheduling`, and more. **Node Examples:** ```json Start Node theme={null} { "id": "1", "type": "Default" "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, } ``` ```json Default Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "New Node", "text": "Select a node or edge and press backspace to remove it", "globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM.", }, } ``` ```json End Node theme={null} { "id": "randomnode_1710288752186", "type": "End Call" "data": { "name": "End call", "prompt": "Say goodbye to the user", }, } ``` ```json Webhook Node theme={null} { "id": "randomnode_1710288752186", "type": "Webhook", "data": { "url": "https://api.bland.ai/reservation", "body": "{\n \"date\" : \"{{date}}\",\n \"time\" : \"{{time}}\",\n \"guests\": {{number_of_people}}\n}", "name": "Reservation Booking", "text": "Please give me a moment as I check our bookings..", "method": "POST", "extractVars": [ [ "date", "string", "Desired Date of reservation, in MM/DD/YYYY format" ], [ "time", "string", "Desired Time of Reservation in 24HR Format e.g 13:30" ], [ "number_of_people", "integer", "Number of people for the reservation" ] ], "responseData": [ { "data": "$.reserved", "name": "reservation_success", "context": "" }, { "data": "$.available_slots", "name": "available_slots", "context": "Available slots for the date provided" } ], "responsePathways": [ [ "reservation_success", "==", "true", { "id": "randomnode_1710288752186", "name": "Reservation Successful" } ], [ "reservation_success", "==", "false", { "id": "randomnode_1712265110018", "name": "Find new timeslot" } ] ] } } ``` ```json Knowledge Base Node theme={null} { "id": "randomnode_1710288752186", "type": "Knowledge Base", "data": { "name": "Restaurant Questions", "prompt": "Answer any questions that the user may have regarding the restaurant, by referring to the knowledge base you have. \n\nAnswer the question in 1 line, and then ask if they have any more questions." "kb": "Opening Hours : 9am - 5pm\nStore Locations : \n426 Ivy Street San Francisco, \nSan Jose" } } ``` ```json Global Node theme={null} { "id": "randomnode_1710288871721", "type": "Default" "data": { "name": "Answer any questions", "prompt": "You are to answer any questions the user has.", "isGlobal": true, "globalLabel": "user asks a question" }, } ``` ```json Transfer Call Node theme={null} { "id": "randomnode_1710288752186", "type": "Transfer Call", "data": { "name": "Transferring the call", "text": "Transferring the call now. Please hold.." "transferNumber": "+19547951234" } } ``` > [accordion] Node Data Object Parameters > > * `name` > — name of the node > * `isStart` > — whether the node is the start node. There can only be 1 start node in a pathway. Either `true` or `false`. > * `isGlobal` > — whether the node is a global node. Global nodes are nodes that can be used in multiple pathways. Either `true` or `false`. > * `globalLabel` > — the label of the global node. Should be present if `isGlobal` is true. > * `type` > — Type of the node. Can be `Default`, `End Call`, `Transfer Node`, `Knowledge Base`, or `Webhook`. > * `text` > — If static text is chosen, this is the text that will be said to the user. > * `prompt` > — If dynamic text is chosen, this is the prompt that will be shown to the user. > * `condition` > — The condition that needs to be met to proceed from this node. > * `transferNumber` > * If the node is a transfer node, this is the number to which the call will be transferred. > * `kb` > * If the node is a knowledge base node, this is the knowledge base item that will be used. > * `pathwayExamples` > * The fine-tuning examples for the agent at this node for the pathways chosen > * `conditionExamples` > * The fine-tuning examples for the condition at this node for the condition chosen > * `dialogueExamples` > * The fine-tuning examples for the dialogue at this node for the dialogue chosen. > * `modelOptions` > * `modelName` > — The name of the model to be used for this node. > * `interruptionThreshold` > Legacy. A fixed wait, in milliseconds, after the caller stops speaking before the AI responds on this node. We recommend leaving this unset; use `interruptibility` to control interruptions. > * `interruptibility` > — How readily the AI stops speaking when the caller talks over it on this node: `0` block (the AI finishes speaking, same as `block_interruptions: true`), `1` difficult, `2` balanced (default), `3` easy, `4` always interrupt. Applies only while this node is active; other nodes use the agent's setting. Useful per node: e.g. difficult on a legal-disclaimer node. > * `temperature` > — The temperature of the model. > * `extractVars` > * An array of array of strings. \[\[`varName`, `varType`, `varDescription`]] e.g `[["name", "string", "The name of the user"], ["age", "integer", "The age of the user"]]` Update the pathway's [**global prompt**](/tutorials/pathways#global-prompt-for-all-nodes) by adding an object to the array of nodes. ```json Global Prompt theme={null} { "globalConfig": { "globalPrompt": "This is a phone call. Do not use exclamation marks.\n\nConvert 24HR format timings to 12 HR format - e.g 14:00 should be written as 2 PM." }, "position": { "x": 0, "y": 0 } } ``` **edges** `object[]` An array of edge objects that define the connections and flow between nodes in your pathway. Each edge contains: **Common Edge Structure:** ```json theme={null} { "source": "source_node_id", "target": "target_node_id", "data": { "label": "When this path should be taken", // Optional: conditions, descriptions, etc. } } ``` > [accordion] Edge Object Parameters > > * `id` > — unique id of the edge > * `source` > — id of the source node > * `target` > — id of the target node > * `label` > — Label for this edge. This is what the agent will use to decide which path to take. ## Complete JSON Structure Example For a comprehensive example of how pathways are structured with multiple nodes and edges in a realistic use case, download our example template: [Download pathway example](../../tutorials/tutorials-assets/pathway_json_example.json) This example contains a complete car rental pathway with: * Multiple node types (Default, Transfer Call, Webhook, End Call, etc.) * Complex edge routing and conditions * Variable extraction and model configuration * Real-world conversation flow patterns ### Response **status** `string` Can be `success` or `error`. **pathway\_id** `string` A unique identifier for the pathway (present only if status is `success`). **nodes** `array of objects` Data about all the nodes in the pathway. **edges** `array of objects` Data about all the edges in the pathway. ```json Response theme={null} { "status": "success", "message": "Pathway updated successfully", "pathway_data": { "pathway_id": "9d404c1b-6a23-4426-953a-a52c392ff8f1", "name": "Updated Demo Pathway", "description": "This is an updated description", "nodes": [ { "id": "1", "data": { "name": "Start", "text": "Hey there, how are you doing today?", "isStart": true, }, "type": "Default" }, { "id": "randomnode_1710288752186", "data": { "name": "End call", "prompt": "Click 'Add New Node' on the right to add a new node", }, "type": "End Call" }, { "id": "randomnode_1710288871721", "data": { "name": "New Node", "prompt": "Click 'Add New Node' on the right to add a new node", }, "type": "Default" } ], "edges": [ { "id": "1", "source": "1", "target": "randomnode_1710288752186", "data": { "name": "End call", "prompt": "Click 'Add New Node' on the right to add a new node", } }, { "id": "2", "source": "1", "target": "randomnode_1710288871721", "data": { "name": "New Node", "prompt": "Click 'Add New Node' on the right to add a new node", } } ] } } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload Media Source: https://docs.bland.ai/api-v1/post/upload-media POST https://api.bland.ai/v1/knowledgebases/upload-media Upload a media file as a new knowledge base item Upload media files along with optional metadata like name and description. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **file** `file` *required* The media file to be uploaded. Must be an .mp3 or .mp4 file. **name** `string` Name for the uploaded media file **description** `string` Description for the uploaded media file *** Docs for agents: [llms.txt](/llms.txt) # Upload Text Source: https://docs.bland.ai/api-v1/post/upload-text POST https://api.bland.ai/v1/knowledgebases/upload Upload a text file as a new knowledge base item Upload text files along with optional metadata like name and description. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **file** `file` *required* The text file to be uploaded. Must be a .pdf, .txt, .doc, or .docx file. **name** `string` Name for the uploaded text file **description** `string` Description for the uploaded text file *** Docs for agents: [llms.txt](/llms.txt) # Create a Knowledge Base Item Source: https://docs.bland.ai/api-v1/post/vectors POST https://api.bland.ai/v1/knowledgebases Create a new knowledge base item. Usage: Pass the `vector_id` into your agent's `tools` to enable the agent to use the vector store. ```json theme={null} "tools": [ "KB-55e64dae-1585-4632-ae97-c909c288c6bc" ] ``` ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **name** `string` *required* The name of the knowledge base item. Make this a clear name that describes the contents of the store. **description** `string` *required* A description of the knowledge base item. This can be a longer description of the contents of the store, or what terms to use to search for vectors in the store. This is visible to the AI, so making it descriptive can help the AI understand when to use it or not. **text** `string` *required* The full text document to be stored and vectorized. ### Response **vector\_id** `string` The unique identifier for the knowledge base item. Will start with "KB-". ```json theme={null} { "vector_id": "KB-55e64dae-1585-4632-ae97-c909c288c6bc" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Check Voice Name Availability Source: https://docs.bland.ai/api-v1/post/voices-check-name-availability POST https://api.bland.ai/v1/voices/check_name_availability Check whether a voice name is available before cloning. ## Overview Returns whether a proposed voice name is available in your org's library. Use this to validate input before calling [Clone Voice](/api-v1/post/clone), which rejects the request outright if the name is taken. Names are scoped per org and case-insensitive. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Body Parameters **name** `string` *required* Voice name to check. 1-30 characters. *** ## Response **status** `string` `success` on success. **result** `boolean` `true` if the name is available, `false` if it is already in use. **message** `string` Human-readable confirmation. ```json Available theme={null} { "status": "success", "result": true, "message": "Voice name \"DocTestVoice\" is available" } ``` ```json Taken theme={null} { "status": "success", "result": false, "message": "Voice name \"DocTestVoice\" is already in use" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Rate Voice Source: https://docs.bland.ai/api-v1/post/voices-id-rate POST https://api.bland.ai/v1/voices/{id}/rate Give a public library voice a 1-5 star rating. ## Overview Records your rating (1-5) for a voice in the Bland library. Ratings are aggregated and surfaced as `average_rating` and `total_ratings` on each voice. Each caller can have at most one active rating per voice, sending a new rating overwrites the previous one. Send `DELETE` to the same path to clear your rating. This call is throttled to 20 ratings per minute per org. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice to rate. *** ## Body Parameters **rating** `integer` *required* Rating value, 1 to 5. *** ## Response **status** `string` `success` on success. **total\_ratings** `number` The voice's new total rating count. **average\_rating** `number` The voice's new average rating. ```json Response theme={null} { "status": "success", "total_ratings": 8, "average_rating": 4.875 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Voice Settings Source: https://docs.bland.ai/api-v1/post/voices-id-settings POST https://api.bland.ai/v1/voices/{id}/settings Update the consistency/expressiveness defaults on a voice you own. ## Overview Updates one or more synthesis defaults on a voice you own. Equivalent to [Update Voice Config](/api-v1/patch/voices-id-config), kept under both verbs and paths for backwards compatibility. New integrations should use this `POST /settings` form. At least one of the body fields must be provided. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the voice. *** ## Body Parameters **consistency** `number` Default consistency for V1 and V2 voices. V1: 0-1 float (higher is more consistent). V2: 0-64 integer (lower is more consistent). Reject values outside that range. **expressiveness** `number` Default expressiveness for V1 and V2 voices. 0-1 float. **boost\_language\_consistency** `boolean` Boost flag for V3 voices only. `true` adds language-consistency prompting at the cost of some flexibility for code-switching. Disable if your agent needs to speak languages outside the source sample. *** ## Response Echoes back the resolved settings on success. For V1 and V2 voices: **consistency** `number` **expressiveness** `number` **service** `string` The engine identifier of the voice. For V3 voices: **boost\_language\_consistency** `boolean` **service** `string` To see the rest of the voice's fields after an update, call [Get Voice](/api-v1/get/voices-id). ```json V2 Response theme={null} { "consistency": 16, "expressiveness": 0.8, "service": "BTTS_V2" } ``` ```json V3 Response theme={null} { "boost_language_consistency": true, "service": "BTTS_V3" } ``` ```json Nothing Provided theme={null} { "data": null, "errors": [ { "error": "INVALID_REQUEST", "message": "At least one of consistency, expressiveness or boost_language_consistency must be provided" } ] } ``` ```json Out of Range theme={null} { "data": null, "errors": [ { "error": "INVALID_CONSISTENCY", "message": "consistency must be a number between 0 and 64" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Add Library Voice Source: https://docs.bland.ai/api-v1/post/voices-library-add-id POST https://api.bland.ai/v1/voices/library/add/{id} Add a shared library voice to your org so it can be used in your calls and TTS. ## Overview Adds a voice from the public Bland voice library to your org's voice list. Once added, the voice can be used like any other voice you own: passed to [Speak](/api-v2/post/tts), configured via [Update Voice Config](/api-v1/patch/voices-id-config), renamed, and so on. The original library voice is unchanged. The endpoint returns a new voice record that lives in your org and points at the same underlying model. This call is throttled to 30 add operations per minute per org. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* UUID of the shared voice to add. *** ## Response **status** `string` `success` on success. **message** `string` Human-readable confirmation. **voice** `object` The newly added voice in your org. See [Get Voice](/api-v1/get/voices-id#response) for the field list. The `id` is unique to your org, the `voice_id` field points at the underlying model. ```json Response theme={null} { "status": "success", "message": "Voice is in your library", "voice": { "id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9", "name": "StephenD_v1 (published)", "description": null, "public": false, "ratings": 0, "tags": ["Beige Clone V2", "male"], "user_id": "fea2a74f-9bd7-4b5d-a52e-c3c1a3f58bb0", "voice_id": "ff595c98-da38-4617-ada3-df42561a2379", "service": "BTTS_V2", "finetuned": false, "consistency": null, "expressiveness": null, "voice_meta": null, "is_creator_voice": false } } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "Rate Limit Exceeded", "message": "Too many library adds, please try again later." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Add Voice Sample Source: https://docs.bland.ai/api-v1/post/voices-samples POST https://api.bland.ai/v1/voices/samples Append training samples to an existing voice clone you own. ## Overview Appends one or more audio samples to an existing voice clone, retraining the voice on the expanded sample set. Sample limits depend on the voice's engine. **BTTS V1** voices accept up to 5 samples total. **BTTS V2** and **BTTS V3** voices are single-sample by design and do not accept additional samples; use [Clone Voice](/api-v1/post/clone) to create a new voice instead. Sent as `multipart/form-data`. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Form Fields **voice\_id** `string` *required* UUID of the voice to add samples to. Must be a voice your org owns. **audio\_samples** `file[]` *required* WAV files to append. Each file 1-60 seconds, max 10 MB. The combined sample count after this call cannot exceed 5 for a V1 voice. *** ## Response **status** `string` `success` on success. **samples** `array` The samples currently attached to the voice after the update. See [List Voice Samples](/api-v1/get/voices-id-samples#response) for field shape. ```json Response theme={null} { "status": "success", "samples": [ { "id": "d15b199a-1b79-4664-9a9a-b149ee3b136a", "voice_id": "73d4c04b-1e15-4272-9c7f-8d2955914ba9", "transcription": null, "duration_seconds": 11.4, "created_at": "2026-06-22T21:34:31.347Z" } ] } ``` ```json No Files theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "No audio files provided" } ] } ``` ```json Wrong Engine theme={null} { "data": null, "errors": [ { "error": "INTERNAL_SERVER_ERROR", "message": "Adding samples is only supported for BTTS voices" } ] } ``` ```json Too Many Samples theme={null} { "data": null, "errors": [ { "error": "Validation Error", "message": "Cannot add 2 sample(s). Voice already has 4 samples. Maximum allowed is 5 samples per voice." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Widget Source: https://docs.bland.ai/api-v1/post/widget POST https://api.bland.ai/v1/widget Creates a new widget. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **pathway\_id** `string` UUID of the pathway to associate with the widget. Must be defined if `agent_prompt` is null. **agent\_prompt** `string` Prompt to use for the widget agent. Must be defined if `pathway_id` is null. **allowed\_domains** `string[]` *required* Array of domains where the widget can be embedded. **messages\_per\_minute** `number` *required* Rate limit for messages (minimum: 0). **config** `any` *required* Widget configuration object (flexible JSON). Supports `timeoutSeconds` to configure conversation timeout (default: 86400 seconds / 24 hours). **agent\_id** `string` Optional UUID of agent to associate with widget. **webhook\_url** `string` Optional URL to receive post-conversation webhook payloads when conversations end. See [Post-Conversation Webhooks](/tutorials/chat-widget#post-conversation-webhooks) for payload details. ### Response **status** `number` HTTP status code (200 for success). **data** `object` The created widget object containing: * `id` (string): Generated widget UUID * `pathway_id` (string): Associated pathway UUID * `agent_id` (string | null): Associated agent UUID or null * `allowed_domains` (string\[]): Array of allowed domains * `messages_per_minute` (number): Rate limit for messages * `config` (object): Widget configuration object * `webhook_url` (string | null): Post-conversation webhook URL or null * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "status": 200, "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7", "agent_id": null, "allowed_domains": ["example.com", "subdomain.example.com"], "messages_per_minute": 10, "config": { "theme": "light", "position": "bottom-right", "timeoutSeconds": 3600 }, "webhook_url": "https://example.com/webhook", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Custom Component Source: https://docs.bland.ai/api-v1/post/widget-custom-components POST https://api.bland.ai/v1/widget/custom_components Create a new custom component. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body **widget\_id** `string` *required* Widget identifier UUID to associate with the custom component. **pathway\_id** `string` *required* Pathway UUID to associate with the custom component. **pathway\_node** `string` *required* Pathway node ID to display the custom component on. **width** `string` *required* Widget width dimension (e.g., "100%", "500px"). **height** `string` *required* Widget height dimension (e.g., "300px", "100%"). **variables** `string[]` *required* Array of available agent variable names to pass into the custom component iframe URL as query params. **iframe\_url** `string` *required* URL for the iframe source. ### Response **status** `number` HTTP status code (200 for success). **data** `object` * `id` (string): Custom component UUID * `org_id` (string): Organization UUID * `widget_id` (string): Widget identifier UUID * `pathway_id` (string): Associated pathway UUID * `pathway_node` (string): Pathway node ID to display the custom component on * `width` (string): Widget width dimension * `height` (string): Widget height dimension * `variables` (string\[]): Array of variable names to pass into the custom component iframe URL as query params * `iframe_url` (string): URL for the iframe source * `created_at` (string): ISO timestamp * `updated_at` (string): ISO timestamp **errors** `null` Always null on successful response. ```json Response theme={null} { "data": [ { "created_at": "2025-10-02T21:45:27.633Z", "updated_at": "2025-10-02T21:45:27.633Z", "id": "70b56282-8db5-4e26-aad9-098c099fb1db", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "widget_id": "7d1a8c0d-5346-4f96-9f5c-d888e273eaf0", "pathway_id": "05f4b269-e79a-4825-b4cd-7778f782bfad", "pathway_node": "1", "width": "100%", "height": "300px", "variables": [ "firstName" ], "iframe_url": "https://widget-custom-components.vercel.app" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Live Agent Message Source: https://docs.bland.ai/api-v1/post/widget-thread-webhook POST https://api.bland.ai/v1/widget/{id}/threads/{thread_id}/webhook Send a message from a live agent to the user, or end the conversation. Use this endpoint to send messages from your live agent platform back to the user in the widget. This is the counterpart to the webhooks Bland sends to your system during a [live agent escalation](/tutorials/chat-widget#escalate-to-live-agents). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The widget ID. **thread\_id** `string` *required* The thread ID from the `INITIAL_CONVERSATION` webhook payload. ### Body The request body accepts two payload types: > [tab] MESSAGE > > Send a message to the user. > > **type** `string` *required* > > Must be `"MESSAGE"`. > > **content** `string` *required* > > The message content to display to the user. > > **sender\_id** `string` *required* > > Identifier for the live agent sending the message. This can be used to distinguish between different agents in the conversation. > > **created\_at** `string` > > Optional ISO 8601 timestamp for the message. Defaults to the current time if not provided. > [tab] END\_CONVERSATION > > End the live agent session. > > **type** `string` *required* > > Must be `"END_CONVERSATION"`. > > **sender\_id** `string` > > Optional identifier for the agent ending the conversation. ### Response **status** `number` HTTP status code (200 for success). **data** `object` For `MESSAGE` requests, returns the created message object. For `END_CONVERSATION` requests, returns the updated thread object with `ended_at` timestamp. **errors** `array | null` Array of error objects if the request failed, otherwise null. ### Error Codes | Status | Error | Description | | - | - | - | | 400 | `INVALID_PARAMETER` | Request body validation failed. | | 400 | `THREAD_ENDED` | The thread has already been ended. | | 404 | `NOT_FOUND` | Thread not found with the given ID. | ```bash Send Message theme={null} curl -X POST "https://api.bland.ai/v1/widget/{widget_id}/threads/{thread_id}/webhook" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "MESSAGE", "content": "Hi! I am a live agent. How can I help you today?", "sender_id": "agent_123" }' ``` ```bash End Conversation theme={null} curl -X POST "https://api.bland.ai/v1/widget/{widget_id}/threads/{thread_id}/webhook" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "END_CONVERSATION", "sender_id": "agent_123" }' ``` ```json Message Response theme={null} { "data": { "created_at": "2025-12-10T19:27:02.941Z", "updated_at": "2025-12-10T19:27:02.941Z", "id": "30a3e35d-9ffb-4810-aef7-2600346107e6", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "widget_id": "b5f3fb6b-2285-4c73-95be-6609eca09986", "thread_id": "f5ff280b-b0d8-4261-a1ed-b74003e733a2", "pathway_session_id": null, "sender_type": "LIVE_AGENT", "sender_id": "49e6e820-f5b7-4fb1-8aa8-7fb162fbcf91", "content": "You have a great day too!" }, "errors": null } ``` ```json End Conversation Response theme={null} { "data": { "created_at": "2025-12-10T19:25:00.809Z", "updated_at": "2025-12-10T20:26:41.180Z", "ended_at": "2025-12-10T20:26:41.179Z", "live_agent_handoff_at": "2025-12-10T19:25:04.745Z", "id": "f5ff280b-b0d8-4261-a1ed-b74003e733a2", "org_id": "99a0d526-6910-4f31-92b8-72834d0827fb", "widget_id": "b5f3fb6b-2285-4c73-95be-6609eca09986", "visitor_id": "ec14ee83-fa2b-493a-b009-0e29414a1e97", "live_agent_endpoint_url": "https://webhook.site/32d53101-7d67-4879-b350-6aa2d1e12ada", "language": "en" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Test Scenario Source: https://docs.bland.ai/api-v1/put/agent-testing-scenarios-id PUT https://api.bland.ai/v1/agent-testing/scenarios/{id} Update an existing test scenario. If assertions are provided, they replace all existing assertions. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **id** `string` *required* The scenario ID. ### Body Parameters **name** `string` Name of the scenario. Must be unique within the pathway/persona. **description** `string` Description of what the scenario tests. **category** `string` One of: `CUSTOM`, `VOICEMAIL`, `VOICEMAIL_SCREENER`, `ANGRY_CALLER`, `BELLIGERENT_CALLER`, `CONFUSED_CALLER`, `CALL_SCREENER`, `HAPPY_PATH`, `EDGE_CASE`. **scenario\_type** `string` One of: `AGENT`, `REPLAY`, `HISTORICAL`. **tester\_persona\_prompt** `string` Prompt instructing the simulated caller how to behave. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` Max conversation turns before the test ends. Maximum value is 50. **request\_data** `object` Custom request data to pass to the pathway (e.g., variables). **start\_node\_id** `string` ID of the pathway node where the simulated conversation should begin. Use this to test a specific branch of a pathway without rewiring the flow. Set to `null` to fall back to the pathway's default start node. If the ID does not match a node in the current pathway version, the run fails with an `Invalid start_node_id` error. **bland\_tone\_enabled** `boolean` Enable Bland Tone naturalness scoring. **is\_required\_for\_promotion** `boolean` If true, this scenario must pass before the pathway can be promoted to production. **enabled** `boolean` Whether the scenario is enabled. **input\_messages** `array` Pre-seeded messages for `REPLAY` scenarios. **advanced\_instructions** `string` Additional instructions for test execution. **metadata** `object` Arbitrary metadata to attach to the scenario. **assertions** `array` Array of assertion definitions. If provided, replaces all existing assertions. **assertion object** **type** `string` *required* The assertion type. One of: `LLM_JUDGE`, `BLAND_TONE`, `VARIABLE_EXTRACTED`, `NODE_REACHED`, `NODES_VISITED`, `WEBHOOK_TRIGGERED`, `REGEX_MATCH`, `STRING_CHECK`, `CUSTOM_LLM`, `TRAVERSAL_MATCH`. **config** `object` *required* Type-specific configuration for the assertion. **name** `string` Display name for the assertion. **is\_required** `boolean` (default: true) Whether this assertion must pass for the scenario to pass. **weight** `number` (default: 1.0) Weight of this assertion in the overall score. **order** `integer` Order in which the assertion is evaluated. ### Response **id** `string` Unique identifier for the scenario. **org\_id** `string` Organization ID that owns this scenario. **pathway\_id** `string` The pathway ID being tested (null if testing a persona). **persona\_id** `string` The persona ID being tested (null if testing a pathway). **name** `string` Name of the scenario. **description** `string` Description of the scenario. **category** `string` Scenario category. **scenario\_type** `string` Type of scenario. **tester\_persona\_prompt** `string` Prompt for the simulated caller. **tester\_persona\_name** `string` Display name for the tester persona. **max\_turns** `integer` Maximum conversation turns. **request\_data** `object` Custom request data. **start\_node\_id** `string` Starting node ID. **bland\_tone\_enabled** `boolean` Whether Bland Tone scoring is enabled. **is\_required\_for\_promotion** `boolean` Whether this scenario is required for promotion. **enabled** `boolean` Whether the scenario is enabled. **input\_messages** `array` Pre-seeded messages for replay scenarios. **advanced\_instructions** `string` Additional instructions for test execution. **metadata** `object` Arbitrary metadata. **assertions** `array` Array of assertion objects. **assertion object** **id** `string` Unique identifier for the assertion. **type** `string` The assertion type. **name** `string` Display name for the assertion. **config** `object` Type-specific configuration. **is\_required** `boolean` Whether this assertion must pass. **weight** `number` Weight of this assertion in the overall score. **order** `integer` Evaluation order. **created\_at** `string` ISO 8601 timestamp of when the scenario was created. **updated\_at** `string` ISO 8601 timestamp of when the scenario was last updated. ```json Response theme={null} { "id": "a1b2c3d4-5678-9abc-def0-1234567890ab", "org_id": "b2c3d4e5-6789-abcd-ef01-234567890abc", "pathway_id": "c3d4e5f6-789a-bcde-f012-34567890abcd", "persona_id": null, "name": "Angry Caller Test - Updated", "description": "Tests the agent's ability to de-escalate an angry caller with updated assertions", "category": "ANGRY_CALLER", "scenario_type": "AGENT", "tester_persona_prompt": "You are a frustrated customer who has been waiting on hold for 30 minutes. You are upset about a billing error on your account.", "tester_persona_name": "Frustrated Customer", "max_turns": 20, "request_data": null, "start_node_id": null, "bland_tone_enabled": true, "is_required_for_promotion": true, "enabled": true, "input_messages": null, "advanced_instructions": null, "metadata": null, "assertions": [ { "id": "d4e5f6a7-89ab-cdef-0123-4567890abcde", "type": "LLM_JUDGE", "name": "De-escalation", "config": { "prompt": "Did the agent successfully de-escalate the situation and address the customer's concerns?", "output_type": "score", "threshold": 0.8 }, "is_required": true, "weight": 1.5, "order": 0 }, { "id": "e5f6a7b8-9abc-def0-1234-567890abcdef", "type": "NODE_REACHED", "name": "Reached Resolution", "config": { "node_id": "resolution-node" }, "is_required": true, "weight": 1.0, "order": 1 } ], "created_at": "2026-04-10T12:00:00.000Z", "updated_at": "2026-04-14T10:30:00.000Z" } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Knowledge Base Item Source: https://docs.bland.ai/api-v1/put/knowledge-id PUT https://api.bland.ai/v1/knowledge/{knowledge_base_id} Updates a knowledge base item's name and/or description. Updates the metadata (name and description) of an existing knowledge base item. This endpoint does not modify the content of the knowledge base item, only its descriptive information. ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* Must be `application/json`. ### Path Parameters **knowledge\_base\_id** `string` *required* The unique identifier of the knowledge base item to update. ### Body Parameters **name** `string` New name for the knowledge base item. If not provided, the current name is retained. **description** `string` New description for the knowledge base item. Pass `null` to remove the description entirely. ### Response **data** `object` The updated knowledge base item object. **data.id** `string` Unique identifier for the knowledge base item. **data.name** `string` Updated name of the knowledge base item. **data.description** `string` Updated description of the knowledge base item. **data.status** `string` Current status: `"PROCESSING"`, `"COMPLETED"`, `"FAILED"`, or `"DELETED"`. **data.type** `string` Type of knowledge base item: `"FILE"`, `"WEB_SCRAPE"`, or `"TEXT"`. **data.source\_urls** `string` Source URLs for web scrape type (comma-separated). **data.base\_url** `string` Base URL for web scrape type. **data.created\_at** `string` ISO timestamp of creation. **data.updated\_at** `string` ISO timestamp of last update. **data.error\_message** `string` Error message if status is `"FAILED"`. **data.file** `object` File information for file-type knowledge base items. **data.file.file\_name** `string` Original filename. **data.file.file\_size** `number` File size in bytes. **data.file.file\_type** `string` MIME type of the file. **errors** `null` Will be `null` on successful update. ```bash Update Name Only theme={null} curl -X PUT https://api.bland.ai/v1/knowledge/kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T \ -H "authorization: Bearer YOUR_API_KEY" \ -H "content-type: application/json" \ -d '{ "name": "Updated Company FAQs" }' ``` ```json Update Both Name and Description theme={null} { "name": "Updated Company FAQs", "description": "Updated frequently asked questions and company policies for 2025" } ``` ```json Remove Description theme={null} { "name": "Company FAQs", "description": null } ``` ```json Success Response theme={null} { "data": { "id": "kb_01H8X9QK5R2N7P3M6Z8W4Y1V5T", "name": "Updated Company FAQs", "description": "Updated frequently asked questions and company policies for 2025", "status": "COMPLETED", "type": "FILE", "created_at": "2025-01-15T10:30:00Z", "updated_at": "2025-01-15T15:45:00Z", "file": { "file_name": "company_faqs.pdf", "file_size": 2048576, "file_type": "application/pdf" } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Attach Call Source: https://docs.bland.ai/api-v1/put/triage-issues-id-calls-call-id PUT https://api.bland.ai/v1/triage/issues/{id}/calls/{call_id} Attach a call to an issue. ## Overview Convenience over [Attach Resource](/api-v1/post/triage-issues-id-resources) for when you already have the `call_id`. Idempotent. Returns the full updated issue with `resource_count` incremented. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. **call\_id** `string` *required* The `call_id` returned by [Send Call](/api-v1/post/calls). *** ## Response **data** `object` The updated issue. See [Create Issue](/api-v1/post/triage-issues#response) for the full field list. **errors** `null | array` `null` on success. Returns 404 if the issue or the call cannot be found in your org. ```json Response theme={null} { "data": { "id": "cb27e5fb-b1f0-4b6f-9f10-13ac35617a87", "triage_id": "T-1042", "org_id": "1c5d7f1f-9f59-4d7f-a0a3-dd3a8b6e7f0e", "number": 1042, "title": "Agent skipped the verification step", "description": "", "status": "todo", "severity": "high", "source": "manual", "category": "Routing", "owner_id": null, "assignee_id": null, "author_id": "8e3d68e0-c2c5-49ea-b4a3-e7c9a1437f76", "external_link": null, "created_at": "2026-05-07T05:32:42.221Z", "updated_at": "2026-05-07T05:32:42.671Z", "last_activity_at": "2026-05-07T05:32:42.671Z", "resource_count": 1, "flag_count": 0, "relation_count": 0, "latest_agent_session": null, "is_processing": false, "has_unread_activity": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Mark Issue Viewed Source: https://docs.bland.ai/api-v1/put/triage-issues-id-view PUT https://api.bland.ai/v1/triage/issues/{id}/view Mark an issue as viewed by the calling user. ## Overview Records the calling user's view at the current time. Clears `has_unread_activity` on subsequent fetches for this user. View timestamps are per-user, so each org member has their own unread state. *** ## Headers **authorization** `string` *required* Your API key for authentication. *** ## Path Parameters **id** `string` *required* Internal UUID of the issue. *** ## Response **data.issue\_id** `string` The issue that was marked viewed. **data.last\_viewed\_at** `string` ISO 8601 timestamp the view was recorded at. **errors** `null | array` `null` on success. Returns 404 if the issue does not exist. ```json Response theme={null} { "data": { "issue_id": "4f9a7c2d-7f88-4dc4-9d1e-be83c5067f1c", "last_viewed_at": "2026-05-07T05:26:21.694Z" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Agent Source: https://docs.bland.ai/api-v2/delete/agents-id DELETE https://api.bland.ai/v2/agents/{agent_id} Soft-delete an agent. Versions and history are kept. ### Overview Marks the agent deleted. It disappears from [List Agents](/api-v2/get/agents) and returns `404` from [Get Agent](/api-v2/get/agents-id), but its versions, deployments, and history are retained. Alerts scoped to the agent are deleted with it. Requires an admin, owner, operator, or prompter role. You can also delete an agent from the dashboard. See [Delete an agent](/agents/agent-builder#delete-an-agent). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.id** `string` The deleted agent's ID. **data.deleted** `boolean` Always `true` on success. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "bc526394-c150-4983-bbfb-c84d1d9653f4", "deleted": true }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Agent Branch Source: https://docs.bland.ai/api-v2/delete/agents-id-branches-branch-id DELETE https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id} Abandon an open branch without merging it. ### Overview Closes an open branch without landing its changes on dev. The branch disappears from [List Agent Branches](/api-v2/get/agents-id-branches) and can no longer be rebased or merged; versions already saved to it are kept for the record. To land the changes instead, use [Merge Agent Branch](/api-v2/post/agents-id-branches-branch-id-merge). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **branch\_id** `string` *required* The branch's unique identifier. Returns `404 BRANCH_NOT_FOUND` if the branch does not belong to this agent or has already been merged or deleted. ### Response **data.deleted** `boolean` Always `true` on success. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "deleted": true }, "errors": null } ``` ```json Branch Not Found theme={null} { "data": null, "errors": [ { "error": "BRANCH_NOT_FOUND", "message": "Branch not found" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Disposition Source: https://docs.bland.ai/api-v2/delete/agents-id-dispositions-disposition-id DELETE https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id} Retire a disposition so it stops classifying new calls. > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have them, every route under `/dispositions` returns `404`. ### Overview Retires a disposition. It is disabled and marked deleted, so it stops running on new calls and no longer appears in [List Dispositions](/api-v2/get/agents-id-dispositions). Results already recorded on past calls are left alone. The call is idempotent: deleting a disposition that is already deleted succeeds and returns the same body, so a retry after a dropped connection is safe. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID, and must belong to this agent. Returns `404 NOT_FOUND` otherwise. ### Response **data.id** `string` The disposition that was deleted. Matches `{disposition_id}`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. Returns `409 CONFLICT` when the disposition changed while the delete was in flight; read it again and retry. ```json Response theme={null} { "data": { "id": "ce0deae0-e40c-4a8c-b1e7-6122591f4aea" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Disposition changed while it was being deleted; refresh and try again" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Checks Source: https://docs.bland.ai/api-v2/delete/agents-id-environments-env-checks DELETE https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/checks Remove an environment's check config. ### Overview Removes the check config for one environment, including its scenario and judge attachments. Past check runs are kept and still readable with [List Check Runs](/api-v2/get/agents-id-check-runs). When the environment has no config, the response is `200` with `deleted: false`, not `404`. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* `staging` or `production`. Any other value returns `400 BAD_REQUEST`. ### Response **data.deleted** `boolean` `true` when a config was removed, `false` when the environment had none. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "deleted": true }, "errors": null } ``` ```json Invalid Environment theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "env must be 'staging' or 'production'" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Remove Check Eval Source: https://docs.bland.ai/api-v2/delete/agents-id-environments-env-checks-evals-eval-agent-id DELETE https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/checks/evals/{eval_agent_id} Drop one eval from an environment's promotion checks. ### Overview Removes a single eval from the checks that gate promotion into an environment, leaving the rest of the roster in place. Use [Set Agent Checks](/api-v2/put/agents-id-environments-env-checks) to replace the whole roster instead, or [Delete Agent Checks](/api-v2/delete/agents-id-environments-env-checks) to clear it. Removing the last eval deletes the environment's check configuration entirely. The response then carries `config` of `null`, and promotion into that environment is no longer gated. The call is idempotent. Removing an eval that is not on the roster, or one from an environment with no configuration, returns `200` with `removed` set to `false` and changes nothing. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* Which environment's checks to change. Must be `staging` or `production`; `dev` is not gated and returns `400 BAD_REQUEST`. **eval\_agent\_id** `string` *required* The eval to remove. ### Response **data.removed** `boolean` `true` when an eval was taken off the roster, `false` when there was nothing to remove. **data.config** `object | null` The environment's remaining check configuration, in the same shape as [Get Agent Checks](/api-v2/get/agents-id-environments-env-checks). `null` when removing the last eval deleted the configuration. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "removed": true, "config": { "env_type": "production", "simulations_count": 5, "evals": [ { "eval_agent_id": "3fec6d8e-053b-4d6b-9544-4bf559a13a1a", "eval_agent_version_id": "f3a84fb2-81d9-41e7-95e3-3d1f7e44fb31", "passing_level": "pass" } ] } }, "errors": null } ``` ```json Nothing To Remove theme={null} { "data": { "removed": false, "config": null }, "errors": null } ``` ```json Invalid Environment theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "env must be 'staging' or 'production'" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Agent Variable Source: https://docs.bland.ai/api-v2/delete/agents-id-environments-env-variables-key DELETE https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/variables/{key} Delete an environment variable from an agent. ### Overview Removes one variable from one of the agent's environments. If the variable was saved with `is_secret`, the stored secret is deleted with it. The request succeeds even when no variable with that key exists. Calls that run as this environment and still reference `{{env.KEY}}` fail until the variable is set again with [Set Agent Variable](/api-v2/put/agents-id-environments-env-variables-key). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* One of `dev`, `staging`, `production`. Any other value returns `400 INVALID_ENV`. **key** `string` *required* The variable key to remove, matched exactly after trimming surrounding whitespace. ### Response **data.deleted** `boolean` Always `true` on success, whether or not a variable with that key existed. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "deleted": true }, "errors": null } ``` ```json Invalid Env theme={null} { "data": null, "errors": [ { "error": "INVALID_ENV", "message": "env must be one of: dev, staging, production" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Delete Archived Node Source: https://docs.bland.ai/api-v2/delete/agents-library-archived-nodes-archived-node-id DELETE https://api.bland.ai/v2/agents/library/archived-nodes/{archived_node_id} Permanently remove an entry from the node archive. ### Overview Hard-deletes one archive entry. Archive entries are self-contained copies, so the agent the node came from is not affected. Find entry IDs with [List Archived Nodes](/api-v2/get/agents-library-archived-nodes). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **archived\_node\_id** `string` *required* The archive entry's unique identifier. Returns `404 NOT_FOUND` if no entry with that ID exists in your organization. ### Response **data.id** `string` The deleted entry's ID. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "84ac6a8a-cdb6-421f-9111-e7b2a3da77bb" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Archived node not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agents Source: https://docs.bland.ai/api-v2/get/agents GET https://api.bland.ai/v2/agents List the agents in your organization, most recently updated first. ### Overview Returns every live agent in your organization, ordered by `updated_at` descending. Each entry is the agent record without its environments; call [Get Agent](/api-v2/get/agents-id) for environment pointers. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **limit** `integer` (default: 100) Maximum number of agents to return. Minimum `1`, maximum `500`. Values outside that range are clamped. ### Response **data** `array` Array of agent objects. **agent object** **id** `string` Unique identifier for the agent. **org\_id** `string` The organization that owns the agent. **name** `string` The agent's display name. **created\_by** `string | null` ID of the user who created the agent, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of the last update. **deleted\_at** `null` Always `null` on a live agent. **color** `string` The agent's chosen identity color, read from its newest saved version. Omitted when no color has been picked. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "c7dc8803-c265-46a7-86bc-92edf72af434", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Appointment reminders", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-09T14:12:03.101Z", "updated_at": "2026-09-10T18:40:27.882Z", "deleted_at": null, "color": "teal" }, { "id": "01a60218-bdd1-41eb-8612-2ef3f60dd80d", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Front desk", "created_by": "6fb2ce4c-507f-45e5-9dcb-45d3139b04fd", "created_at": "2026-09-08T09:30:44.005Z", "updated_at": "2026-09-08T09:30:44.005Z", "deleted_at": null } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Agent Source: https://docs.bland.ai/api-v2/get/agents-id GET https://api.bland.ai/v2/agents/{agent_id} Retrieve an agent and its environment pointers. ### Overview Returns one agent with its `dev`, `staging`, and `production` environments and the version each is pinned to. Use [List Agents](/api-v2/get/agents) to find agent IDs. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data** `object` The agent with its environments. **agent object** **id** `string` Unique identifier for the agent. **org\_id** `string` The organization that owns the agent. **name** `string` The agent's display name. **created\_by** `string | null` ID of the user who created the agent, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of the last update. **deleted\_at** `null` Always `null` on a live agent. **environments** `array` The agent's three environments. Each has `id`, `env_type` (`dev`, `staging`, or `production`), and `current_version_id` (the pinned version, or `null` if unpinned). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "76d33db4-6e21-4505-b730-97a02e50d2ac", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Front desk", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T22:59:51.569Z", "updated_at": "2026-09-10T23:14:08.220Z", "deleted_at": null, "environments": [ { "id": "7a043546-b896-4680-80e4-5eb9cbde6977", "env_type": "dev", "current_version_id": null }, { "id": "ab412aa2-8827-4e12-ad45-9a964c2c8690", "env_type": "staging", "current_version_id": null }, { "id": "1595512d-ea18-4692-a40b-6c90932396b4", "env_type": "production", "current_version_id": "bc526394-c150-4983-bbfb-c84d1d9653f4" } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agent Branches Source: https://docs.bland.ai/api-v2/get/agents-id-branches GET https://api.bland.ai/v2/agents/{agent_id}/branches List an agent's open branches. ### Overview Returns the agent's open branches (not yet merged or deleted), oldest first. A branch is a dev workspace cut from the dev head; `behind` tells you whether dev has moved past the branch's base since it was cut. Create one with [Create Agent Branch](/api-v2/post/agents-id-branches) and land it with [Merge Agent Branch](/api-v2/post/agents-id-branches-branch-id-merge). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data** `array` Array of branch objects ordered by `created_at` ascending. Empty when the agent has no open branches. **branch object** **id** `string` Unique identifier for the branch. **agent\_id** `string` The agent the branch belongs to. **name** `string` The branch name. **base\_version\_id** `string | null` The dev version the branch was cut from, or last rebased onto. `null` when the branch was cut from an agent with no saved versions. **created\_by** `string | null` ID of the user who created the branch, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **behind** `boolean` `true` when dev's newest version is no longer the branch's base. A merge returns `409 BRANCH_BEHIND` until the branch is rebased. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "d403963c-b555-4911-8c29-d33e6268d844", "agent_id": "fe16b944-1d94-46bd-ba4a-7360aa311ded", "name": "billing-questions", "base_version_id": "bdd5b157-7617-448a-850d-b799cb22c0a1", "created_by": "a941d24e-f0ac-4d0b-82df-b1fe34bf1715", "created_at": "2026-09-08T16:21:09.412Z", "behind": true }, { "id": "fc323133-b2c7-49bf-9cf4-a35188caa10e", "agent_id": "fe16b944-1d94-46bd-ba4a-7360aa311ded", "name": "spanish-greeting", "base_version_id": "b55be31f-dd53-4587-b4ba-1bf761ff7717", "created_by": null, "created_at": "2026-09-10T09:03:44.870Z", "behind": false } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Check Runs Source: https://docs.bland.ai/api-v2/get/agents-id-check-runs GET https://api.bland.ai/v2/agents/{agent_id}/check-runs List an agent's check runs for one environment. ### Overview Returns the agent's check runs for one environment, newest first, including runs still in flight. Use it for history or to see which run is active. To poll a single run, use [Get Check Run](/api-v2/get/agents-id-check-runs-run-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Query Parameters **env** `string` (default: production) The environment to list runs for: `staging` or `production`. Any other value falls back to `production`. **limit** `integer` (default: 25) Maximum number of runs to return. Minimum `1`, maximum `100`. Values outside that range are clamped. ### Response **data** `array` Array of check run objects, newest first. **check run object** **id** `string` Unique identifier for the check run. **agent\_id** `string` The agent the run belongs to. **env\_type** `string` The environment whose checks were run: `staging` or `production`. **agent\_version\_id** `string` The candidate version the run scored. **semver** `string | null` The candidate's published version number, or `null` if it has never been published. **version\_name** `string | null` The candidate's saved name, or `null` if it has none. **status** `string` `PENDING`, `RUNNING`, `PASSED`, `FAILED`, `ERROR`, or `CANCELLED`. The last four are terminal. **judge\_names** `array` Display names of the judges frozen into the run when it started. **scenario\_count** `integer` Number of scenarios the run drove conversations from. **simulations\_count** `integer` Conversations generated per scenario. **overall\_passed** `boolean | null` `true` when the run `PASSED`, `false` when it `FAILED`, `null` otherwise. **verdicts** `array | null` Per-judge results, or `null` until the run completes. Each has `eval_agent_id`, `eval_agent_version_id`, `name`, `required`, `target_level_keys`, `match_rate`, `score`, and `passed`. See [Get Check Run](/api-v2/get/agents-id-check-runs-run-id) for field details. **simulation\_set\_id** `string | null` ID of the generated conversation set. `null` until generation starts. **eval\_run\_id** `string | null` ID of the scoring run. `null` until scoring starts. **error\_message** `string | null` Why the run ended in `ERROR`, or `null`. **triggered\_by** `string | null` ID of the user who started the run, or `null` when started with an org-level key. **created\_at** `string` ISO 8601 timestamp the run was created. **started\_at** `string | null` When scoring began. `null` while `PENDING`. **completed\_at** `string | null` When the run reached a terminal status. `null` while in flight. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "ac5df482-7883-412b-b8a8-bb6496d500ec", "agent_id": "35675d2f-3e9d-4d61-a43c-4cf4db5bddc9", "env_type": "staging", "agent_version_id": "dacfbe0a-bc77-4d0c-9c27-b969ed928dcd", "semver": null, "version_name": "Add callback offer", "status": "RUNNING", "judge_names": ["Resolution quality"], "scenario_count": 2, "simulations_count": 5, "overall_passed": null, "verdicts": null, "simulation_set_id": "c4f2e783-688c-41b0-ae2f-b77773805771", "eval_run_id": null, "error_message": null, "triggered_by": "4bf4c1d6-b1f0-4a29-809f-3fcee3709a07", "created_at": "2026-09-10T18:41:02.774Z", "started_at": "2026-09-10T18:41:05.309Z", "completed_at": null }, { "id": "f0024822-5696-4392-929b-88a88a966e71", "agent_id": "35675d2f-3e9d-4d61-a43c-4cf4db5bddc9", "env_type": "staging", "agent_version_id": "6b2027df-5727-4feb-8215-2d57a1cfe82b", "semver": "1.3.0", "version_name": null, "status": "PASSED", "judge_names": ["Resolution quality"], "scenario_count": 2, "simulations_count": 5, "overall_passed": true, "verdicts": [ { "eval_agent_id": "bcb07d72-36f0-49db-8fdf-f922d7b0a736", "eval_agent_version_id": "0754e124-3915-4666-bd22-aa7f5f6d06cb", "name": "Resolution quality", "required": true, "target_level_keys": ["good", "excellent"], "match_rate": 0.9, "score": 84.6, "passed": true } ], "simulation_set_id": "698e65a5-dd49-448f-8db9-6c5e7e667bec", "eval_run_id": "b1aa992f-3503-42b0-b3f5-6c376d037090", "error_message": null, "triggered_by": null, "created_at": "2026-09-09T11:15:48.020Z", "started_at": "2026-09-09T11:15:50.611Z", "completed_at": "2026-09-09T11:27:13.488Z" } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Check Run Source: https://docs.bland.ai/api-v2/get/agents-id-check-runs-run-id GET https://api.bland.ai/v2/agents/{agent_id}/check-runs/{run_id} Retrieve a check run and its verdicts. ### Overview Returns one check run with its per-judge verdicts. Poll this after [Start Check Run](/api-v2/post/agents-id-environments-env-check-runs) until `status` is `PASSED`, `FAILED`, `ERROR`, or `CANCELLED`; only then are `overall_passed` and `verdicts` final. The run is a report only: it never changes which version an environment runs. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **run\_id** `string` *required* The check run's unique identifier, from the `id` returned by [Start Check Run](/api-v2/post/agents-id-environments-env-check-runs). ### Response **data** `object` The check run. **check run object** **id** `string` Unique identifier for the check run. **agent\_id** `string` The agent the run belongs to. **env\_type** `string` The environment whose checks were run: `staging` or `production`. **agent\_version\_id** `string` The candidate version the run scored. **semver** `string | null` The candidate's published version number. `null` when the candidate has never been published, which is the normal case for a `staging` run. **version\_name** `string | null` The candidate's saved name, or `null` if it has none. **status** `string` `PENDING` (created, scoring not yet started), `RUNNING` (generating and scoring conversations), then one of the terminal states `PASSED`, `FAILED`, `ERROR`, or `CANCELLED`. A run that stays `PENDING` or `RUNNING` for 45 minutes is marked `ERROR` with the message `Check run timed out`. **judge\_names** `array` Display names of the judges frozen into the run when it started. Present while the run is in flight, before any verdicts exist. **scenario\_count** `integer` Number of scenarios the run drove conversations from. **simulations\_count** `integer` Conversations generated per scenario. **overall\_passed** `boolean | null` `true` when the run `PASSED`, meaning every judge with `required: true` passed. `false` when it `FAILED`. `null` while in flight, or when the run ended in `ERROR` or `CANCELLED` without a verdict. Informational judges (`required: false`) never affect this value. **verdicts** `array | null` Per-judge results, or `null` until the run completes. See `data.verdicts` below. **simulation\_set\_id** `string | null` ID of the generated conversation set. `null` until generation starts. **eval\_run\_id** `string | null` ID of the scoring run. `null` until scoring starts. **error\_message** `string | null` Why the run ended in `ERROR`, or `null`. **triggered\_by** `string | null` ID of the user who started the run, or `null` when started with an org-level key. **created\_at** `string` ISO 8601 timestamp the run was created. **started\_at** `string | null` When scoring began. `null` while `PENDING`. **completed\_at** `string | null` When the run reached a terminal status. `null` while in flight. **data.verdicts** `array | null` One entry per judge, in config order. `null` until the run completes. **verdict object** **eval\_agent\_id** `string` The judge's unique identifier. **eval\_agent\_version\_id** `string` The judge version the run used. **name** `string` The judge's display name. **required** `boolean` Whether a failing verdict from this judge fails the run. **target\_level\_keys** `array` The grade levels counted as passing. Empty for pass/fail judges. **match\_rate** `number | null` Fraction of scored conversations, `0` to `1`, that landed on a passing level. `null` when no conversation produced a determinable result. **score** `number | null` Mean judge score across scored conversations on a `0` to `100` scale, rounded to one decimal. `null` when none were scored. **passed** `boolean | null` `true` when `match_rate` is at least `0.5`, `false` when it is lower, `null` when `match_rate` is `null`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "fb12d904-efbe-4bb2-b167-04a5d8446fad", "agent_id": "3a5dff19-707a-4776-943e-809520a3592a", "env_type": "production", "agent_version_id": "20752a9f-c33c-49b1-914c-ba468ea4ad5f", "semver": "2.1.0", "version_name": "Insurance intake v2", "status": "PASSED", "judge_names": ["Resolution quality", "No policy violations"], "scenario_count": 2, "simulations_count": 5, "overall_passed": true, "verdicts": [ { "eval_agent_id": "30dd62b6-13b2-4279-ac57-fdee065880a5", "eval_agent_version_id": "2ea22a1c-380f-4d94-90ce-0c30b003fbfc", "name": "Resolution quality", "required": true, "target_level_keys": ["good", "excellent"], "match_rate": 0.8, "score": 81.3, "passed": true }, { "eval_agent_id": "0497636a-27e3-4b06-b05a-3f49a6610f4f", "eval_agent_version_id": "aed97f7b-4535-49d3-b125-c4692ab44d87", "name": "No policy violations", "required": false, "target_level_keys": [], "match_rate": 0.4, "score": 40.0, "passed": false } ], "simulation_set_id": "92e38d39-f377-4075-9ddc-724096d72d22", "eval_run_id": "4f96db0e-2456-4b70-81e9-155b3c29a9b5", "error_message": null, "triggered_by": "0ce6e187-38fa-40f7-95df-465368d7c104", "created_at": "2026-09-10T14:03:22.901Z", "started_at": "2026-09-10T14:03:25.144Z", "completed_at": "2026-09-10T14:16:58.377Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Check run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agent Deployments Source: https://docs.bland.ai/api-v2/get/agents-id-deployments GET https://api.bland.ai/v2/agents/{agent_id}/deployments List an environment's deployment history, newest first. ### Overview Every publish, promote, and rollback appends a deployment to the target environment's history. This endpoint returns that history for one environment, newest first, with the latest check run recorded for each deployed version. Use `is_rollback_eligible` to find valid targets for [Roll Back Agent](/api-v2/post/agents-id-rollback). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Query Parameters **env** `string` (default: production) Environment to list: `dev`, `staging`, or `production`. Any other value falls back to `production`. **limit** `integer` (default: 50) Maximum number of deployments to return. Minimum `1`, maximum `200`. Values outside that range are clamped; a non-numeric value falls back to `50`. ### Response **data** `array` Deployments for the requested environment, newest first. **deployment object** **id** `string` Unique identifier for the deployment. **env\_type** `string` The environment this deployment was made to. Matches the `env` query parameter. **agent\_version\_id** `string` ID of the version that was deployed. **version\_name** `string | null` The version's saved name, or `null` if it was never named. **semver** `string` The version number recorded on this deployment. Promotes and rollbacks re-record the version's original number rather than minting a new one. **deployed\_by** `string | null` ID of the user who made the deployment, or `null` when made with an org-level key. **deployed\_at** `string` ISO 8601 timestamp of the deployment. **check\_run** `object | null` The newest check run that scored this deployment's version, regardless of the environment the run targeted. `null` if the version has never been checked. See `data[].check_run` below. **is\_rollback\_eligible** `boolean` `true` for `production` deployments whose version is not the current production pin. Always `false` for `dev` and `staging`. **data\[].check\_run** `object | null` The check run attached to a deployment. **check run object** **id** `string` Unique identifier for the check run. **agent\_id** `string` The agent the run belongs to. **env\_type** `string` The environment the run was started for: `staging` or `production`. **agent\_version\_id** `string` The version the run scored. **semver** `string | null` The scored version's number, or `null` if it had not been published when the run was read. **version\_name** `string | null` The scored version's saved name, or `null`. **status** `string` One of `PENDING`, `RUNNING`, `PASSED`, `FAILED`, `ERROR`, `CANCELLED`. **judge\_names** `string[]` Display names of the judges configured when the run started. **scenario\_count** `integer` Number of test scenarios in the run. **simulations\_count** `integer` Conversations generated per scenario. **overall\_passed** `boolean | null` `true` when every required judge passed, `false` when one failed, `null` while the run has no verdict. **verdicts** `array | null` One entry per judge once the run finishes, otherwise `null`. Each has `eval_agent_id`, `eval_agent_version_id`, `name`, `required`, `target_level_keys` (string array, empty for pass/fail judges), `match_rate` (number or `null`), `score` (0 to 100, or `null`), and `passed` (boolean or `null`). **simulation\_set\_id** `string | null` ID of the simulated conversation set, once created. **eval\_run\_id** `string | null` ID of the evaluation run that scored the simulations, once started. **error\_message** `string | null` Failure detail when `status` is `ERROR`. **triggered\_by** `string | null` ID of the user who started the run, or `null`. **created\_at** `string` ISO 8601 timestamp the run was created. **started\_at** `string | null` ISO 8601 timestamp the run began executing, or `null`. **completed\_at** `string | null` ISO 8601 timestamp the run reached a terminal status, or `null`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "e787c15f-abe6-409d-a685-1b007aad977d", "env_type": "production", "agent_version_id": "6cd4ce35-a4d2-4d13-a708-2a05f86ed3d8", "version_name": "Holiday hours", "semver": "1.3.2", "deployed_by": "f4cfacd2-d5b9-4498-ace1-8868e5b05b49", "deployed_at": "2026-09-10T18:42:11.904Z", "check_run": { "id": "16a5fe15-9458-4237-b884-69ce44413aae", "agent_id": "449bbc38-188a-4533-b73a-ebf1debdf535", "env_type": "staging", "agent_version_id": "6cd4ce35-a4d2-4d13-a708-2a05f86ed3d8", "semver": "1.3.2", "version_name": "Holiday hours", "status": "PASSED", "judge_names": [ "Greeting quality" ], "scenario_count": 3, "simulations_count": 2, "overall_passed": true, "verdicts": [ { "eval_agent_id": "de2d68ac-cfc6-4c40-8b1a-d6e541133f3c", "eval_agent_version_id": "e112f640-71be-46ca-8269-746abec3bcde", "name": "Greeting quality", "required": true, "target_level_keys": [], "match_rate": 1, "score": 88, "passed": true } ], "simulation_set_id": "0cb85a21-bd7d-4a73-ace4-738507fb36a0", "eval_run_id": "968c3972-ecca-4878-acd5-273a21853d5b", "error_message": null, "triggered_by": "f4cfacd2-d5b9-4498-ace1-8868e5b05b49", "created_at": "2026-09-10T18:30:02.117Z", "started_at": "2026-09-10T18:30:03.540Z", "completed_at": "2026-09-10T18:36:48.221Z" }, "is_rollback_eligible": false }, { "id": "579eca61-40fa-433b-8066-809927758313", "env_type": "production", "agent_version_id": "0f5adeb8-94a2-4cc3-8e6e-015178f994b7", "version_name": null, "semver": "1.3.1", "deployed_by": "f4cfacd2-d5b9-4498-ace1-8868e5b05b49", "deployed_at": "2026-09-03T15:07:39.318Z", "check_run": null, "is_rollback_eligible": true } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Dispositions Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions GET https://api.bland.ai/v2/agents/{agent_id}/dispositions List the dispositions defined on an agent. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns every disposition on the agent, oldest first, as summary records with lifecycle state and draft and published pointers. The draft definition itself is not included; fetch it with [Get Disposition Draft](/api-v2/get/agents-id-dispositions-disposition-id-draft). Create one with [Create Disposition](/api-v2/post/agents-id-dispositions). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. ### Response **data.dispositions** `array` Disposition summaries ordered by `createdAt` ascending. **disposition object** **id** `string` Unique identifier for the disposition. **agentId** `string` The agent this disposition belongs to. **key** `string` Stable slug, unique per agent. Set at creation and never changes. **state** `string` `disabled` or `enabled`. A new disposition starts `disabled`. [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish) sets `enabled`; [Disable Disposition](/api-v2/post/agents-id-dispositions-disposition-id-disable) sets `disabled` again. **publishedVersionId** `string | null` The most recently published version, or `null` if never published. **publishedVersionNumber** `number | null` Sequential number of that version, starting at `1`, or `null` if never published. **draftRevision** `number` Optimistic-concurrency counter for the draft. Starts at `1` and increments on every draft update and publish. Pass it back as `expectedDraftRevision` when writing. **draftValueCount** `number` Number of values in the current draft definition. **hasUnpublishedChanges** `boolean` `true` when the draft differs from the published version, or when nothing has been published yet. **name** `string` The draft definition's name. **description** `string` The draft definition's description. May be an empty string. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "dispositions": [ { "id": "a2eb0578-7b5b-4dbf-9ef9-47c9612208cf", "agentId": "93431be6-4e2b-489d-96b3-2de573e1a11e", "key": "appointment_outcome", "state": "enabled", "publishedVersionId": "139e85f9-81e8-4371-92b6-649922bc32d1", "publishedVersionNumber": 3, "draftRevision": 7, "draftValueCount": 2, "hasUnpublishedChanges": false, "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "createdAt": "2026-08-30T15:21:04.118Z", "updatedAt": "2026-09-09T11:47:52.903Z" }, { "id": "1019d89e-7d92-4087-aaf0-520e4ad21577", "agentId": "93431be6-4e2b-489d-96b3-2de573e1a11e", "key": "escalation_reason", "state": "disabled", "publishedVersionId": null, "publishedVersionNumber": null, "draftRevision": 2, "draftValueCount": 1, "hasUnpublishedChanges": true, "name": "Escalation reason", "description": "", "createdAt": "2026-09-08T09:02:33.560Z", "updatedAt": "2026-09-08T09:15:10.221Z" } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Call Disposition Runs Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-call-runs GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/call-runs Get the latest production disposition results for up to 100 of an agent's calls, with each run's values, status, and delivery timing. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the disposition results for a set of the agent's calls. Use it to read what your published dispositions produced on real calls, for example to sync results into your own reporting. The dashboard's Conversations page reads the same data. Only production runs are returned. Test runs are listed with [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows). For each call, you get the newest run of each disposition. Each run is labelled with the published version it executed, so renaming or editing a disposition later does not change how past results read. Results carry values only. Rationale and evidence are omitted. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. ### Query Parameters **callIds** `string` *required* Comma-separated call IDs, up to 100. Duplicates are ignored. Returns `400` with `callIds is required` when empty, `callIds accepts at most 100 ids` when over the limit, or `callIds must be valid UUIDs` when any ID is not a UUID. Calls that belong to another agent, or that have no disposition runs, are left out of the response. ### Response **data.runs** `array` One entry per call and disposition, oldest first. Empty when none of the calls have runs. **run object** **id** `string` The run's unique identifier. **callId** `string` The call the run executed against. **dispositionId** `string` The disposition that ran. **dispositionKey** `string` The disposition's key. **name** `string` The disposition's name as of the executed version. **versionNumber** `number | null` The published version that ran, or `null` if unknown. **status** `string` `pending`, `queued`, or `running` while in progress. `complete`, `failed`, or `cancelled` once finished. **timing** `string | null` The executed version's delivery timing: `immediate` or `within_24h`. `null` when the version is unknown. **values** `array` The values defined on the executed version. **values\[].id** `string` The value's identifier. Matches `results[].valueId`. **values\[].key** `string` The value's key. **values\[].label** `string` The value's label, or its key when it has none. **values\[].kind** `string` The value's source: `variable_extraction`, `structured_extraction`, `judge`, or `custom_code`. **values\[].reasoningEffort** `string | null` The reasoning effort the value ran at: `auto`, `low`, `medium`, or `high`. `null` for `custom_code`, which runs no model. **results** `array` One result per value produced so far. Empty until the run produces values. **results\[].valueId** `string` The value this result belongs to. **results\[].state** `string` `produced`, `no_value` (the value could not be determined from the call), or `error`. **results\[].value** `any` Present when `state` is `produced`. Shaped by the value's `schema`. **results\[].error** `object` Present when `state` is `error`: `{ "code", "message" }`. Uses the same codes as [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows). **results\[].executedVia** `object` How the value was executed: `{ "lane", "priceMultiplier", "durationMs" }`. Omitted when not recorded. **error** `object | null` Set when `status` is `failed` or `cancelled`: `{ "code", "message" }`. `message` is `Disposition execution could not be completed.` Otherwise `null`. **createdAt** `string` When the run was created, as an ISO 8601 timestamp. **completedAt** `string | null` When the run finished, or `null` while it is in progress. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```bash cURL theme={null} curl -G "https://api.bland.ai/v2/agents/3c1d2e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f/dispositions/call-runs" \ -H "authorization: YOUR_API_KEY" \ --data-urlencode "callIds=e1739a2c-9137-4e85-925d-1efbb6925bc4,2f5e1dc9-f0ac-408a-b9b4-ba3adc971170" ``` ```json Response theme={null} { "data": { "runs": [ { "id": "0b8f3c52-6e1d-4a7b-9c2e-5d4f6a7b8c9d", "callId": "e1739a2c-9137-4e85-925d-1efbb6925bc4", "dispositionId": "a4d2c7e9-1b3f-4e5a-8c6d-7f9e0a1b2c3d", "dispositionKey": "appointment_outcome", "name": "Appointment outcome", "versionNumber": 3, "status": "complete", "timing": "immediate", "values": [ { "id": "594742b5-3aed-406c-8411-f243391eb225", "key": "booked", "label": "Booked", "kind": "judge", "reasoningEffort": "low" } ], "results": [ { "valueId": "594742b5-3aed-406c-8411-f243391eb225", "state": "produced", "value": true, "executedVia": { "lane": "sync", "priceMultiplier": 1 } } ], "error": null, "createdAt": "2026-09-28T17:02:11.412Z", "completedAt": "2026-09-28T17:02:19.087Z" }, { "id": "7c2a9e14-3f5b-4d6c-8a1e-2b3c4d5e6f70", "callId": "2f5e1dc9-f0ac-408a-b9b4-ba3adc971170", "dispositionId": "a4d2c7e9-1b3f-4e5a-8c6d-7f9e0a1b2c3d", "dispositionKey": "appointment_outcome", "name": "Appointment outcome", "versionNumber": 3, "status": "running", "timing": "immediate", "values": [ { "id": "594742b5-3aed-406c-8411-f243391eb225", "key": "booked", "label": "Booked", "kind": "judge", "reasoningEffort": "low" } ], "results": [], "error": null, "createdAt": "2026-09-28T17:05:40.221Z", "completedAt": null } ] }, "errors": null } ``` ```json Bad Request theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "callIds accepts at most 100 ids" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id} Retrieve a disposition's summary and lifecycle state. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one disposition's summary: its `state`, the published version pointer, and the draft revision counter. A disposition is created `disabled` with only a draft. [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish) freezes the draft into an immutable version and sets `state` to `enabled`, after which it runs on every new completed call. [Disable Disposition](/api-v2/post/agents-id-dispositions-disposition-id-disable) sets `state` back to `disabled` without touching the draft or version history; publishing again re-enables it. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Response **data** `object` The disposition summary. **disposition object** **id** `string` Unique identifier for the disposition. **agentId** `string` The agent this disposition belongs to. **key** `string` Stable slug, unique per agent. Set at creation and never changes. **state** `string` `disabled` or `enabled`. Only `enabled` dispositions run on new calls. **publishedVersionId** `string | null` The most recently published version, or `null` if never published. Disabling does not clear it. **publishedVersionNumber** `number | null` Sequential number of that version, starting at `1`, or `null` if never published. **draftRevision** `number` Optimistic-concurrency counter for the draft. Starts at `1` and increments on every draft update and publish. Pass it back as `expectedDraftRevision` when writing. **draftValueCount** `number` Number of values in the current draft definition. **hasUnpublishedChanges** `boolean` `true` when the draft differs from the published version, or when nothing has been published yet. **name** `string` The draft definition's name. **description** `string` The draft definition's description. May be an empty string. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "98f84865-1c4e-402e-a94b-8b8b19e2d82b", "agentId": "e32e3af8-a938-44d6-9cf5-8877e59229c7", "key": "appointment_outcome", "state": "enabled", "publishedVersionId": "e5460335-b787-4ec2-b015-f2527b526326", "publishedVersionNumber": 2, "draftRevision": 5, "draftValueCount": 2, "hasUnpublishedChanges": true, "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "createdAt": "2026-08-30T15:21:04.118Z", "updatedAt": "2026-09-10T08:12:40.077Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Draft Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-draft GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/draft Retrieve a disposition's live draft definition. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the editable draft definition and its current `revision`. Send that revision back as `expectedDraftRevision` when you call [Update Disposition Draft](/api-v2/patch/agents-id-dispositions-disposition-id-draft) or [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish). Compare the draft against its published base with [Get Disposition Version](/api-v2/get/agents-id-dispositions-disposition-id-versions-version-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Response **data.dispositionId** `string` The disposition this draft belongs to. **data.revision** `number` The draft's current revision. Every draft update and publish increments it. **data.baseVersionId** `string | null` The most recently published version, which is the base this draft is edited against. `null` if the disposition has never been published. **data.definition** `object` The draft definition. Same shape as the `definition` body parameter of [Create Disposition](/api-v2/post/agents-id-dispositions). **definition object** **name** `string` Display name, 1 to 120 characters. **description** `string` Free-text description, up to 2000 characters. May be empty. **timing** `string` `immediate` or `within_24h`. **values** `array` Up to 50 value objects, each with `id`, `key`, `label`, `schema`, and `source`. A `structured_extraction` source that has been through publish also carries a server-written `frozen` copy of the extractor's prompt, output schema, and inference configuration; its `inferenceConfig.modelProfileKey`, when present, is one of `balanced`, `fast`, or `high_accuracy`. **transformation** `object` `{ "version": 1, "root": node }`, where the root node assembles the delivered payload from value ids and literals. **postCallWebhook** `object` `{ "mode": "hold" }` or `{ "mode": "emit_followup" }`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "dispositionId": "88b81ef5-3a12-4294-89a1-6cb88f111e05", "revision": 4, "baseVersionId": "dfc54fe8-59e1-4722-8123-2fc186ea7fd9", "definition": { "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "timing": "immediate", "values": [ { "id": "aab72385-5852-4da8-aeff-703ddfc4105d", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "judge", "judgeId": "4bddc575-a6b2-4257-b75f-0963b24dd55f", "judgeVersionId": "4baad4cc-814b-4555-bbe6-58eeb9611e84", "execution": { "reasoningEffort": "auto", "inputSourceIds": ["transcript"] } } }, { "id": "d6d00a32-836b-4e50-9619-f2d11d988659", "key": "callback_time", "label": "Requested callback time", "schema": { "kind": "string", "description": "When the caller asked to be called back. Preserve exact character-by-character spelling." }, "source": { "kind": "variable_extraction", "variableKey": "callback_time", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "booked": { "kind": "value", "valueId": "aab72385-5852-4da8-aeff-703ddfc4105d" }, "callback_time": { "kind": "value", "valueId": "d6d00a32-836b-4e50-9619-f2d11d988659" } } } }, "postCallWebhook": { "mode": "hold" } } }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Disposition Test Runs Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-runs GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs List test runs for a disposition. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the disposition's test runs, newest first, each with its frozen definition, progress counts, and a summary computed from its per-call rows. Start one with [Create Disposition Test Run](/api-v2/post/agents-id-dispositions-disposition-id-runs); read a single run's live state with [Get Disposition Test Run](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Query Parameters **limit** `integer` (default: 25) Maximum number of runs to return. Minimum `1`, maximum `100`. Values outside that range are clamped; a non-numeric value falls back to `25`. There is no cursor: the newest `limit` runs are returned. ### Response **data.runs** `array` Test run objects ordered by `createdAt` descending. **test run object** **id** `string` Unique identifier for the test run. **dispositionId** `string` The disposition this run belongs to. **target** `string` `draft` or `published`: which definition the run was started from. A replay keeps its source run's target. **configurationSource** `string` `draft`, `published`, or `frozen_run` (a replay of an earlier run's frozen snapshot). **executionSla** `string` `realtime` or `queued`. **replaySourceRunId** `string | null` The run this one replays, or `null`. **definition** `object` The immutable definition snapshot this run executes. Same shape as the `definition` body parameter of [Create Disposition](/api-v2/post/agents-id-dispositions). **population** `object` `{ "environment": "production", "requestedSize" }`. `requestedSize` is the sample size asked for, or the number of explicit call ids. **status** `string` `queued`, `running`, `complete`, `partial` (finished with some failed calls), `failed`, or `cancelled`. **requestedSize** `number` Calls requested. **resolvedSize** `number` Calls admitted once the cohort resolved. `0` until execution starts. **completedSize** `number` Calls that finished successfully. Counted live from the per-call rows while `running`; the final tally afterwards. **failedSize** `number` Calls that failed or were cancelled. Counted live while `running`. **evalRunId** `null` Always `null`. Retained for compatibility. **mode** `string` `recent` (sampled) or `calls` (explicit call ids). **inputSetHash** `null` Always `null`. Retained for compatibility. **definitionHash** `string` SHA-256 hex digest of the definition snapshot. Runs with equal hashes executed identical definitions. **draftRevision** `number | null` The draft revision the run was started from, or `null` for a published target. **dispositionVersionId** `string | null` The published version the run was started from, or `null` for a draft target. **summary** `object` Counts computed from the per-call rows: `caseCount` (calls with a row), `failedCaseCount`, `producedValueCount` (value results in state `produced`), `totalValueCount` (all value results), and `correctionCount` (correction revisions saved against the run). **error** `object | null` `{ "code", "message" }` when the run as a whole failed, otherwise `null`. Codes include `test_run_cancelled`, `test_run_stale`, `in_flight_cap_exceeded`, `empty_cohort`, `billing_not_allowed`, `test_run_execution_failed`, and `disposition_failed`. **createdAt** `string` ISO 8601 timestamp of creation. **startedAt** `string | null` When execution began, or `null` while queued. **completedAt** `string | null` When the run reached a final status, or `null`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "runs": [ { "id": "429f5de4-ae9b-470f-be68-7390899af9b5", "dispositionId": "dfe4e15d-01aa-4dfd-94d8-09e32fc6e875", "target": "draft", "configurationSource": "draft", "executionSla": "realtime", "replaySourceRunId": null, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "e3d3b96a-39d3-4e5e-9ba6-cdfaa0efb92b", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "variable_extraction", "variableKey": "appointment_booked", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "value", "valueId": "e3d3b96a-39d3-4e5e-9ba6-cdfaa0efb92b" } }, "postCallWebhook": { "mode": "emit_followup" } }, "population": { "environment": "production", "requestedSize": 25 }, "status": "running", "requestedSize": 25, "resolvedSize": 25, "completedSize": 11, "failedSize": 1, "evalRunId": null, "mode": "recent", "inputSetHash": null, "definitionHash": "a5d6152e751530b817c530df32d908ea058ad72769c1eacccbf0eb42517e1efa", "draftRevision": 6, "dispositionVersionId": null, "summary": { "caseCount": 25, "failedCaseCount": 1, "producedValueCount": 11, "totalValueCount": 11, "correctionCount": 0 }, "error": null, "createdAt": "2026-09-10T19:12:44.902Z", "startedAt": "2026-09-10T19:12:46.130Z", "completedAt": null }, { "id": "ef1c2354-dc5b-4993-8bcd-283836c23e69", "dispositionId": "dfe4e15d-01aa-4dfd-94d8-09e32fc6e875", "target": "published", "configurationSource": "published", "executionSla": "realtime", "replaySourceRunId": null, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "e3d3b96a-39d3-4e5e-9ba6-cdfaa0efb92b", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "variable_extraction", "variableKey": "appointment_booked", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "value", "valueId": "e3d3b96a-39d3-4e5e-9ba6-cdfaa0efb92b" } }, "postCallWebhook": { "mode": "emit_followup" } }, "population": { "environment": "production", "requestedSize": 50 }, "status": "complete", "requestedSize": 50, "resolvedSize": 50, "completedSize": 50, "failedSize": 0, "evalRunId": null, "mode": "recent", "inputSetHash": null, "definitionHash": "7a0e4daae110c7411448abc7a83a2066b5f3f553b6b67b0d2d9cd0a29a5c634e", "draftRevision": null, "dispositionVersionId": "d16bf596-21c7-4acb-8d72-2dced2790181", "summary": { "caseCount": 50, "failedCaseCount": 0, "producedValueCount": 48, "totalValueCount": 50, "correctionCount": 3 }, "error": null, "createdAt": "2026-09-09T12:01:08.417Z", "startedAt": "2026-09-09T12:01:09.655Z", "completedAt": "2026-09-09T12:09:51.208Z" } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Test Run Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs/{run_id} Retrieve a test run with live progress counts. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one test run with its frozen definition, status, and counts. While the run is `running`, `completedSize` and `failedSize` are counted live from the per-call rows; once it finishes they are the final tally. Poll this endpoint after [Create Disposition Test Run](/api-v2/post/agents-id-dispositions-disposition-id-runs), then read results with [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows) or [Export Test Run CSV](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-export-csv). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **run\_id** `string` *required* The test run's unique identifier. Must be a UUID; otherwise returns `400` with the message `runId must be a valid UUID`. Returns `404 Test run not found` if it does not belong to this disposition. ### Response **data** `object` The test run. **test run object** **id** `string` Unique identifier for the test run. **dispositionId** `string` The disposition this run belongs to. **target** `string` `draft` or `published`: which definition the run was started from. A replay keeps its source run's target. **configurationSource** `string` `draft`, `published`, or `frozen_run` (a replay of an earlier run's frozen snapshot). **executionSla** `string` `realtime` or `queued`. **replaySourceRunId** `string | null` The run this one replays, or `null`. **definition** `object` The immutable definition snapshot this run executes. Same shape as the `definition` body parameter of [Create Disposition](/api-v2/post/agents-id-dispositions). **population** `object` `{ "environment": "production", "requestedSize" }`. **status** `string` `queued`, `running`, `complete`, `partial` (finished with some failed calls), `failed`, or `cancelled`. Corrections and alignment require `complete`, `partial`, or `failed`. **requestedSize** `number` Calls requested. **resolvedSize** `number` Calls admitted once the cohort resolved. `0` until execution starts. **completedSize** `number` Calls that finished successfully. Counted live while `running`. **failedSize** `number` Calls that failed or were cancelled. Counted live while `running`. **evalRunId** `null` Always `null`. Retained for compatibility. **mode** `string` `recent` (sampled) or `calls` (explicit call ids). **inputSetHash** `null` Always `null`. Retained for compatibility. **definitionHash** `string` SHA-256 hex digest of the definition snapshot. **draftRevision** `number | null` The draft revision the run was started from, or `null` for a published target. **dispositionVersionId** `string | null` The published version the run was started from, or `null` for a draft target. **summary** `object` Counts computed from the per-call rows: `caseCount`, `failedCaseCount`, `producedValueCount`, `totalValueCount`, and `correctionCount` (correction revisions saved against the run). **error** `object | null` `{ "code", "message" }` when the run as a whole failed, otherwise `null`. Codes include `test_run_cancelled`, `test_run_stale`, `in_flight_cap_exceeded`, `empty_cohort`, `billing_not_allowed`, `test_run_execution_failed`, and `disposition_failed`. **createdAt** `string` ISO 8601 timestamp of creation. **startedAt** `string | null` When execution began, or `null` while queued. **completedAt** `string | null` When the run reached a final status, or `null`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "56294c6b-883b-48ff-92bd-a36b09064859", "dispositionId": "386f4dfc-7f6c-4dbe-be10-5fa14924c894", "target": "published", "configurationSource": "published", "executionSla": "realtime", "replaySourceRunId": null, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "2b462fd0-36b3-4cd7-9a60-1736613c0a65", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "variable_extraction", "variableKey": "appointment_booked", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "booked": { "kind": "value", "valueId": "2b462fd0-36b3-4cd7-9a60-1736613c0a65" } } } }, "postCallWebhook": { "mode": "emit_followup" } }, "population": { "environment": "production", "requestedSize": 50 }, "status": "complete", "requestedSize": 50, "resolvedSize": 50, "completedSize": 49, "failedSize": 1, "evalRunId": null, "mode": "recent", "inputSetHash": null, "definitionHash": "fc3b269ec69e90bf999e69412ffbc45badaba61f2da5b13cbe6625e729be5a8d", "draftRevision": null, "dispositionVersionId": "0983ec20-8ccc-4603-bdad-f9b8eaa15285", "summary": { "caseCount": 50, "failedCaseCount": 1, "producedValueCount": 47, "totalValueCount": 49, "correctionCount": 3 }, "error": null, "createdAt": "2026-09-09T12:01:08.417Z", "startedAt": "2026-09-09T12:01:09.655Z", "completedAt": "2026-09-09T12:09:51.208Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Test run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Test Run Correction Revisions Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-cases-call-id-annotations-value-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs/{run_id}/cases/{call_id}/annotations/{value_id} List correction revisions for one call and value. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the correction history for one value on one call of a test run, newest revision first, up to 50 entries. Corrections are written with [Correct Test Run Value](/api-v2/put/agents-id-dispositions-disposition-id-runs-run-id-cases-call-id-annotations-value-id); only the newest revision counts as the current correction on [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows) and in the CSV export. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **run\_id** `string` *required* The test run's unique identifier. Must be a UUID; otherwise returns `400` with the message `runId must be a valid UUID`. Returns `404 Test run not found` if it does not belong to this disposition. **call\_id** `string` *required* The call. Must be a UUID; otherwise returns `400` with the message `callId must be a valid UUID`. Returns `404` with the message `Test run case not found` if the call is not part of this run. **value\_id** `string` *required* The definition value. Must be a UUID; otherwise returns `400` with the message `valueId must be a valid UUID`. Returns `404` with the message `Disposition value not found in this run` if the run's definition snapshot has no such value. ### Response **data.annotations** `array` Correction revisions ordered by `revision` descending, at most 50. Empty if the cell was never corrected. **correction object** **id** `string` Unique identifier for this revision. **testRunId** `string` The test run. **testRunCaseId** `string` Identifier of this call's execution within the run. Matches the `run_id` column of the CSV export. **callId** `string` The call. **valueId** `string` The definition value. **revision** `number` `1` for the first correction, incrementing with each later one. **originalResult** `object` The engine's result as it stood when the correction was saved: `valueId`, `state`, and, when present, `value`, `error`, `rationale`, `evidence`, and `executedVia`. **correctedResult** `object` `{ "valueId", "state" }` plus `value` when `state` is `produced`. **explanation** `string` The explanation supplied with the correction. **createdBy** `string | null` ID of the user who saved the correction, or `null` when saved with an org-level key. **createdAt** `string` ISO 8601 timestamp of the correction. **data.truncated** `boolean` `true` when more than 50 revisions exist and older ones were cut from the list. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "annotations": [ { "id": "71401be8-f0db-412c-9621-6fcc3a50195c", "testRunId": "77216b1c-2a91-496f-84df-76be610c8510", "testRunCaseId": "b3caa112-96c4-4bfc-b62f-20406b1f961f", "callId": "66a9ec46-33ea-4b56-bd4a-970706c652e8", "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "revision": 2, "originalResult": { "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "state": "produced", "value": false, "rationale": "No appointment time was agreed before the caller hung up." }, "correctedResult": { "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "state": "no_value" }, "explanation": "On a second listen the caller only asked about availability and never committed to a time, so there is no booking outcome to record.", "createdBy": "8367c610-f081-47f5-ba7d-2f9c89d26e47", "createdAt": "2026-09-10T21:02:15.114Z" }, { "id": "2b34fbbf-d3cb-45fc-ad3f-cbfa95f2afbd", "testRunId": "77216b1c-2a91-496f-84df-76be610c8510", "testRunCaseId": "b3caa112-96c4-4bfc-b62f-20406b1f961f", "callId": "66a9ec46-33ea-4b56-bd4a-970706c652e8", "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "revision": 1, "originalResult": { "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "state": "produced", "value": false, "rationale": "No appointment time was agreed before the caller hung up." }, "correctedResult": { "valueId": "d7e20249-0c03-49dd-9b28-70797904c6b4", "state": "produced", "value": true }, "explanation": "The caller agreed to the slot at the very end of the call, after the agent's recap.", "createdBy": "8367c610-f081-47f5-ba7d-2f9c89d26e47", "createdAt": "2026-09-10T20:14:33.870Z" } ], "truncated": false }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Test run case not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Export Test Run CSV Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-export-csv GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs/{run_id}/export.csv Download a test run's results as CSV. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Streams the whole test run as a CSV file, one row per call and value, with the engine's result, its evidence, and the latest correction saved for that cell. This is the same data as [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows) without paging. Unlike the other endpoints here, the success response is CSV, not JSON; errors still use the JSON envelope. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **run\_id** `string` *required* The test run's unique identifier. Must be a UUID; otherwise returns `400` with the message `runId must be a valid UUID`. Returns `404 Test run not found` if it does not belong to this disposition. ### Response Returns `200` with `Content-Type: text/csv; charset=utf-8` and `Content-Disposition: attachment; filename="disposition-run-{run_id}.csv"`. The body starts with a UTF-8 byte order mark, rows end in CRLF, and cells containing commas, quotes, or line breaks are quoted with doubled inner quotes. A text cell that begins with `=`, `+`, `@`, or `-` and is not a number is prefixed with an apostrophe so spreadsheets do not treat it as a formula. Rows are sorted by `call_id`, then by definition order of the values, so a run with 50 calls and 3 values yields 150 rows. Only the latest correction for each call and value appears; the export reads at most the 25,000 most recent correction revisions, which covers a full 250-call, 50-value run twice over. **run\_id** `string` Identifier of this call's execution within the run. It matches `testRunCaseId` on correction objects. **call\_id** `string` The call. **run\_status** `string` Execution status for the call: `pending`, `running`, `complete`, `failed`, or `cancelled`. **run\_error\_code** `string` When the call's execution failed as a whole, one of the run error codes (for example `disposition_run_failed`); otherwise empty. **run\_error\_message** `string` Human-readable message for `run_error_code`, or empty. **value\_id** `string` The definition value this row is about. **value\_key** `string` The value's `key`. **value\_label** `string` The value's `label`. **original\_state** `string` The engine's result state: `produced`, `no_value`, `error`, or `missing` when the call produced no result for this value. **original\_value** `string` The engine's produced value, JSON-encoded (so a string appears in quotes, a boolean as `true` or `false`). Empty when there is no value. **evidence** `string` JSON-encoded array of evidence quotes, each with `source`, `speaker`, `start_ms`, `end_ms`, and `text`. Empty when none. **corrected\_state** `string` State of the latest correction, `produced` or `no_value`, or empty if the cell was never corrected. **corrected\_value** `string` The corrected value, JSON-encoded, or empty. **correction\_revision** `string` Revision number of the latest correction, or empty. **correction\_explanation** `string` The explanation supplied with the latest correction, or empty. **value\_error\_code** `string` When `original_state` is `error`, the value-level error code (for example `judge_failed`); otherwise empty. **value\_error\_message** `string` Message for `value_error_code`, always `This value could not be produced.` when set; otherwise empty. ```text Response theme={null} run_id,call_id,run_status,run_error_code,run_error_message,value_id,value_key,value_label,original_state,original_value,evidence,corrected_state,corrected_value,correction_revision,correction_explanation,value_error_code,value_error_message 92439a35-422b-4768-a2b4-b21d7ca5a54f,290e7a5f-8d36-4a9f-bd1b-5593096f9fdb,complete,,,7dd68009-f644-4961-bc4d-418cf6c73692,booked,Appointment booked,produced,true,"[{""source"":""transcript"",""speaker"":""customer"",""start_ms"":84200,""end_ms"":88900,""text"":""Tuesday at three works for me.""}]",,,,,, b01b10a0-dd1a-4901-a755-95af97407733,ba6d1eb0-d9de-46b9-a85a-2e756a1ce4e4,complete,,,7dd68009-f644-4961-bc4d-418cf6c73692,booked,Appointment booked,produced,false,,produced,true,1,The caller agreed to the slot at the very end of the call after the agent's recap.,, f76f5e28-f0d8-42b3-a760-67c73cece843,f3ae11ce-e39f-4566-bc91-d697012e055b,failed,disposition_run_failed,Disposition execution could not be completed.,7dd68009-f644-4961-bc4d-418cf6c73692,booked,Appointment booked,missing,,,,,,,, ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Test run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Test Run Rows Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs/{run_id}/rows Page through a test run's per-call results. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one row per call in the test run, with each value's result, the transformed payload, and the latest correction saved for each value. Rows are paged with `limit` and `offset`. For a flat file of the same data use [Export Test Run CSV](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-export-csv); to record a correction use [Correct Test Run Value](/api-v2/put/agents-id-dispositions-disposition-id-runs-run-id-cases-call-id-annotations-value-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **run\_id** `string` *required* The test run's unique identifier. Must be a UUID; otherwise returns `400` with the message `runId must be a valid UUID`. Returns `404 Test run not found` if it does not belong to this disposition. ### Query Parameters **limit** `integer` (default: 50) Rows per page. Minimum `1`, maximum `250`. Values outside that range are clamped; a non-numeric value falls back to `50`. **offset** `integer` (default: 0) Number of rows to skip. Negative or non-numeric values are treated as `0`. ### Response **data.rows** `array` One row per call in this page, in the order the calls were admitted to the run. **row object** **callId** `string` The call this row executed against. **durationSeconds** `number | null` The call's recorded length in seconds, or `null` if unknown. **status** `string` `queued`, `running`, `complete`, or `failed`. A cancelled execution reports `failed`. **results** `array` One result per value the engine has produced for this call. Empty until the row runs. **results\[].valueId** `string` The definition value this result belongs to. **results\[].state** `string` `produced`, `no_value` (the value could not be determined from the call), or `error`. **results\[].value** `any` Present when `state` is `produced`. Shaped by the value's `schema`. **results\[].error** `object` Present when `state` is `error`: `{ "code", "message" }`. `message` is always `This value could not be produced.` and `code` is one of `billing_not_allowed`, `custom_code_execution_failed`, `custom_code_output_too_large`, `custom_code_pin_mismatch`, `custom_code_pin_unavailable`, `custom_code_result_missing`, `custom_code_run_snapshot_unavailable`, `custom_code_schema_mismatch`, `custom_code_timeout`, `extraction_result_missing`, `extraction_schema_mismatch`, `judge_failed`, `provider_failed`, `unsupported_schema`, `variable_extraction_result_missing`, `verdict_missing`, or `result_error` for anything else. **results\[].rationale** `string` Explanation recorded for model-backed values, up to 2000 characters. Omitted when none was recorded. **results\[].evidence** `array` Up to 8 quotes supporting the result, each `{ "source", "speaker", "start_ms", "end_ms", "text" }`. `source` is `transcript` or `audio`; `speaker` is `agent`, `representative`, `customer`, `unknown`, or `null`; `start_ms` and `end_ms` are non-negative integers or `null`; `text` is at most 1000 characters. Omitted when empty. **results\[].executedVia** `object` How the value was executed: `{ "lane", "priceMultiplier", "durationMs" }`. `lane` is `sync`, `batch`, `deterministic`, or `custom_code`; the other two are optional numbers. Omitted when not recorded. **payload** `any` The transformed payload the disposition would deliver for this call. Omitted until the row completes. **annotations** `array` The latest correction for each value on this call. Same shape as the response of Correct Test Run Value: `id`, `testRunId`, `testRunCaseId`, `callId`, `valueId`, `revision`, `originalResult`, `correctedResult`, `explanation`, `createdBy`, `createdAt`. Empty when nothing has been corrected. **data.total** `number` Total number of rows in the run, regardless of paging. **data.offset** `number` The offset applied. **data.limit** `number` The limit applied, after clamping. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "rows": [ { "callId": "e1739a2c-9137-4e85-925d-1efbb6925bc4", "durationSeconds": 254, "results": [ { "valueId": "594742b5-3aed-406c-8411-f243391eb225", "state": "produced", "value": true, "rationale": "The caller confirmed a Tuesday 3 PM appointment and the agent read back the booking reference.", "evidence": [ { "source": "transcript", "speaker": "customer", "start_ms": 84200, "end_ms": 88900, "text": "Tuesday at three works for me." } ], "executedVia": { "lane": "sync", "priceMultiplier": 1 } } ], "payload": { "booked": true }, "status": "complete", "annotations": [] }, { "callId": "2f5e1dc9-f0ac-408a-b9b4-ba3adc971170", "durationSeconds": 61, "results": [ { "valueId": "594742b5-3aed-406c-8411-f243391eb225", "state": "produced", "value": false, "rationale": "No appointment time was agreed before the caller hung up.", "executedVia": { "lane": "sync", "priceMultiplier": 1 } } ], "payload": { "booked": false }, "status": "complete", "annotations": [ { "id": "6a1e95ab-9834-4140-918f-03fb63c3e7ce", "testRunId": "e87abaf9-cea9-4706-8502-18b7b70f4db8", "testRunCaseId": "9bce50fe-0ba4-48b7-836b-072f9fffb40e", "callId": "2f5e1dc9-f0ac-408a-b9b4-ba3adc971170", "valueId": "594742b5-3aed-406c-8411-f243391eb225", "revision": 1, "originalResult": { "valueId": "594742b5-3aed-406c-8411-f243391eb225", "state": "produced", "value": false, "rationale": "No appointment time was agreed before the caller hung up.", "executedVia": { "lane": "sync", "priceMultiplier": 1 } }, "correctedResult": { "valueId": "594742b5-3aed-406c-8411-f243391eb225", "state": "produced", "value": true }, "explanation": "The caller agreed to the slot at the very end of the call, after the agent's recap.", "createdBy": "6d18dce5-f27d-45f2-8d24-09357aaa355c", "createdAt": "2026-09-10T20:14:33.870Z" } ] } ], "total": 2, "offset": 0, "limit": 50 }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Test run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Disposition Versions Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-versions GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/versions List a disposition's published versions, newest first. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the immutable versions created by [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish), highest `versionNumber` first, 25 per page. Page backwards with `beforeVersion`. Each entry carries the full frozen definition; fetch a single one with [Get Disposition Version](/api-v2/get/agents-id-dispositions-disposition-id-versions-version-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Query Parameters **beforeVersion** `integer` Cursor for the next page: return only versions with `versionNumber` strictly less than this value. Use the `nextCursor` from the previous response. Must be a positive integer; otherwise returns `400` with the message `beforeVersion must be a positive safe integer`. ### Response **data.versions** `array` Up to 25 version objects, ordered by `versionNumber` descending. **version object** **id** `string` Unique identifier for the version. Pass it as `{version_id}` to Get Disposition Version. **dispositionId** `string` The disposition this version belongs to. **versionNumber** `number` Sequential number starting at `1`, unique per disposition. **definition** `object` The frozen definition, same shape as the `definition` body parameter of [Create Disposition](/api-v2/post/agents-id-dispositions). `structured_extraction` sources carry the server-written `frozen` copy of the extractor prompt, output schema, and inference configuration that this version executes; `inferenceConfig.modelProfileKey`, when present, is one of `balanced`, `fast`, or `high_accuracy`. **publishedAt** `string` ISO 8601 timestamp of publication. **data.nextCursor** `number | null` The `versionNumber` to pass as `beforeVersion` for the next page, or `null` when there are no older versions. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "versions": [ { "id": "af219236-2cf3-44dc-b0d8-52f312ca1ca9", "dispositionId": "36c8c6ea-ab36-4510-97b7-59506262bd46", "versionNumber": 2, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "1e3731a3-03fa-4e75-a292-03a87b06b1a8", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "judge", "judgeId": "06bf4d35-15f7-4fc3-a707-0f2bef6a21b2", "judgeVersionId": "a1579eb4-41f6-4b43-beb1-8c73b203cb63", "execution": { "reasoningEffort": "auto", "inputSourceIds": ["transcript"] } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "booked": { "kind": "value", "valueId": "1e3731a3-03fa-4e75-a292-03a87b06b1a8" } } } }, "postCallWebhook": { "mode": "emit_followup" } }, "publishedAt": "2026-09-09T11:47:52.903Z" }, { "id": "6df49c21-73c0-4217-862d-453a0edd82b1", "dispositionId": "36c8c6ea-ab36-4510-97b7-59506262bd46", "versionNumber": 1, "definition": { "name": "Appointment outcome", "description": "", "timing": "immediate", "values": [ { "id": "1e3731a3-03fa-4e75-a292-03a87b06b1a8", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "judge", "judgeId": "06bf4d35-15f7-4fc3-a707-0f2bef6a21b2", "judgeVersionId": "a1579eb4-41f6-4b43-beb1-8c73b203cb63", "execution": { "reasoningEffort": "auto", "inputSourceIds": ["transcript"] } } } ], "transformation": { "version": 1, "root": { "kind": "value", "valueId": "1e3731a3-03fa-4e75-a292-03a87b06b1a8" } }, "postCallWebhook": { "mode": "emit_followup" } }, "publishedAt": "2026-09-02T16:05:19.334Z" } ], "nextCursor": null }, "errors": null } ``` ```json Invalid Cursor theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "beforeVersion must be a positive safe integer" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Version Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-disposition-id-versions-version-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/versions/{version_id} Retrieve one published disposition version. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one immutable version created by [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish), including the exact definition that version executes. Find version ids with [List Disposition Versions](/api-v2/get/agents-id-dispositions-disposition-id-versions) or from `publishedVersionId` on [Get Disposition](/api-v2/get/agents-id-dispositions-disposition-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **version\_id** `string` *required* The version's unique identifier. Must be a UUID; otherwise returns `400` with the message `versionId must be a valid UUID`. Returns `404 Disposition version not found` if it does not belong to this disposition. ### Response **data** `object` The version. **version object** **id** `string` Unique identifier for the version. **dispositionId** `string` The disposition this version belongs to. **versionNumber** `number` Sequential number starting at `1`, unique per disposition. **definition** `object` The frozen definition, same shape as the `definition` body parameter of [Create Disposition](/api-v2/post/agents-id-dispositions). `structured_extraction` sources carry the server-written `frozen` copy of the extractor prompt, output schema, and inference configuration that this version executes; `inferenceConfig.modelProfileKey`, when present, is one of `balanced`, `fast`, or `high_accuracy`. **publishedAt** `string` ISO 8601 timestamp of publication. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "aa3f6224-34ff-49eb-a478-80cdcd57a4c6", "dispositionId": "8dd0d371-905b-491f-a789-f32f29db230d", "versionNumber": 3, "definition": { "name": "Callback request", "description": "Whether the caller asked to be called back, and when.", "timing": "immediate", "values": [ { "id": "53974ae4-9800-4dbf-9187-bfefd9c3fb30", "key": "callback_time", "label": "Requested callback time", "schema": { "kind": "string", "description": "When the caller asked to be called back. Preserve exact character-by-character spelling." }, "source": { "kind": "variable_extraction", "variableKey": "callback_time", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "callback_time": { "kind": "value", "valueId": "53974ae4-9800-4dbf-9187-bfefd9c3fb30" } } } }, "postCallWebhook": { "mode": "emit_followup" } }, "publishedAt": "2026-09-09T11:47:52.903Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition version not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Extractor Catalog Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-extractor-catalog GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractor-catalog List the published extractors a disposition can pin. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one entry per extractor that has a published version, organization-wide extractors plus extractors scoped to this agent, ordered by name. Each entry describes the published version only, which is the version a disposition value pins. Unpublished extractors appear in [List Disposition Extractors](/api-v2/get/agents-id-dispositions-extractors) but not here; publish one with [Publish Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors-extractor-id-publish). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Response **data** `array` Array of extractor catalog entries. Empty when no extractor has been published. **catalog entry** **extractorId** `string` Unique identifier for the extractor. Use it as `extractorId` in a disposition value's `structured_extraction` source. **extractorVersionId** `string` The published version to pin as `extractorVersionId`. Read its full body with [Get Disposition Extractor Version](/api-v2/get/agents-id-dispositions-extractors-extractor-id-versions-version-id). **key** `string` Stable machine key, unique within your organization. **name** `string` Display name of the published version. **description** `string | null` Description of the published version. **outputSchema** `object` The value schema the published version produces: a `kind` of `boolean`, `string`, `number`, `enum`, `array`, or `object` plus kind-specific fields. A disposition value pinning this extractor uses this as its schema. **inputSourceIds** `array` The evidence the published version reads, from `transcript`, `audio_recording`, `call_metadata`, `pathway_logs`, `tool_logs`, `variables`, `agent_config`, `call_config`. **scopedToAgent** `boolean` `true` when the extractor is scoped to this agent, `false` when it is organization-wide. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "extractorId": "f4e932c3-4a1d-4551-9a28-235eb2b85ac5", "extractorVersionId": "5b346f5f-ed6e-4282-b41b-48ebca9f9baf", "key": "appointment_outcome", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inputSourceIds": ["transcript", "call_metadata"], "scopedToAgent": false }, { "extractorId": "8d207a81-fa1e-4210-b9c2-c1e708bb4327", "extractorVersionId": "9c63687a-fa6c-4613-8c22-e72c63aa4fa4", "key": "callback_window", "name": "Callback window", "description": null, "outputSchema": { "kind": "object", "properties": { "requested": { "kind": "boolean", "description": "Whether the caller asked for a callback." }, "window_start": { "kind": "string", "format": "date-time" }, "window_end": { "kind": "string", "format": "date-time" } }, "required": ["requested"] }, "inputSourceIds": ["transcript"], "scopedToAgent": true } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Disposition Extractors Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-extractors GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors List the extractors available to an agent's dispositions. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns every extractor this agent can use, published or not: organization-wide extractors plus extractors scoped to this agent, most recently updated first. Each entry is the extractor record without its version bodies; call [Get Disposition Extractor](/api-v2/get/agents-id-dispositions-extractors-extractor-id) for those. For only the published extractors a disposition can pin, use [Get Extractor Catalog](/api-v2/get/agents-id-dispositions-extractor-catalog). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Response **data** `array` Array of extractor objects. **extractor object** **id** `string` Unique identifier for the extractor. **agentId** `string | null` `null` for an organization-wide extractor available to every agent. Otherwise the id of the one agent it is scoped to. **key** `string` Stable machine key, unique within your organization. **name** `string` The extractor's display name. **description** `string | null` Optional description. **currentVersionId** `string` The `editable` draft version. Pass it as `expectedVersionId` when updating or publishing. **activeVersionId** `string | null` The most recently published version, or `null` if the extractor has never been published. Only published extractors appear in the extractor catalog. **draftRevision** `integer` Concurrency counter. Starts at `1` and increments on every draft update and publish. Pass it as `expectedDraftRevision` when updating or publishing. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "a3d48658-9827-4726-8560-1da7c46402ed", "agentId": null, "key": "appointment_outcome", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "currentVersionId": "1164a759-ad0c-4e44-aeb9-f7b1e3ea1704", "activeVersionId": "7146de47-7558-47b9-b690-82fca5ef50a9", "draftRevision": 3, "createdAt": "2026-09-01T15:02:11.480Z", "updatedAt": "2026-09-09T18:44:03.117Z" }, { "id": "dca50693-63e3-4ffd-a7c1-8511df6aa6f2", "agentId": "eaf4ec8e-74d9-4bbc-a5e6-7cf10e4ff151", "key": "callback_window", "name": "Callback window", "description": null, "currentVersionId": "cde3f9e9-8448-4e1a-ad26-6f3f245f8d00", "activeVersionId": null, "draftRevision": 1, "createdAt": "2026-09-08T10:21:37.902Z", "updatedAt": "2026-09-08T10:21:37.902Z" } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Extractor Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-extractors-extractor-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors/{extractor_id} Retrieve an extractor with its draft and published versions. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns one extractor with its full `currentVersion` (the `editable` draft) and `activeVersion` (the most recently published, `archived` version, or `null` if never published). An extractor always has exactly one editable version, which [Update Disposition Extractor Draft](/api-v2/patch/agents-id-dispositions-extractors-extractor-id-draft) edits in place and [Publish Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors-extractor-id-publish) archives. Use [List Disposition Extractors](/api-v2/get/agents-id-dispositions-extractors) to find extractor ids. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. **extractor\_id** `string` *required* The extractor's unique identifier. Must be organization-wide or scoped to this agent; otherwise returns `404`. A malformed id returns `400` with the message `extractorId must be a valid UUID`. ### Response **data.extractor** `object` The extractor record. **extractor object** **id** `string` Unique identifier for the extractor. **agentId** `string | null` `null` for an organization-wide extractor available to every agent. Otherwise the id of the one agent it is scoped to. **key** `string` Stable machine key, unique within your organization. **name** `string` The extractor's display name. **description** `string | null` Optional description. **currentVersionId** `string` The `editable` draft version, the same id as `data.currentVersion.id`. Pass it as `expectedVersionId` when updating or publishing. **activeVersionId** `string | null` The most recently published version, the same id as `data.activeVersion.id`, or `null` if the extractor has never been published. **draftRevision** `integer` Concurrency counter. Starts at `1` and increments on every draft update and publish. Pass it as `expectedDraftRevision` when updating or publishing. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **data.currentVersion** `object` The `editable` draft version. **version object** **id** `string` Unique identifier for the version. **extractorId** `string` The extractor this version belongs to. **versionNumber** `integer` Starts at `1` and increments on each publish. **state** `string` `editable` for the live draft, `archived` for a published version. **name** `string` Display name at this version. **description** `string | null` Description at this version. **systemPromptMd** `string` The system prompt. Empty string when none was set. **promptMd** `string` The extraction prompt. **outputSchema** `object` The value schema the extractor produces: a `kind` of `boolean`, `string`, `number`, `enum`, `array`, or `object` plus kind-specific fields. See [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors) for the full shape. **inferenceConfig** `object` `modelProfileKey` (a `key` from [Get Model Profile Catalog](/api-v2/get/agents-id-dispositions-model-profile-catalog)), `contextSources` (the evidence the extractor reads), and, when set, `temperature`, `maxOutputTokens`, and `thinking`. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **data.activeVersion** `object | null` The most recently published version, with the same fields as `data.currentVersion` and `state` set to `archived`. `null` if the extractor has never been published. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "extractor": { "id": "7710509b-1646-4217-95e5-82b2e92d7b93", "agentId": null, "key": "appointment_outcome", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "currentVersionId": "67d05bb3-2b38-4073-b90e-342bbd391e3a", "activeVersionId": "bc65dd77-dfe5-4a56-b830-0463efc66d35", "draftRevision": 2, "createdAt": "2026-09-01T15:02:11.480Z", "updatedAt": "2026-09-09T18:44:03.117Z" }, "currentVersion": { "id": "67d05bb3-2b38-4073-b90e-342bbd391e3a", "extractorId": "7710509b-1646-4217-95e5-82b2e92d7b93", "versionNumber": 2, "state": "editable", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "systemPromptMd": "", "promptMd": "Decide whether the caller booked, rescheduled, or declined an appointment. Return unclear if the call ended before a decision.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inferenceConfig": { "modelProfileKey": "balanced", "thinking": "low", "contextSources": ["transcript", "call_metadata"] }, "createdAt": "2026-09-09T18:44:03.117Z", "updatedAt": "2026-09-09T18:44:03.117Z" }, "activeVersion": { "id": "bc65dd77-dfe5-4a56-b830-0463efc66d35", "extractorId": "7710509b-1646-4217-95e5-82b2e92d7b93", "versionNumber": 1, "state": "archived", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "systemPromptMd": "", "promptMd": "Decide whether the caller booked, rescheduled, or declined an appointment. Return unclear if the call ended before a decision.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inferenceConfig": { "modelProfileKey": "balanced", "thinking": "low", "contextSources": ["transcript", "call_metadata"] }, "createdAt": "2026-09-01T15:02:11.480Z", "updatedAt": "2026-09-09T18:44:03.117Z" } }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition extractor not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Disposition Extractor Version Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-extractors-extractor-id-versions-version-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors/{extractor_id}/versions/{version_id} Retrieve one version of an extractor. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns a single extractor version by id, whether it is the `editable` draft or an `archived` published version. Published versions are immutable, so this is the exact prompt and schema a disposition runs when it pins that version. Version ids come from `currentVersionId` and `activeVersionId` on [Get Disposition Extractor](/api-v2/get/agents-id-dispositions-extractors-extractor-id) and from `extractorVersionId` on [Get Extractor Catalog](/api-v2/get/agents-id-dispositions-extractor-catalog). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. **extractor\_id** `string` *required* The extractor's unique identifier. Must be organization-wide or scoped to this agent; otherwise returns `404` with the message `Disposition extractor not found`. A malformed id returns `400` with the message `extractorId must be a valid UUID`. **version\_id** `string` *required* The version's unique identifier. Must belong to `extractor_id`; otherwise returns `404` with the message `Disposition extractor version not found`. A malformed id returns `400` with the message `versionId must be a valid UUID`. ### Response **data** `object` The extractor version. **version object** **id** `string` Unique identifier for the version. **extractorId** `string` The extractor this version belongs to. **versionNumber** `integer` Starts at `1` and increments on each publish. **state** `string` `editable` for the live draft, `archived` for a published version. **name** `string` Display name at this version. **description** `string | null` Description at this version. **systemPromptMd** `string` The system prompt. Empty string when none was set. **promptMd** `string` The extraction prompt. **outputSchema** `object` The value schema the extractor produces: a `kind` of `boolean`, `string`, `number`, `enum`, `array`, or `object` plus kind-specific fields. See [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors) for the full shape. **inferenceConfig** `object` `modelProfileKey` (a `key` from [Get Model Profile Catalog](/api-v2/get/agents-id-dispositions-model-profile-catalog)), `contextSources` (the evidence the extractor reads), and, when set, `temperature`, `maxOutputTokens`, and `thinking`. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "5d807088-411f-42b4-8193-a66f1949cd90", "extractorId": "4edf5644-178b-4d7d-a434-a1b61beb3127", "versionNumber": 1, "state": "archived", "name": "Callback window", "description": "When the caller asked to be called back.", "systemPromptMd": "You extract scheduling details from customer service calls.", "promptMd": "Find the day and time window the caller asked for a callback. Leave fields empty if the caller did not ask for one.", "outputSchema": { "kind": "object", "properties": { "requested": { "kind": "boolean", "description": "Whether the caller asked for a callback." }, "window_start": { "kind": "string", "format": "date-time" }, "window_end": { "kind": "string", "format": "date-time" } }, "required": ["requested"] }, "inferenceConfig": { "modelProfileKey": "high_accuracy", "temperature": 0, "maxOutputTokens": 600, "thinking": "medium", "contextSources": ["transcript"] }, "createdAt": "2026-09-03T09:12:50.004Z", "updatedAt": "2026-09-05T14:30:22.671Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition extractor version not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Judge Catalog Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-judge-catalog GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/judge-catalog List the judges a disposition can pin for this agent. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. A judge is an evaluation rubric applied to call evidence; a disposition value pins a published judge version and records the level it selects. Returns the judges this agent can pin, organization-wide judges plus judges scoped to this agent, limited to those with a published version, ordered by name. Read the full rubric with [Get Judge Version](/api-v2/get/agents-id-dispositions-judges-judge-id-versions-version-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Response **data.judges** `array` Array of judge catalog entries. Empty when no judge has a published version. **judge entry** **judgeId** `string` Unique identifier for the judge. **judgeVersionId** `string` The published version a disposition pins. Use it together with `judgeId` in a disposition value's `judge` source. **key** `string` Stable machine key, unique within your organization. **name** `string` The judge's display name. **description** `string | null` Optional description. **modality** `string` `text` when the judge reads the transcript, `audio` when it listens to the call recording. Audio judges require a recording to run. **levelKeys** `array` The rubric's outcome levels, in rubric order. The judge selects one of them per call, or none when the evidence is insufficient. **targetLevelKeys** `array` The subset of `levelKeys` the judge treats as a target (passing) outcome. Empty for a rubric with no target. **scopedToAgent** `boolean` `true` when the judge is scoped to this agent, `false` when it is organization-wide. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "judges": [ { "judgeId": "3cab912a-0103-42b1-8c58-019f7697701f", "judgeVersionId": "5888ae45-6a6e-4eb2-97ec-7ae44103b0bf", "key": "caller_sentiment", "name": "Caller sentiment", "description": "How the caller felt by the end of the conversation.", "modality": "text", "levelKeys": ["positive", "neutral", "negative"], "targetLevelKeys": ["positive", "neutral"], "scopedToAgent": false }, { "judgeId": "abf6b6e2-e981-4ce5-905e-4eecb5c48ba8", "judgeVersionId": "69d7f2a9-ad92-4176-b0da-f46e481ab355", "key": "greeting_compliance", "name": "Greeting compliance", "description": null, "modality": "audio", "levelKeys": ["pass", "fail"], "targetLevelKeys": ["pass"], "scopedToAgent": true } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Judge Version Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-judges-judge-id-versions-version-id GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/judges/{judge_id}/versions/{version_id} Retrieve one version of a judge's rubric. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. A judge is an evaluation rubric applied to call evidence. Returns one version of a judge's rubric: its prompts and the levels it can select, with each level flagged as a target or not. Any version of the judge can be read, but a disposition can only pin the published `judgeVersionId` listed by [Get Judge Catalog](/api-v2/get/agents-id-dispositions-judge-catalog). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. **judge\_id** `string` *required* The judge's unique identifier. Must be organization-wide or scoped to this agent; otherwise returns `404` with the message `Judge not found`. A malformed id returns `400` with the message `judgeId must be a valid UUID`. **version\_id** `string` *required* The version's unique identifier. Must belong to `judge_id`; otherwise returns `404` with the message `Judge version not found`. A malformed id returns `400` with the message `versionId must be a valid UUID`. ### Response **data** `object` The judge version. **judge version object** **id** `string` Unique identifier for the version. **judgeId** `string` The judge this version belongs to. **versionNumber** `integer` Sequential version number within the judge. **name** `string` Display name at this version. **description** `string | null` Description at this version. **modality** `string` `text` when the judge reads the transcript, `audio` when it listens to the call recording. **systemPromptMd** `string` The rubric's system prompt in Markdown. May be empty. **promptMd** `string` The rubric's task prompt in Markdown. May be empty on an unpublished draft. **levels** `array` The outcome levels the judge chooses from, in rubric order. Each has `key` (the level's stable key), `label` (display name), `promptMd` (the criteria for selecting this level), and `target` (`true` when this level counts as a passing outcome). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "4420749d-ff1a-4edd-ad8a-4b61f2ae963a", "judgeId": "cfd538c3-507f-4976-90f4-db92369ee48b", "versionNumber": 2, "name": "Caller sentiment", "description": "How the caller felt by the end of the conversation.", "modality": "text", "systemPromptMd": "You review customer service transcripts and classify the caller's closing sentiment.", "promptMd": "Read the full transcript. Pick the level that best describes how the caller felt in the final third of the call.", "levels": [ { "key": "positive", "label": "Positive", "promptMd": "The caller thanks the agent, confirms the issue is resolved, or sounds pleased.", "target": true }, { "key": "neutral", "label": "Neutral", "promptMd": "The caller is matter-of-fact with no clear positive or negative signal.", "target": true }, { "key": "negative", "label": "Negative", "promptMd": "The caller expresses frustration, threatens to cancel, or hangs up mid-sentence.", "target": false } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Judge version not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Model Profile Catalog Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-model-profile-catalog GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/model-profile-catalog List the model profiles available to extractors. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Returns the model profiles an extractor's `inferenceConfig.modelProfileKey` may name. A profile is an opaque handle for a quality, latency, and cost trade-off; only profiles currently available for structured extraction are listed. Use a profile's `key` in [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors) or [Update Disposition Extractor Draft](/api-v2/patch/agents-id-dispositions-extractors-extractor-id-draft). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Response **data.profiles** `array` Array of model profile entries. **profile entry** **key** `string` The value to pass as `modelProfileKey`. `balanced` is the default when an extractor omits the key. **label** `string` Human-readable name for the profile. **description** `string` One sentence on when to choose this profile. **supportsAudio** `boolean` `true` when an extractor using this profile may include `audio_recording` in `contextSources`. Profiles with `false` reject that source with a `400`. **supportsBatch** `boolean` Reserved. Currently always `false`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "profiles": [ { "key": "balanced", "label": "Balanced", "description": "Recommended quality, latency, and cost for most calls.", "supportsAudio": true, "supportsBatch": false }, { "key": "fast", "label": "Fast", "description": "Lower latency for straightforward text extraction.", "supportsAudio": false, "supportsBatch": false }, { "key": "high_accuracy", "label": "High accuracy", "description": "More reasoning for complex text extraction.", "supportsAudio": false, "supportsBatch": false } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Variable Catalog Source: https://docs.bland.ai/api-v2/get/agents-id-dispositions-variable-catalog GET https://api.bland.ai/v2/agents/{agent_id}/dispositions/variable-catalog List the agent variables a disposition can re-extract. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Lists the variables the agent extracts during calls that a disposition value can re-extract from the corrected post-call transcript, read from the agent's most recently saved version. Only `string`, `number`, and `boolean` variables are included; `json` variables, and variables defined with conflicting prompts or types in different scenarios, are omitted. Entries are sorted by `key`, and the list is empty if the agent has no saved version. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Response **data** `array` Array of variable catalog entries. **variable entry** **key** `string` The variable name as defined on the agent. Use it as `variableKey` in a disposition value's `variable_extraction` source. **prompt** `string` The extraction prompt configured on the agent, trimmed. Empty string when the variable has no prompt. **accurateSpelling** `boolean` `true` when the variable is configured for exact character-by-character spelling. **outputSchema** `object` The schema a disposition value should use for this variable. `kind` mirrors the variable's type (`string`, `number`, or `boolean`). `description` is the prompt, with the sentence `Preserve exact character-by-character spelling.` appended when `accurateSpelling` is `true`; it is omitted when both are empty. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "key": "callback_number", "prompt": "The phone number the caller wants us to call back.", "accurateSpelling": true, "outputSchema": { "kind": "string", "description": "The phone number the caller wants us to call back. Preserve exact character-by-character spelling." } }, { "key": "party_size", "prompt": "How many people the reservation is for.", "accurateSpelling": false, "outputSchema": { "kind": "number", "description": "How many people the reservation is for." } }, { "key": "wants_followup", "prompt": "Whether the caller asked for a follow-up call.", "accurateSpelling": false, "outputSchema": { "kind": "boolean", "description": "Whether the caller asked for a follow-up call." } } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agent Environments Source: https://docs.bland.ai/api-v2/get/agents-id-environments GET https://api.bland.ai/v2/agents/{agent_id}/environments List an agent's environments with their pinned versions. ### Overview Returns the agent's `dev`, `staging`, and `production` environments, each with the name and semver of the version it is pinned to. `dev` is never pinned: it always runs the newest saved version. Move the `staging` pointer with [Publish Agent to Staging](/api-v2/post/agents-id-publish) and the `production` pointer with [Promote Agent to Production](/api-v2/post/agents-id-promote) or [Roll Back Agent](/api-v2/post/agents-id-rollback). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data** `array` The agent's three environments. **environment object** **id** `string` Unique identifier for the environment. **env\_type** `string` One of `dev`, `staging`, `production`. **current\_version\_id** `string | null` ID of the version this environment is pinned to. `null` when unpinned. Always `null` for `dev`. **current\_version** `object | null` Details of the pinned version, or `null` when unpinned. Contains `name` (the version's saved name, or `null` if it was never named) and `semver` (the version number minted when it was first published, or `null` if it has never been published). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "3f16480d-528f-4861-9e23-c2f40ceaf895", "env_type": "dev", "current_version_id": null, "current_version": null }, { "id": "2d2740be-28ce-4a2b-bcfc-9ad947bb9faa", "env_type": "staging", "current_version_id": "54bc3ac6-7481-429f-8995-e7b119cf3b06", "current_version": { "name": "Holiday hours", "semver": "1.4.0" } }, { "id": "bf884f61-5034-48b4-9a2e-2f38fd0af537", "env_type": "production", "current_version_id": "7a971ff5-3ff8-41bd-a21e-fc3e3537cb6b", "current_version": { "name": null, "semver": "1.3.2" } } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Checks Source: https://docs.bland.ai/api-v2/get/agents-id-environments-env-checks GET https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/checks Retrieve an environment's check config. ### Overview Returns the judges and test scenarios configured as pre-promotion checks for one environment, or `null` when none are configured. Set the config with [Set Checks](/api-v2/put/agents-id-environments-env-checks) and run it with [Start Check Run](/api-v2/post/agents-id-environments-env-check-runs). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* `staging` or `production`. Checks do not attach to `dev`. Any other value returns `400 BAD_REQUEST`. ### Response **data** `object | null` The environment's check config, or `null` when no checks are configured. **check config object** **id** `string` Unique identifier for the check config. **agent\_id** `string` The agent the config belongs to. **env\_type** `string` The environment the config gates: `staging` or `production`. **enabled** `boolean` Whether check runs can be started for this environment. A disabled config is kept but cannot be run. **scenario\_ids** `array` IDs of the agent's test scenarios that each run drives conversations from. **scenario\_names** `array` Display names for `scenario_ids`, in the same order. Falls back to the ID when a scenario's name cannot be resolved. **simulations\_count** `integer` Conversations generated per scenario on each run. **evals** `array` The judges attached to the config. See `data.evals` below. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of the last update. **data.evals** `array` One entry per judge, in the order they were attached. **eval object** **eval\_agent\_id** `string` The judge's unique identifier. **eval\_agent\_version\_id** `string` The judge version pinned when the config was saved. **name** `string` The judge's display name. Omitted when the name cannot be resolved. **target\_level\_keys** `array` The grade levels counted as passing. Empty for pass/fail judges. **required** `boolean` `true` when a failing verdict from this judge fails the run. `false` makes the judge informational only. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "a9803aa7-4185-42d8-91ed-6e20acaaf00c", "agent_id": "73237018-be24-4b18-a511-15229010ed10", "env_type": "production", "enabled": true, "scenario_ids": [ "96f9f8b4-8bef-4a6a-9678-1eb5f6b9d368", "b1e42393-9f35-42b1-b60b-26910da451fc" ], "scenario_names": [ "Reschedule an appointment", "Caller asks for a human" ], "simulations_count": 5, "evals": [ { "eval_agent_id": "61085de3-2ec3-404e-92f4-58b49a5c54b0", "eval_agent_version_id": "88546c14-d434-4c41-b376-e35f123bd7c8", "name": "Resolution quality", "target_level_keys": ["good", "excellent"], "required": true }, { "eval_agent_id": "0284f93e-1d87-46eb-8e4d-8a774b78fa1e", "eval_agent_version_id": "242a6ae3-ae74-4088-b878-63aecdc50717", "name": "No policy violations", "target_level_keys": [], "required": false } ], "created_at": "2026-09-08T16:20:11.402Z", "updated_at": "2026-09-10T09:05:47.918Z" }, "errors": null } ``` ```json No Config theme={null} { "data": null, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agent Variables Source: https://docs.bland.ai/api-v2/get/agents-id-environments-env-variables GET https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/variables List an environment's variables for an agent. ### Overview Returns the variables stored for one of the agent's environments, sorted by key. Agent configuration refers to a variable as `{{env.KEY}}`, and the environment a call runs as decides which set is substituted: `production` for normal calls, `staging` when calling the staging pin, and `dev` for dev, branch, or specific-version calls. Set values with [Set Agent Variable](/api-v2/put/agents-id-environments-env-variables-key). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* One of `dev`, `staging`, `production`. Any other value returns `400 INVALID_ENV`. ### Response **data** `array` Array of variable objects ordered by `variable_key` ascending. Empty when the environment has no variables. **variable object** **variable\_key** `string` The variable's key, as referenced by `{{env.KEY}}`. **value** `any` The stored value: any JSON value. For a variable saved with `is_secret`, this is the `{{SECRET.NAME}}` reference the server stored in place of the raw value; the secret itself is never returned. **updated\_at** `string` ISO 8601 timestamp of the last write. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "variable_key": "CRM_API_KEY", "value": "{{SECRET.AGENT_8ffa3e15_b4fc_485d_b6cf_bded7a6ee070_PRODUCTION_43524d5f4150495f4b4559}}", "updated_at": "2026-09-09T20:14:33.602Z" }, { "variable_key": "CRM_BASE_URL", "value": "https://crm.example.com/api", "updated_at": "2026-09-09T20:13:58.117Z" }, { "variable_key": "OFFICE_HOURS", "value": { "open": "08:00", "close": "17:30", "timezone": "America/Chicago" }, "updated_at": "2026-09-10T11:47:05.940Z" } ], "errors": null } ``` ```json Invalid Env theme={null} { "data": null, "errors": [ { "error": "INVALID_ENV", "message": "env must be one of: dev, staging, production" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Experiments Source: https://docs.bland.ai/api-v2/get/agents-id-experiments GET https://api.bland.ai/v2/agents/{agent_id}/experiments List an agent's experiments, newest first. ### Overview Returns every experiment on the agent, active and completed, newest first. At most one is `active`. An active experiment whose `ends_at` has passed is completed with `date_ended` before it is returned, so the list never reports a stale active experiment. For a single experiment with its live progress, use [Get Experiment](/api-v2/get/agents-id-experiments-experiment-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.experiments** `array` Array of experiment objects, newest first. **experiment object** **id** `string` Unique identifier for the experiment. **agent\_id** `string` The agent the experiment belongs to. **status** `string` `active` or `completed`. Completion is terminal. **completed\_reason** `string | null` `null` while active. On completion, one of `manual` (stopped through the API), `date_ended`, `quota_reached`, or `baseline_changed` (the baseline environment was repointed). **baseline\_env** `string` The control environment: `production` or `staging`. **baseline\_current\_version\_id** `string | null` The version currently pinned to `baseline_env`, read at request time. For a completed experiment this may no longer be the version it ran against. **variant\_version\_id** `string` The version under test. **traffic\_percentage** `integer` Share of eligible calls routed to the variant, `1` to `100`. **run\_hours** `object | null` Weekly schedule (`timezone` plus per-day `{ start, end }` windows) during which the variant receives traffic, or `null` when always eligible. **starts\_at** `string | null` When variant traffic begins, or `null` for immediately. **ends\_at** `string | null` When the experiment completes on its own, or `null` for no end date. **variant\_call\_quota** `integer | null` Maximum connected variant calls, or `null` for no cap. **variant\_calls\_routed** `integer` Connected calls routed to the variant. Live while active, frozen at completion. **created\_by** `string | null` ID of the user who created the experiment, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **completed\_at** `string | null` ISO 8601 timestamp of completion, or `null` while active. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "experiments": [ { "id": "90384992-15ea-43bb-9656-fa76b5f15bc8", "agent_id": "ee8fcf53-b284-4356-8942-63445fd42b7e", "status": "active", "completed_reason": null, "baseline_env": "production", "baseline_current_version_id": "b062d11d-7da4-4560-aad8-9f494e945fbb", "variant_version_id": "7350f8e0-8b2e-40d5-9365-34318282afdc", "traffic_percentage": 10, "run_hours": null, "starts_at": null, "ends_at": null, "variant_call_quota": null, "variant_calls_routed": 137, "created_by": "4cabf114-62e5-4cc4-a676-8890d0c19173", "created_at": "2026-09-09T08:30:12.640Z", "completed_at": null }, { "id": "de11a8bf-3222-4dca-bbfb-e0ad5e8927fa", "agent_id": "ee8fcf53-b284-4356-8942-63445fd42b7e", "status": "completed", "completed_reason": "baseline_changed", "baseline_env": "production", "baseline_current_version_id": "b062d11d-7da4-4560-aad8-9f494e945fbb", "variant_version_id": "9a838897-bb5c-4131-9db3-3e24fca4603e", "traffic_percentage": 25, "run_hours": null, "starts_at": null, "ends_at": "2026-09-15T00:00:00.000Z", "variant_call_quota": 1000, "variant_calls_routed": 412, "created_by": "4cabf114-62e5-4cc4-a676-8890d0c19173", "created_at": "2026-08-28T13:02:51.115Z", "completed_at": "2026-09-08T17:45:09.882Z" } ] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Experiment Source: https://docs.bland.ai/api-v2/get/agents-id-experiments-experiment-id GET https://api.bland.ai/v2/agents/{agent_id}/experiments/{experiment_id} Retrieve one experiment and its live progress. ### Overview Returns one experiment. For an active experiment, `variant_calls_routed` is the live count of connected variant calls, so poll this endpoint to track progress toward `variant_call_quota`. An active experiment whose `ends_at` has passed is completed with `date_ended` before it is returned. Use [List Experiments](/api-v2/get/agents-id-experiments) to find experiment IDs. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **experiment\_id** `string` *required* The experiment's unique identifier. Must be a valid UUID; returns `400 BAD_REQUEST` otherwise. ### Response **data.experiment** `object` The experiment. **experiment object** **id** `string` Unique identifier for the experiment. **agent\_id** `string` The agent the experiment belongs to. **status** `string` `active` or `completed`. Completion is terminal. **completed\_reason** `string | null` `null` while active. On completion, one of `manual` (stopped through the API), `date_ended`, `quota_reached`, or `baseline_changed` (the baseline environment was repointed). **baseline\_env** `string` The control environment: `production` or `staging`. **baseline\_current\_version\_id** `string | null` The version currently pinned to `baseline_env`, read at request time. While the experiment is active this is the control arm; for a completed experiment it may no longer be the version it ran against. **variant\_version\_id** `string` The version under test. **traffic\_percentage** `integer` Share of eligible calls routed to the variant, `1` to `100`. **run\_hours** `object | null` Weekly schedule during which the variant receives traffic, or `null` when always eligible. `timezone` is an IANA name; `days` maps `mon` through `sun` to `{ "start": "HH:mm", "end": "HH:mm" }` windows in that timezone. A window whose `end` is earlier than its `start` wraps past midnight. **starts\_at** `string | null` When variant traffic begins, or `null` for immediately. **ends\_at** `string | null` When the experiment completes on its own, or `null` for no end date. **variant\_call\_quota** `integer | null` Maximum connected variant calls, or `null` for no cap. **variant\_calls\_routed** `integer` Connected calls routed to the variant. Live while active, frozen at completion. **created\_by** `string | null` ID of the user who created the experiment, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **completed\_at** `string | null` ISO 8601 timestamp of completion, or `null` while active. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "experiment": { "id": "49ed2bc3-e876-4ac2-8893-fa56eeed1982", "agent_id": "abb3f6e7-663d-4afd-8006-2e46480af324", "status": "active", "completed_reason": null, "baseline_env": "production", "baseline_current_version_id": "99ab6abb-fbf4-4cf8-b837-23534442ae13", "variant_version_id": "5dcfc5e9-f339-437f-b7d5-7316c27fa223", "traffic_percentage": 30, "run_hours": { "timezone": "Europe/London", "days": { "mon": { "start": "08:30", "end": "18:00" }, "tue": { "start": "08:30", "end": "18:00" }, "wed": { "start": "08:30", "end": "18:00" }, "thu": { "start": "08:30", "end": "18:00" }, "fri": { "start": "08:30", "end": "18:00" } } }, "starts_at": "2026-09-07T07:30:00.000Z", "ends_at": "2026-09-30T17:00:00.000Z", "variant_call_quota": 750, "variant_calls_routed": 262, "created_by": "9acd611b-dd69-4675-864d-a26e19e7e468", "created_at": "2026-09-05T16:11:27.043Z", "completed_at": null } }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Experiment not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Agent Identity Source: https://docs.bland.ai/api-v2/get/agents-id-identity GET https://api.bland.ai/v2/agents/{agent_id}/identity Read the agent's branded contact card and its delivery settings. ### Overview Returns the agent's identity: the display fields a recipient sees, the generated contact card, the numbers bound to the agent, and the delivery toggles. An agent that has never been given an identity gets one on first read, seeded with the agent's name as `display_name` and the remaining fields empty. Signed URLs in the response are short lived, about an hour. Read the identity again for fresh ones rather than storing them. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.id** `string` Unique identifier for the identity record. Distinct from the agent ID. **data.org\_id** `string` The organization that owns the agent. **data.agent\_id** `string` The agent the identity belongs to. **data.display\_name** `string` The name shown to the recipient. Seeded from the agent's name on first read. **data.tagline** `string` Short line describing the agent. Empty string when unset. **data.support\_email** `string` Contact email on the card. Empty string when unset. **data.website** `string` Website on the card. Empty string when unset. **data.address** `string` Postal address on the card. Empty string when unset. **data.logo\_file\_id** `string | null` ID of the stored logo, or `null` when no logo has been uploaded. **data.vcf\_file\_id** `string | null` ID of the generated contact card file. Rebuilt whenever a card field changes, so this value moves after an update. **data.vcf\_delivery\_enabled** `boolean` Whether the contact card is delivered automatically. Defaults to `false`. **data.rcs\_enabled** `boolean` Whether rich messaging is allowed for this agent. Defaults to `true`. **data.bcid\_enabled** `boolean` Whether verified caller display is switched on for this agent. **data.bcid\_status** `string` Registration state of the verified caller display: `not_submitted`, `submitted`, `pending_review`, `approved`, or `rejected`. **data.bcid\_submission** `object | null` The stored registration payload, or `null` when nothing has been submitted. **data.phone\_numbers** `string[]` The agent's bound numbers in E.164, as returned by [Get Agent Inbound Numbers](/api-v2/get/agents-id-inbound). Empty when no number is attached. **data.logo\_url** `string | null` Short-lived signed URL for the logo, or `null` when there is no logo. **data.vcf\_url** `string | null` Short-lived signed URL for the contact card file, or `null` when none exists. **data.created\_at** `string` ISO 8601 timestamp of when the identity was created. **data.updated\_at** `string` ISO 8601 timestamp of the last change. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "b88c3ce2-54d4-406c-bd21-733c61556151", "org_id": "4bb834b5-8e95-487a-908d-d712a201008c", "agent_id": "ec74c83e-5370-450b-9aa0-59757ec25a81", "display_name": "Northwind Dental", "tagline": "Front desk", "support_email": "help@northwind.example", "website": "https://northwind.example", "address": "", "logo_file_id": "5db9aecc-5013-4f97-8592-b0330617a6d0", "vcf_file_id": "29be0d69-898a-41a2-b875-5aeaae7fbd23", "vcf_delivery_enabled": false, "rcs_enabled": true, "bcid_enabled": false, "bcid_status": "not_submitted", "bcid_submission": null, "phone_numbers": ["+18005551234"], "logo_url": "https://files.bland.ai/agent-identity/5db9aecc-5013-4f97-8592-b0330617a6d0?signature=...", "vcf_url": "https://files.bland.ai/agent-identity/29be0d69-898a-41a2-b875-5aeaae7fbd23?signature=...", "created_at": "2026-09-15T05:08:35.092Z", "updated_at": "2026-09-15T05:08:44.301Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Download Agent Contact Card Source: https://docs.bland.ai/api-v2/get/agents-id-identity-contact-card GET https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card.vcf Download the agent's contact card as a vCard file. ### Overview Returns the agent's contact card as a vCard file rather than JSON, built from the identity fields. Recipients can save it to their contacts so the agent's name and logo appear when it calls. The response is `text/vcard; charset=utf-8` with a `Content-Disposition` attachment header naming the file after the display name, for example `northwind-dental.vcf`. Because the body is not JSON, it does not use the `data` and `errors` envelope on success. Errors still do. The card is regenerated whenever an identity field changes, so this endpoint always reflects the current identity. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response Returns `200` with the vCard as the raw body. **Content-Type** `string` Always `text/vcard; charset=utf-8`. **Content-Disposition** `string` `attachment` with a filename derived from `display_name`, for example `attachment; filename="northwind-dental.vcf"`. ```text Response theme={null} BEGIN:VCARD VERSION:3.0 FN:Northwind Dental N:Northwind Dental;;;; ORG:Northwind Dental EMAIL;TYPE=WORK:help@northwind.example URL:https://northwind.example NOTE:Front desk REV:20260915T050844Z END:VCARD ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Agent Number Binding Source: https://docs.bland.ai/api-v2/get/agents-id-inbound GET https://api.bland.ai/v2/agents/{agent_id}/inbound Check which phone numbers are attached to an agent and whether each one answers on the production or staging environment. ### Overview Returns the agent's inbound number binding. `persona_id` is `null` until the first successful [Attach Numbers to Agent](/api-v2/post/agents-id-inbound-attach) call. `numbers` lists the numbers attached to the agent and the environment each one answers on. An unknown agent ID returns `persona_id: null` rather than `404`. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.agent\_id** `string` The agent ID from the request path, echoed back. **data.persona\_id** `string | null` ID of the persona that attached numbers route through. Bland creates it on the first attach and keeps it afterwards, so it stays set even after every number is detached. `null` if numbers have never been attached to this agent. **data.numbers** `array` The numbers attached to the agent, newest first. Empty when no number is attached. **properties** **phone\_number** `string` The attached phone number. **agent\_env\_type** `string | null` `staging` when calls to the number run the staging version. `null` when they run production. **data.staging\_attach\_supported** `boolean` `false` when your account runs on dedicated infrastructure, where numbers can't be attached to staging. Attaching to staging also requires an enterprise plan, which this field does not check. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "agent_id": "680817f5-147a-4e7f-9d25-eac973e693a5", "persona_id": "a308a95d-854d-435a-ae2a-b3d113b59054", "numbers": [ { "phone_number": "+18005551234", "agent_env_type": "staging" }, { "phone_number": "+18005556789", "agent_env_type": null } ], "staging_attach_supported": true }, "errors": null } ``` ```json No Binding theme={null} { "data": { "agent_id": "818cab80-86c9-46fc-93d8-a7f548b18d7e", "persona_id": null, "numbers": [], "staging_attach_supported": true }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Agent Memory Schema Source: https://docs.bland.ai/api-v2/get/agents-id-memory-schema GET https://api.bland.ai/v2/agents/{agent_id}/memory/schema Read what the agent remembers about each contact between calls. ### 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, and `source` 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](/api-v2/post/agents-id-memory-schema-infer). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.entity\_schemas** `array` The entity types the agent tracks per contact. Empty when nothing is known yet. **entity schema object** **entity\_type** `string` Name of the entity, for example `trip`, `order`, or `quote`. **description** `string` What this entity represents. **identifier\_field** `string` The field used to tell one instance from another, for example `confirmation_number`. **fields** `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`. **status\_field** `string` Which field tracks the entity's lifecycle. Present only when one is set. **outcomes** `array` Possible end states for this entity. Present only when any are set. **metadata** `object` Extra context about the entity type. Present only when set. **data.source** `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. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "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 } ``` ```json Nothing Known Yet theme={null} { "data": { "entity_schemas": [], "source": null }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Scenario History Source: https://docs.bland.ai/api-v2/get/agents-id-scenarios-node-id-history GET https://api.bland.ai/v2/agents/{agent_id}/scenarios/{node_id}/history List how one scenario changed across saved versions. ### Overview Walks the agent's saved versions, newest first, and returns the scenario node's saved content at each one, 25 versions per page, alongside the node as currently pinned in `staging` and `production`. Works for `scenario`, `complex-scenario`, `auth`, `auth-zone`, and `complex-auth` nodes, and for the agent's hub prompt by passing `agent` as the `node_id`. Node content is returned as stored, so older versions may carry fields the editor no longer writes. To read a whole version instead, use [Get Latest Agent Version](/api-v2/get/agents-id-versions-latest). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise the request returns `400 BAD_REQUEST`. **node\_id** `string` *required* The scenario node's `id` within its flow. 1 to 200 characters and not blank. Pass the literal value `agent` to read the agent's hub prompt instead of a scenario; the hub lives in the root flow, so `path` must be omitted or empty for that value. ### Query Parameters **branch** `string` An open branch's ID (UUID). Lists that branch's own saves followed by the dev version it was cut from. Returns `404 NOT_FOUND` if the branch is not open or does not belong to this agent. Omit to read the dev timeline. **path** `string` (default: \[]) JSON-encoded array of container node IDs leading from the root flow to the flow that holds `node_id`, outermost first, for example `["76c53696-04da-4dfa-be12-ebd286070549"]`. At most 10 IDs of 1 to 200 characters each, and the raw string may not exceed 12,500 characters. Omit for a node in the root flow. Malformed values return `400 BAD_REQUEST`. **before** `string` Pagination cursor: the `next_cursor` from the previous page (a version ID). Returns the versions saved before it. A cursor that is not in the requested timeline returns `400 BAD_REQUEST`. ### Response **data.versions** `array` Up to 25 versions, newest first. **version entry** **id** `string` The version's unique identifier. **name** `string | null` The version's display name, or `null` if none was given. **created\_at** `string` ISO 8601 timestamp of the save. **author** `string | null` Display name of the user who saved the version, or `null` when saved with an org-level key or the name is unavailable. **node** `object | null` The scenario as saved in that version: its `type` and full `data` object (for example `name`, `rule`, `target`, `loopWhile`, `variables`, `entry`, and for container types `flow`). For `node_id` `agent` the `type` is `agent` and `data` carries the hub's `prompt`, `variables`, and `tools`, with no `name` field, since the agent's name lives on the agent record. `null` when the node did not exist at that path in that version. **data.next\_cursor** `string | null` Pass as `before` to fetch the next page. `null` when there are no older versions. **data.environments** `array` Always two entries, one for `staging` and one for `production`, independent of the requested page. **environment entry** **env** `string` `staging` or `production`. **node** `object | null` The scenario as it exists in the version that environment is pinned to, in the same shape as `versions[].node`. `null` when the environment is unpinned or the node is absent from the pinned version. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "versions": [ { "id": "279d679d-20e6-4dac-976b-c7d23dc7449e", "name": null, "created_at": "2026-09-10T23:41:07.902Z", "author": "Dana Whitfield", "node": { "type": "scenario", "data": { "name": "Book appointment", "rule": "Collect the caller's preferred date and time, offer the nearest open slot, then confirm the booking.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [ { "id": "4313aace-ade6-4f67-832e-d7646b5c62c1", "key": "preferred_date", "value": "The date the caller asked for, in YYYY-MM-DD format.", "type": "string", "accurateSpelling": false } ], "entry": { "mode": "llm", "label": "Caller wants to book", "description": "", "alwaysPick": false, "conditions": [] } } } }, { "id": "a2a07641-cf05-46fd-ac9b-4e974f2f058c", "name": "Adds booking flow", "created_at": "2026-09-10T23:02:11.418Z", "author": "Dana Whitfield", "node": { "type": "scenario", "data": { "name": "Book appointment", "rule": "Collect the caller's preferred date and time, then confirm the booking.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Caller wants to book", "description": "", "alwaysPick": false, "conditions": [] } } } } ], "next_cursor": null, "environments": [ { "env": "staging", "node": { "type": "scenario", "data": { "name": "Book appointment", "rule": "Collect the caller's preferred date and time, then confirm the booking.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Caller wants to book", "description": "", "alwaysPick": false, "conditions": [] } } } }, { "env": "production", "node": null } ] }, "errors": null } ``` ```json Bad Request theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "path must be a JSON array of at most 10 node IDs" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Agent Versions Source: https://docs.bland.ai/api-v2/get/agents-id-versions GET https://api.bland.ai/v2/agents/{agent_id}/versions List an agent's saved versions, newest first. ### Overview Returns version metadata for the agent's dev timeline, or for one branch's own saves when `branch` is set, ordered by `created_at` descending. Snapshots are omitted because they can be large; read one with [Get Latest Agent Version](/api-v2/get/agents-id-versions-latest) or, for a published version, [Get Agent Version](/api-v2/get/agents-id-versions-semver). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Query Parameters **limit** `integer` (default: 50) Maximum number of versions to return. Minimum `1`, maximum `200`. Values outside that range are clamped; a non-numeric value falls back to the default. **branch** `string` A branch ID. When set, only that branch's own saves are listed (its base version is not included). When omitted, only dev-timeline versions are listed and branch saves are excluded. An unknown branch ID returns an empty array. ### Response **data** `array` Array of version metadata objects. **version metadata object** **id** `string` Unique identifier for the version. **agent\_id** `string` The agent this version belongs to. **name** `string | null` The version's display name, or `null` if none was given. **created\_via** `string` `manual` or `autosave`. **created\_by** `string | null` ID of the user who saved the version, or `null` when saved with an org-level key. **created\_at** `string` ISO 8601 timestamp of the save. **semver** `string | null` The semantic version minted when this version was first published (for example `1.2.0`), or `null` if it has never been published. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "93fcf9e7-a820-4355-a36b-266f0c0ad2f4", "agent_id": "475fd530-91f5-4fcf-8743-ab55966a7f86", "name": null, "created_via": "autosave", "created_by": "cefd689f-49e5-4ce7-ac04-393976a57961", "created_at": "2026-09-10T23:41:07.902Z", "semver": null }, { "id": "b33360ee-7e59-46bb-a68a-d79102d1c9a0", "agent_id": "475fd530-91f5-4fcf-8743-ab55966a7f86", "name": "Adds booking flow", "created_via": "manual", "created_by": "cefd689f-49e5-4ce7-ac04-393976a57961", "created_at": "2026-09-10T23:02:11.418Z", "semver": "1.2.0" } ], "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Latest Agent Version Source: https://docs.bland.ai/api-v2/get/agents-id-versions-latest GET https://api.bland.ai/v2/agents/{agent_id}/versions/latest Retrieve the newest saved version with its full snapshot. ### Overview Returns the head of the agent's dev timeline, including the full configuration snapshot. Pass `branch` to read a branch's head instead; a branch with no saves of its own returns the version it was cut from. Use the returned `id` and `revision` as `parent_version_id` and `parent_revision` in [Create Agent Version](/api-v2/post/agents-id-versions) to save safely on top of it. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A fresh agent with no saved versions returns `404 NO_VERSIONS`. ### Query Parameters **branch** `string` An open branch's ID. Returns that branch's newest save, falling back to its base version when the branch has none. Returns `404 BRANCH_NOT_FOUND` if the branch is not open or does not belong to this agent. ### Response **data** `object` The newest version, with its snapshot. **version object** **id** `string` Unique identifier for the version. **org\_id** `string` The organization that owns the agent. **agent\_id** `string` The agent this version belongs to. **branch\_id** `string | null` The branch the version was saved onto, or `null` on the dev timeline. When `branch` falls back to the base version, this is `null` because the base lives on the dev timeline. **snapshot** `object` The saved configuration: `behavior` (the node and edge graph), `settings` (agent-wide options), `contact` (`inboundNumbers`), and `knowledge` (`kbIds`) when present. **name** `string | null` The version's display name, or `null` if none was given. **created\_via** `string` `manual` or `autosave`. **revision** `integer` Incremented each time an autosave rewrites this row in place. Send it back as `parent_revision` when saving. **created\_by** `string | null` ID of the user who saved the version, or `null` when saved with an org-level key. **created\_at** `string` ISO 8601 timestamp of the first write. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "947368cd-ea03-48e1-8d14-84f62a1be090", "org_id": "4afedeaf-2bb5-4646-91d5-cb2b8d5e6bf2", "agent_id": "9f242ae9-7d90-49df-8bd9-8450a97f1504", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "3da34a58-ddf3-4571-b060-4cfd7787a8f5", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "c0b9fdb4-62e6-4950-a099-bc24604555c1", "type": "scenario", "position": { "x": 320, "y": 0 }, "data": { "name": "Reschedule", "rule": "Find the caller's existing appointment and offer the next three open slots.", "target": { "kind": "dialogue", "label": "Reschedule" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Caller wants to move an appointment", "description": "", "alwaysPick": false, "conditions": [] } } } ], "edges": [ { "id": "74c3c224-a701-44ea-bf53-fef3f6028dc1", "source": "3da34a58-ddf3-4571-b060-4cfd7787a8f5", "target": "c0b9fdb4-62e6-4950-a099-bc24604555c1" } ] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for a dental clinic.", "languages": ["en"], "enableMemory": false, "backgroundNoise": "off" }, "contact": { "inboundNumbers": ["+14155550123"] }, "knowledge": { "kbIds": [] } }, "name": null, "created_via": "autosave", "revision": 4, "created_by": "174ee50e-166c-41ff-8aa0-7c44ebb6e832", "created_at": "2026-09-10T23:41:07.902Z" }, "errors": null } ``` ```json No Versions theme={null} { "data": null, "errors": [ { "error": "NO_VERSIONS", "message": "Agent has no versions yet" } ] } ``` ```json Branch Not Found theme={null} { "data": null, "errors": [ { "error": "BRANCH_NOT_FOUND", "message": "Branch not found" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Agent Version Source: https://docs.bland.ai/api-v2/get/agents-id-versions-semver GET https://api.bland.ai/v2/agents/{agent_id}/versions/{semver} Retrieve a published version by its semantic version. ### Overview Returns the full snapshot of a version that has been published, resolved by the semantic version minted at publish time (for example `1.2.0`). Versions that were saved but never published have no semver; read those with [Get Latest Agent Version](/api-v2/get/agents-id-versions-latest). Find semvers with [List Agent Versions](/api-v2/get/agents-id-versions) or [List Agent Deployments](/api-v2/get/agents-id-deployments). ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **semver** `string` *required* The version's semantic version in strict `MAJOR.MINOR.PATCH` form with numeric components, for example `1.2.0`. No `v` prefix and no prerelease or build suffix. Any other format returns `400 INVALID_VERSION`. A well-formed semver that was never minted for this agent returns `404 NOT_FOUND`. ### Response **data** `object` The published version, with its snapshot. **version object** **id** `string` Unique identifier for the version. **org\_id** `string` The organization that owns the agent. **agent\_id** `string` The agent this version belongs to. **branch\_id** `string | null` The branch the version was saved onto, or `null` on the dev timeline. **snapshot** `object` The saved configuration: `behavior` (the node and edge graph), `settings` (agent-wide options), `contact` (`inboundNumbers`), and `knowledge` (`kbIds`) when present. **name** `string | null` The version's display name, or `null` if none was given. **created\_via** `string` `manual` or `autosave`. **revision** `integer` Number of times an autosave rewrote this row in place before it was published. **created\_by** `string | null` ID of the user who saved the version, or `null` when saved with an org-level key. **created\_at** `string` ISO 8601 timestamp of the save. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "791e3da4-c453-45cb-9b86-3a6ef7666d3e", "org_id": "5c51e1ad-bbd6-4f6f-a139-a308e7c26c05", "agent_id": "405c75d5-c228-462d-bfe4-c4ce0b5c9f7f", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "e4d8dda7-16cb-4999-a6b3-e107ac8d8a21", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "bb73b6ae-8a68-4836-a36a-215df13f7c85", "type": "scenario", "position": { "x": 320, "y": 0 }, "data": { "name": "Book appointment", "rule": "Collect the caller's preferred date and time, then confirm the booking.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Caller wants to book", "description": "", "alwaysPick": false, "conditions": [] } } } ], "edges": [ { "id": "e51ac686-e907-472a-a2e1-df1ccf6ac0a3", "source": "e4d8dda7-16cb-4999-a6b3-e107ac8d8a21", "target": "bb73b6ae-8a68-4836-a36a-215df13f7c85" } ] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for a dental clinic.", "languages": ["en"], "enableMemory": false, "backgroundNoise": "off" }, "contact": { "inboundNumbers": ["+14155550123"] }, "knowledge": { "kbIds": [] } }, "name": "Adds booking flow", "created_via": "manual", "revision": 0, "created_by": "6d598dbb-36fc-4001-adab-8004fa6b230d", "created_at": "2026-09-10T23:02:11.418Z" }, "errors": null } ``` ```json Invalid Version theme={null} { "data": null, "errors": [ { "error": "INVALID_VERSION", "message": "version must be a semantic version like 1.2.0" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent version not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Archived Nodes Source: https://docs.bland.ai/api-v2/get/agents-library-archived-nodes GET https://api.bland.ai/v2/agents/library/archived-nodes List nodes archived from your organization's agents. ### Overview Returns the organization's archived nodes, newest first, up to 200 entries. Each entry is a self-contained copy of a node lifted off an agent canvas with [Archive Agent Node](/api-v2/post/agents-id-archived-nodes); a container node keeps its nested flow inside `node.data.flow`. Remove an entry with [Delete Archived Node](/api-v2/delete/agents-library-archived-nodes-archived-node-id). ### Headers **authorization** `string` *required* Your API key for authentication. ### Response **data** `array` Array of archived node objects, most recently archived first. **archived node object** **id** `string` Unique identifier for the archive entry. **agent\_id** `string | null` The agent the node was archived from. May reference an agent that has since been deleted. **agent\_name** `string | null` The source agent's name as it was at archive time. Kept even if the agent is later renamed or deleted. **name** `string` The node's name at archive time, or `Untitled node` when it had none. **kind** `string` The archived node's type, for example `scenario`, `complex-scenario`, or `auth-zone`. **description** `string | null` The first 160 characters of the node's rule or prompt at archive time. `null` when the node had neither. **node** `object` The complete node payload (`id`, `type`, `position`, `data`, and for containers `data.flow`). Re-insertable into any agent's graph. **created\_at** `string` ISO 8601 timestamp of when the node was archived. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "id": "ff6c62c6-33c0-49f1-ae2c-fb24e3b3a6fa", "agent_id": "20d4a218-7083-4f3d-8ba3-4f6869345c70", "agent_name": "Front desk", "name": "Holiday hours", "kind": "scenario", "description": "Tell the caller the office is closed for the holiday and offer to take a message.", "node": { "id": "9a929a49-f89f-42a0-b9fb-e5c08cd6654a", "type": "scenario", "position": { "x": 380, "y": 260 }, "data": { "name": "Holiday hours", "rule": "Tell the caller the office is closed for the holiday and offer to take a message.", "target": { "kind": "dialogue", "label": "Holiday hours" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Asks about hours", "description": "", "alwaysPick": false, "conditions": [] } } }, "created_at": "2026-09-09T17:02:44.318Z" }, { "id": "b9f03e9e-6e50-4910-aad5-d257603a289c", "agent_id": null, "agent_name": "Old survey bot", "name": "Satisfaction question", "kind": "scenario", "description": "Ask the caller to rate their experience from 1 to 5.", "node": { "id": "c06bd9d6-3d58-471b-a19e-d082b2a62307", "type": "scenario", "position": { "x": 0, "y": 260 }, "data": { "name": "Satisfaction question", "rule": "Ask the caller to rate their experience from 1 to 5.", "target": { "kind": "dialogue", "label": "Rating" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Survey", "description": "", "alwaysPick": false, "conditions": [] } } }, "created_at": "2026-08-30T11:45:09.006Z" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Library Scenarios Source: https://docs.bland.ai/api-v2/get/agents-library-scenarios GET https://api.bland.ai/v2/agents/library/scenarios List reusable scenarios from your other agents. ### Overview Returns the top-level scenario and auth nodes from the newest saved version of each agent in your organization, grouped per agent, with the full node payload inline so you can insert one into another agent's graph and save it with [Create Agent Version](/api-v2/post/agents-id-versions). Agents with no saved version or no scenarios are omitted from the results. For nodes you have retired from a canvas, see [List Archived Nodes](/api-v2/get/agents-library-archived-nodes). By default the response is a single bounded page of up to 50 agents. To walk every agent in the organization, opt in to the paginated envelope with `paginate=true` and follow the returned `next_cursor` until it is `null`. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **exclude\_agent\_id** `string` Skip this agent's scenarios, typically the agent you are currently editing. An empty value is ignored. **paginate** `boolean` (default: false) Set to `true` to receive `{ groups, next_cursor }` instead of the bounded legacy array. Each page returns up to 50 agents. **after** `string` Agent UUID cursor for the next page. Pass the `next_cursor` from the previous paginated response. Only used when `paginate=true`. Invalid UUIDs return `400 INVALID_CURSOR`. ### Response **data** `array | object` Without `paginate=true`, an array of groups (one per agent that has at least one library scenario), ordered by agent ID. With `paginate=true`, an object with `groups` (same shape) and `next_cursor` (the agent ID to pass as `after` for the next page, or `null` when there are no more pages). **group object** **agent\_id** `string` The agent the scenarios were read from. **agent\_name** `string` The agent's display name. **scenarios** `array` The agent's top-level scenario and auth nodes. See the scenario object below. **data\[].scenarios** `array` Scenario objects within a group. **scenario object** **id** `string` The node's ID inside its source agent. Remap IDs before inserting the node into another graph. **name** `string` The node's name, or `Untitled node` when it has none. **kind** `string` The node type. One of `scenario`, `complex-scenario`, `auth`, `complex-auth`, `auth-zone`. **description** `string | null` The first 160 characters of the node's rule or prompt, whitespace collapsed. `null` when the node has neither. **children** `array` Present only for container nodes (those with a nested `data.flow`). Each entry has `id`, `name`, and `kind` (the child step's node type). Start and end pills are excluded. **node** `object` The complete node as stored in the source agent's version snapshot (`id`, `type`, `position`, `data`, and for containers `data.flow`). Insertable as-is. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": [ { "agent_id": "b5154820-6f11-4886-8523-d896934528ae", "agent_name": "Appointment reminders", "scenarios": [ { "id": "00fa3bcf-56f5-45b9-8996-427d57b091b7", "name": "Reschedule appointment", "kind": "scenario", "description": "Help the caller move their appointment. Confirm the new date and time before ending.", "node": { "id": "00fa3bcf-56f5-45b9-8996-427d57b091b7", "type": "scenario", "position": { "x": -190, "y": 260 }, "data": { "name": "Reschedule appointment", "rule": "Help the caller move their appointment. Confirm the new date and time before ending.", "target": { "kind": "dialogue", "label": "Reschedule" }, "loopWhile": "", "variables": [ { "id": "7aeefed0-9806-400d-b2a7-96e6b58d1ac1", "key": "new_appointment_time", "value": "The date and time the caller agreed to", "type": "string", "accurateSpelling": false } ], "entry": { "mode": "llm", "label": "Wants to reschedule", "description": "", "alwaysPick": false, "conditions": [] } } } } ] }, { "agent_id": "2c5cbfa4-4d00-4b35-bd1b-195598f7d823", "agent_name": "Billing support", "scenarios": [ { "id": "3c2be395-2d36-4437-833f-aacfc371a033", "name": "Dispute a charge", "kind": "complex-scenario", "description": "Walk the caller through disputing a charge on their statement.", "children": [ { "id": "66cbecac-8007-4be8-981c-26264801320f", "name": "Collect charge details", "kind": "prompt" } ], "node": { "id": "3c2be395-2d36-4437-833f-aacfc371a033", "type": "complex-scenario", "position": { "x": 190, "y": 260 }, "data": { "name": "Dispute a charge", "rule": "Walk the caller through disputing a charge on their statement.", "target": { "kind": "dialogue", "label": "Dispute" }, "entry": { "mode": "llm", "label": "Wants to dispute a charge", "description": "", "alwaysPick": false, "conditions": [] }, "flow": { "nodes": [ { "id": "start", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "66cbecac-8007-4be8-981c-26264801320f", "type": "prompt", "position": { "x": 0, "y": 160 }, "data": { "name": "Collect charge details", "prompt": "Ask for the date and amount of the charge the caller wants to dispute.", "useStaticText": false, "loopWhile": "", "variables": [], "useAudioExtraction": false, "ignorePreviousExtractions": false, "settings": {} } }, { "id": "end", "type": "end", "position": { "x": 0, "y": 320 }, "data": {} } ], "edges": [ { "id": "e-start-collect", "source": "start", "target": "66cbecac-8007-4be8-981c-26264801320f" }, { "id": "e-collect-end", "source": "66cbecac-8007-4be8-981c-26264801320f", "target": "end" } ] } } } } ] } ], "errors": null } ``` ```json Paginated response theme={null} { "data": { "groups": [ { "agent_id": "b5154820-6f11-4886-8523-d896934528ae", "agent_name": "Appointment reminders", "scenarios": [ /* ... */ ] } ], "next_cursor": "b5154820-6f11-4886-8523-d896934528ae" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Pathway Translation Run Source: https://docs.bland.ai/api-v2/get/agents-migrate-translations-run-id GET https://api.bland.ai/v2/agents/migrate/translations/{run_id} Poll the status and result of a translation job. ### Overview Returns the current state of a job started with [Start Pathway Translation](/api-v2/post/agents-migrate-translations). While the job runs, the record carries status and progress counters only; the full result appears once the status is terminal (`COMPLETE`, `FAILED`, or `CANCELLED`). A run that has not finished after 11 hours is marked `FAILED` with `TRANSLATION_TIMED_OUT` the next time it is read. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The run's unique identifier. Returns `400 INVALID_RUN_ID` if it is not a UUID and `404 TRANSLATION_RUN_NOT_FOUND` if no run with that ID exists in your organization. ### Response **data.run** `object` The run record. **run object** **id** `string` Unique identifier for the run. **status** `string` One of `PENDING` (queued), `RUNNING` (pathways being processed), `FINALIZING` (all pathways done, agent being created; can no longer be cancelled), `COMPLETE`, `FAILED`, `CANCELLED`. The last three are terminal. **total\_pathways** `integer` Number of pathways in the job. **completed\_pathways** `integer` Pathways processed so far. **result** `object | null` `null` until the run is terminal. On `COMPLETE`, see the result object below. Also `null` on `FAILED` or `CANCELLED` unless a result had already been written. **error\_code** `string | null` Set on `FAILED` or `CANCELLED`, for example `TRANSLATION_CANCELLED`, `TRANSLATION_TIMED_OUT`, or `TRANSLATION_START_FAILED`. `null` otherwise. **error\_message** `string | null` Human-readable failure reason, safe to show to users. `null` unless `error_code` is set. **created\_at** `string` ISO 8601 timestamp of when the run was created. **completed\_at** `string | null` ISO 8601 timestamp of when the run reached a terminal state, or `null` while it is still active. **data.run.result** `object | null` The terminal result. Which of `scenarios` or `agent` and `version` is present depends on the job's `create` flag. **result object** **per\_pathway** `array` One entry per pathway, in job order. Each has `pathway_id`, `mode` (`one_to_one` or `translate`), `pathway_name`, `scenario_names` (the scenarios produced from it), `warnings` (strings), and, for `translate` entries only, `report` (the planner's accounting: `architectureSummary`, `dispositions`, `droppedOrApproximated`, `openQuestions`). **scenarios** `array` Present when the job was started with `create: false`. The combined scenario nodes from every pathway, each with `id`, `type` (`scenario` or `complex-scenario`), `position`, and `data`, ready to add to an existing agent with [Create Agent Version](/api-v2/post/agents-id-versions). **warnings** `array` All pathways' warnings combined, plus job-level notes such as a global prompt that was not carried over. **lint** `object` Structural checks on the combined result: `errors` and `warnings` (arrays of strings). **agent** `object` Present when the job created an agent. The agent record: `id`, `org_id`, `name`, `created_by` (`string | null`), `created_at`, `updated_at`, `deleted_at` (`null`). **version** `object` Present when the job created an agent. Its first version: `id`, `org_id`, `agent_id`, `branch_id` (`null`), `snapshot` (the full agent configuration, abbreviated in the example below), `name`, `created_via` (`manual`), `revision` (`0`), `created_by`, `created_at`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "run": { "id": "182405af-c7b3-4640-adea-42f3f91d70dd", "status": "COMPLETE", "total_pathways": 2, "completed_pathways": 2, "result": { "per_pathway": [ { "pathway_id": "8c2c2ec5-d8d5-42a0-9b38-0bfb7d2b2e65", "mode": "translate", "pathway_name": "Order status", "scenario_names": ["Look up order"], "warnings": [], "report": { "architectureSummary": "Three lookup nodes merged into one scenario with a webhook tool.", "dispositions": [ { "nodeIds": ["4ee8cecb-df73-4883-a0c8-965bfb9e0077", "2c8026a9-5dc3-4e3e-83e5-b306e4d4369b"], "disposition": "Became scenario \"Look up order\"", "rationale": "Collect-then-fetch sequence with no branching." } ], "droppedOrApproximated": [], "openQuestions": [] } }, { "pathway_id": "7aa67804-b77a-414c-86de-06497b7dc2c5", "mode": "one_to_one", "pathway_name": "Returns", "scenario_names": ["Returns"], "warnings": [] } ], "warnings": [], "lint": { "errors": [], "warnings": [] }, "agent": { "id": "09ffd40f-cf55-448e-ab85-ad5c2cff650b", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Migrated pathways", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T20:14:52.301Z", "updated_at": "2026-09-10T20:14:52.301Z", "deleted_at": null }, "version": { "id": "bc44cc7d-d822-4d0b-9661-b7916c4277a5", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "agent_id": "09ffd40f-cf55-448e-ab85-ad5c2cff650b", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "inbound", "type": "inbound", "position": { "x": 360, "y": -180 }, "data": { "number": "" } }, { "id": "agent", "type": "agent", "position": { "x": 192, "y": 0 }, "data": { "prompt": "Greet the caller and find out what they need.\n\n## Routing\n\nAfter each user turn, enter the scenario that matches where the conversation is now. The scenarios you can enter:\n\n- \"Look up order\": the caller wants the status of an order\n- \"Returns\": the caller wants to return an item", "loopWhile": "", "variables": [] } }, { "id": "a732a5dd-5430-460e-8fab-cf5576a34b41", "type": "scenario", "position": { "x": -190, "y": 260 }, "data": { "name": "Look up order", "rule": "Ask for the order number, look it up, and read back the shipping status.", "target": { "kind": "dialogue", "label": "Look up order" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Order status", "description": "The caller wants the status of an order", "alwaysPick": false, "conditions": [] } } }, { "id": "bb0041fb-8077-41eb-aec9-57c1d477a70d", "type": "complex-scenario", "position": { "x": 190, "y": 260 }, "data": { "name": "Returns", "rule": "The caller wants to return an item", "target": { "kind": "dialogue", "label": "Returns" }, "entry": { "mode": "llm", "label": "Returns", "description": "The caller wants to return an item", "alwaysPick": false, "conditions": [] }, "flow": { "nodes": [ { "id": "start", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "4fce61ee-3bfa-4def-bcad-7198b04bf853", "type": "prompt", "position": { "x": 0, "y": 160 }, "data": { "name": "Reason for return", "prompt": "Ask why the caller is returning the item.", "useStaticText": false, "loopWhile": "", "variables": [], "useAudioExtraction": false, "ignorePreviousExtractions": false, "settings": {} } }, { "id": "end", "type": "end", "position": { "x": 0, "y": 320 }, "data": {} } ], "edges": [ { "id": "e-start-reason", "source": "start", "target": "4fce61ee-3bfa-4def-bcad-7198b04bf853" }, { "id": "e-reason-end", "source": "4fce61ee-3bfa-4def-bcad-7198b04bf853", "target": "end" } ] } } } ], "edges": [ { "id": "e-inbound-agent", "source": "inbound", "target": "agent" }, { "id": "e-agent-lookup", "source": "agent", "target": "a732a5dd-5430-460e-8fab-cf5576a34b41", "data": { "mode": "llm", "label": "Order status", "description": "The caller wants the status of an order", "alwaysPick": false, "conditions": [] } }, { "id": "e-agent-returns", "source": "agent", "target": "bb0041fb-8077-41eb-aec9-57c1d477a70d", "data": { "mode": "llm", "label": "Returns", "description": "The caller wants to return an item", "alwaysPick": false, "conditions": [] } } ] }, "settings": { "displayName": "Migrated pathways", "systemPrompt": "You help customers of Acme Outdoor.", "voice": "", "languages": ["english"], "enableMemory": false, "interruptionSensitivity": 350, "backgroundNoise": "off" }, "contact": { "inboundNumbers": [] } }, "name": "Migrated from 2 pathway(s)", "created_via": "manual", "revision": 0, "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T20:14:52.301Z" } }, "error_code": null, "error_message": null, "created_at": "2026-09-10T20:01:12.530Z", "completed_at": "2026-09-10T20:14:52.418Z" } }, "errors": null } ``` ```json In Progress theme={null} { "data": { "run": { "id": "182405af-c7b3-4640-adea-42f3f91d70dd", "status": "RUNNING", "total_pathways": 2, "completed_pathways": 1, "result": null, "error_code": null, "error_message": null, "created_at": "2026-09-10T20:01:12.530Z", "completed_at": null } }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "TRANSLATION_RUN_NOT_FOUND", "message": "no translation run with that id" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Batches Source: https://docs.bland.ai/api-v2/get/batches GET https://api.bland.ai/v2/batches/list Retrieve a list of all batches created by your organization. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **take** `integer` Optional. The number of results to return. **skip** `integer` Optional. The number of results to skip (used for pagination). ### Response **data** `array` A list of batches created by your organization. **data\[].id** `string` The unique identifier of the batch. **data\[].user\_id** `string` The ID of the org that created the batch. **data\[].base\_prompt** `string` A JSON string representing the global call properties used in the batch. **data\[].created\_at** `string (ISO 8601)` The timestamp when the batch was created. **data\[].call\_objects** `array` A preview of the call objects included in the batch. **data\[].description** `string` A human-readable description of the batch. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": [ { "id": "652ad643-9gca-477c-97c3-9d8e6t74d7af", "user_id": "64602f94-d670-43d2-8474-bcdcb9522c4f", "base_prompt": "{\"record\":true,\"task\":\"Say hello to the user\"}", "created_at": "2025-05-08T19:28:12.627Z", "call_objects": [ { "task": "Say hello to the user", "phone_number": "+1234567890" } ], "description": "My first batch" } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Batch Source: https://docs.bland.ai/api-v2/get/batches-id GET https://api.bland.ai/v2/batches/{batch_id} Retrieve metadata for a specific batch. This does not include logs, use the logs endpoint for that. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **batch\_id** `string` *required* The unique identifier of the batch you want to fetch. ### Response **data** `object` Metadata and configuration details of the batch. **data.id** `string` The unique identifier of the batch. **data.user\_id** `string` The ID of the org that created the batch. **data.base\_prompt** `string` A JSON string representing shared call properties such as `task` or `record`. **data.created\_at** `string (ISO 8601)` The timestamp of when the batch was created. **data.call\_objects** `array` A preview of call objects in the batch. **data.description** `string` A human-readable label or description for the batch. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "id": "a9a033b7-44d8-40c6-aaec-42cd43106273", "user_id": "657ad643-92ca-477c-97cc-9d8e6e74d7af", "base_prompt": "{\"record\":true,\"task\":\"Say hello to the user\"}", "created_at": "2025-05-08T19:28:12.627Z", "call_objects": [ { "task": "Say hello to the user", "phone_number": "+1234567890" } ], "description": "Untitled Batch" }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Get Batch Logs Source: https://docs.bland.ai/api-v2/get/batches-id-logs GET https://api.bland.ai/v2/batches/{batch_id}/logs Retrieve logs for a specific batch. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **batch\_id** `string` *required* The unique identifier of the batch whose logs you want to fetch. ### Query Parameters **take** `integer` Optional. The number of log entries to return. **skip** `integer` Optional. The number of log entries to skip (used for pagination). **direction** `string` Optional. Sort order of logs. \ Valid values: `"asc"` or `"desc"` (default is `"desc"`). ### Response **data** `array` A list of log entries related to the batch's lifecycle and execution. **data\[].id** `string` The unique identifier for the log entry. **data\[].batch\_id** `string` The ID of the batch associated with the log. **data\[].org\_id** `string` The organization ID tied to the batch. **data\[].event\_type** `string` The type of log event.\ \ Examples: `"lifecycle"`, `"complete"` **data\[].timestamp** `string (ISO 8601)` The time the log was generated. **data\[].payload** `object` Additional information related to the event. Contents vary depending on the `event_type`. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": [ { "id": "6398342c-d7de-4a11-ba86-3d86e5746699", "batch_id": "f6ef9224-0ec3-43e4-98a1-bb2a8765d110", "org_id": "f52eb4b2-c8b6-44a6-a36c-2749aa930c86", "event_type": "complete", "timestamp": "2025-05-08T19:28:42.748Z", "payload": { "calls_total": 1, "calls_failed": 0, "calls_successful": 1 } }, { "id": "a24616b4-be8f-42e4-be29-4c5ec005756c", "batch_id": "f6ef9224-0ec3-43e4-98a1-bb2a8765d110", "org_id": "f52eb4b2-c8b6-44a6-a36c-2749aa930c86", "event_type": "lifecycle", "timestamp": "2025-05-08T19:28:15.560Z", "payload": { "message": "Requested: 1. Validated: 1. Dispatched: 1. CPS: 1.12.", "state_change": "in_progress" } } ], "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # List Models (Public) Source: https://docs.bland.ai/api-v2/get/models GET https://api.bland.ai/v2/models List Bland's TTS models in an OpenAI-compatible catalog. No API key required, so tooling can discover models before authenticating. ## Overview Returns Bland's TTS model catalog in the OpenAI `list` format. No authentication is required. Use it when your tooling expects an OpenAI-style `GET /models` endpoint, or when you need to discover models before a user has entered an API key. Each entry carries the same capabilities manifest as [List TTS Models](/api-v2/get/tts-models): supported encodings, sample rates, containers, and voice controls. If you are already authenticated and only need the manifests, [List TTS Models](/api-v2/get/tts-models) returns them without the OpenAI wrapper. Its behavior is unchanged. Responses are cacheable for up to 5 minutes (`Cache-Control: public, max-age=300`). *** ## Response **object** `string` Always `list`. **data** `array` Array of model entries. **Model fields** **id** `string` Model identifier, for example `btts-3`. Same value as the `x-model` header on [Synthesize Speech](/api-v2/post/tts). **object** `string` Always `model`. **created** `number` Always `0`. Present for OpenAI compatibility. **owned\_by** `string` Always `bland`. **name** `string` Human-readable name. Currently matches `id`. **modality** `string` Always `text-to-speech`. **capabilities** `object` The model's capabilities manifest. **Capability fields** **encodings** `string[]` Supported audio codecs. Pass one as `audio.encoding`. **sample\_rates** `number[]` Supported PCM sample rates in Hz. `mulaw` is fixed at 8000 regardless of this list. **containers** `string[]` Supported byte framings (`raw`, `wav`). **controls** `object` Supported voice controls and their allowed ranges. Each entry is an object with `min` and `max`. ```json Response theme={null} { "object": "list", "data": [ { "id": "btts-3", "object": "model", "created": 0, "owned_by": "bland", "name": "btts-3", "modality": "text-to-speech", "capabilities": { "encodings": ["pcm_s16le", "mulaw"], "sample_rates": [8000, 16000, 24000, 44100, 48000], "containers": ["raw", "wav"], "controls": { "expressiveness": { "min": 0, "max": 1 }, "stability": { "min": 0, "max": 1 } } } }, { "id": "btts-2", "object": "model", "created": 0, "owned_by": "bland", "name": "btts-2", "modality": "text-to-speech", "capabilities": { "encodings": ["pcm_s16le", "mulaw"], "sample_rates": [8000, 16000, 24000, 44100, 48000], "containers": ["raw", "wav"], "controls": { "expressiveness": { "min": 0, "max": 1 }, "stability": { "min": 0, "max": 1 } } } } ] } ``` ```json Error theme={null} { "error": { "message": "Failed to list models.", "type": "api_error", "param": null, "code": "internal_error" } } ``` ### Error codes | Code | HTTP | Meaning | | - | - | - | | `internal_error` | 500 | Catalog generation failed. Retry the request. | *** Docs for agents: [llms.txt](/llms.txt) # List Tools Source: https://docs.bland.ai/api-v2/get/tools GET https://api.bland.ai/v2/tools Retrieve a paginated list of your tools. Returns tools that are not tied to a specific resource connection. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **page** `integer` Page number for pagination. Minimum `1`. Defaults to `1`. **limit** `integer` Number of results per page. Minimum `1`, maximum `1000`. Defaults to `50`. **search** `string` Filter results by searching the tool's `name` and `description` fields. **orderBy** `string` Field to sort results by. Currently only `"created_at"` is supported. **orderDirection** `string` Sort direction. Allowed values: `"asc"`, `"desc"`. Defaults to `"desc"`. > [!NOTE] > > This endpoint only returns tools that are **not** tied to a specific resource connection (`resource_id: null`). Tools created as part of a connected integration resource are excluded. ### Response **data.tools** `array` Array of integration tool objects. **tool object** **id** `string` Unique identifier for the tool (prefixed with `TL-`). **name** `string` The tool's name. **description** `string` The tool's description. **integration** `string` The integration key (e.g. `"slack"`). **action** `string` The action within the integration. **input\_schema** `object` JSON Schema for the tool's input parameters. **speech** `string` Text the AI says while using this tool. **timeout** `number` Timeout in milliseconds. **cache** `boolean` Whether response caching is enabled. **max\_retries** `number` Maximum retry attempts. **cooldown** `number` Seconds between retries. **label** `string` Human-readable label, if set. **is\_active** `boolean` Whether the tool is active and available for use. **is\_draft** `boolean` Whether the tool is in draft state. **public** `boolean` Whether the tool is publicly visible. **created\_at** `string` ISO 8601 timestamp of when the tool was created. **data.pagination** `object` Pagination metadata. **pagination object** **page** `number` The current page number. **limit** `number` Number of results per page. **hasMore** `boolean` Whether there are additional pages of results. **nextPage** `number | null` The next page number, or `null` if there are no more pages. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Response (Success) theme={null} { "data": { "tools": [ { "id": "TL-abc123def456", "name": "SendSlackMessage", "description": "Sends a message to a Slack channel", "integration": "slack", "action": "send_message", "input_schema": { "type": "object", "properties": { "channel": { "type": "string" }, "message": { "type": "string" } }, "required": ["channel", "message"] }, "speech": "Sending that message to Slack now.", "timeout": 10000, "cache": false, "max_retries": 0, "cooldown": null, "label": null, "is_active": true, "is_draft": false, "public": false, "created_at": "2025-09-23T15:13:36.348Z" } ], "pagination": { "page": 1, "limit": 50, "hasMore": false, "nextPage": null } }, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Tool Execution Logs Source: https://docs.bland.ai/api-v2/get/tools-logs GET https://api.bland.ai/v2/tools/logs Retrieve per-execution logs for your tools with optional filtering and pagination. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **Pagination** **page** `integer` Page number. Defaults to `1`. **pageSize** `integer` Results per page. Maximum `100`. Defaults to `50`. **Filters** **tool\_id** `string` Filter logs by a specific tool ID. **resource\_id** `string` Filter logs by a specific resource ID. **integration** `string` Filter logs by integration key (e.g. `"slack"`). **action** `string` Filter logs by action name. **status** `string` Filter by execution status. Allowed values: `"success"`, `"error"`. **call\_id** `string` Filter logs by the call ID that triggered the tool execution. **error\_type** `string` Filter logs by error type (only applies to failed executions). **Date Range** **created\_after** `string` ISO 8601 date string. Only return logs created after this timestamp. **created\_before** `string` ISO 8601 date string. Only return logs created before this timestamp. **Size Filters** **execution\_time\_ms\_gt** `number` Only return logs where execution time is greater than this value (in ms). **execution\_time\_ms\_lt** `number` Only return logs where execution time is less than this value (in ms). **input\_size\_kb\_gt** `number` Only return logs where input payload size is greater than this value (in KB). **input\_size\_kb\_lt** `number` Only return logs where input payload size is less than this value (in KB). **output\_size\_kb\_gt** `number` Only return logs where output payload size is greater than this value (in KB). **output\_size\_kb\_lt** `number` Only return logs where output payload size is less than this value (in KB). ### Response **logs** `array` Array of tool execution log entries. **log entry** **id** `string` Unique log entry identifier. **tool\_id** `string` ID of the tool that was executed. **resource\_id** `string` ID of the resource used, if any. **integration** `string` Integration key that was invoked. **action** `string` Action that was invoked. **status** `string` Execution result: `"success"` or `"error"`. **call\_id** `string` ID of the call that triggered this execution. **execution\_time\_ms** `number` Time taken to execute the tool in milliseconds. **input\_size\_kb** `number` Size of the input payload in KB. **output\_size\_kb** `number` Size of the output payload in KB. **error\_type** `string` Error category if the execution failed. **created\_at** `string` ISO 8601 timestamp of when the execution occurred. **totalLogs** `number` Total number of logs matching the filters. **totalPages** `number` Total number of pages. **currentPage** `number` The current page number. **pageSize** `number` Number of results per page. ```json Response (Success) theme={null} { "logs": [ { "id": "log_abc123", "tool_id": "TL-abc123def456", "resource_id": null, "integration": "slack", "action": "send_message", "status": "success", "call_id": "call_xyz789", "execution_time_ms": 342, "input_size_kb": 0.5, "output_size_kb": 1.2, "error_type": null, "created_at": "2025-09-23T15:13:36.348Z" } ], "totalLogs": 1, "totalPages": 1, "currentPage": 1, "pageSize": 50 } ``` *** Docs for agents: [llms.txt](/llms.txt) # Tool Execution Stats Source: https://docs.bland.ai/api-v2/get/tools-logs-stats GET https://api.bland.ai/v2/tools/logs/stats Retrieve aggregated execution statistics for your tools, grouped and filtered by integration, status, date, and more. Maximum date range is 90 days. ### Headers **authorization** `string` *required* Your API key for authentication. ### Query Parameters **Grouping** **group\_by** `string` Comma-separated list of fields to group results by. Supported values: `integration`, `action`, `status`, `tool_id`, `resource_id`, `error_type`, `date`. Example: `group_by=integration,status` **Metrics** **metrics** `string` Comma-separated list of metrics to compute. Use `"count"` for total execution count, or `"field:avg"` for averages. Supported aggregate fields: `execution_time_ms`, `input_size_kb`, `output_size_kb`. Defaults to `"count"`. Example: `metrics=count,execution_time_ms:avg` **Date Range** **period** `string` Preset time period. Allowed values: `"today"`, `"week"`, `"month"`. Overridden by `start_date`/`end_date` if both are provided. **start\_date** `string` Start of the date range (ISO 8601). Maximum range is 90 days from `end_date`. **end\_date** `string` End of the date range (ISO 8601). Maximum range is 90 days from `start_date`. **Filters** **tool\_id** `string` Filter stats to a specific tool ID. **resource\_id** `string` Filter stats to a specific resource ID. **integration** `string` Filter by integration key. **action** `string` Filter by action name. **status** `string` Filter by execution status. Allowed values: `"success"`, `"error"`. **error\_type** `string` Filter by error type. **call\_id** `string` Filter to a specific call ID. **limit** `number` Maximum number of groups to return. Minimum `1`, maximum `1000`. Defaults to `50`. ### Response **results** `array` Array of aggregated result objects. Each entry contains the grouped dimensions and the requested metric values. **result entry** **integration** `string` Integration key (present when grouped by `integration`). **action** `string` Action name (present when grouped by `action`). **status** `string` Execution status (present when grouped by `status`). **tool\_id** `string` Tool ID (present when grouped by `tool_id`). **date** `string` Date string (present when grouped by `date`). **count** `number` Total execution count (present when `count` is in `metrics`). **execution\_time\_ms\_avg** `number` Average execution time in ms (present when `execution_time_ms:avg` is in `metrics`). **input\_size\_kb\_avg** `number` Average input size in KB (present when `input_size_kb:avg` is in `metrics`). **output\_size\_kb\_avg** `number` Average output size in KB (present when `output_size_kb:avg` is in `metrics`). **meta** `object` Metadata about the query that was executed. ```json Request theme={null} GET /v2/tools/logs/stats?group_by=integration,status&metrics=count,execution_time_ms:avg&period=week ``` ```json Response (Success) theme={null} { "results": [ { "integration": "slack", "status": "success", "count": 142, "execution_time_ms_avg": 318.5 }, { "integration": "slack", "status": "error", "count": 3, "execution_time_ms_avg": 10000.0 } ], "meta": { "group_by": ["integration", "status"], "metrics": ["count", "execution_time_ms:avg"], "period": "week" } } ``` *** Docs for agents: [llms.txt](/llms.txt) # List TTS Models Source: https://docs.bland.ai/api-v2/get/tts-models GET https://api.bland.ai/v2/tts/models List what each TTS model supports. ## Overview Lists the encodings, sample rates, containers, and controls each model supports. Use it to build a picker, validate a request before sending it, or check what a new model added. You do not choose a model — the voice you pass decides it. It comes back in the `x-model` header on [Synthesize Speech](/api-v2/post/tts). For one model, use `GET /v2/tts/models/:id`. For unauthenticated, OpenAI-compatible discovery, use [List Models (Public)](/api-v2/get/models). > [!NOTE] > > Prefer **`btts-3` or newer**. `expressiveness` and `stability` are calibrated for it, > and 48 kHz is the rate it renders natively. `btts-2` is listed because it still > synthesizes, but the controls are not tuned for it. *** ## Headers **authorization** `string` *required* Your API key. *** ## Response **models** `array` Array of model manifests. **Model fields** **id** `string` Model identifier, for example `btts-3`. Same value as the `x-model` header. **encodings** `string[]` Supported audio codecs. Pass one as `audio.encoding`. **sample\_rates** `number[]` Supported PCM sample rates in Hz. `mulaw` is fixed at 8000 regardless of this list. **containers** `string[]` Supported byte framings (`raw`, `wav`). **controls** `object` Supported voice controls and their allowed ranges. Each entry is an object with `min` and `max`. ```json Response theme={null} { "models": [ { "id": "btts-3", "encodings": ["pcm_s16le", "mulaw"], "sample_rates": [8000, 16000, 24000, 44100, 48000], "containers": ["raw", "wav"], "controls": { "expressiveness": { "min": 0, "max": 1 }, "stability": { "min": 0, "max": 1 } } }, { "id": "btts-2", "encodings": ["pcm_s16le", "mulaw"], "sample_rates": [8000, 16000, 24000, 44100, 48000], "containers": ["raw", "wav"], "controls": { "expressiveness": { "min": 0, "max": 1 }, "stability": { "min": 0, "max": 1 } } } ] } ``` ```json Not found (GET /v2/tts/models/:id) theme={null} { "error": { "code": "not_found", "message": "Unknown model: btts-9" } } ``` ### Error codes | Code | HTTP | Meaning | | - | - | - | | `not_found` | 404 | `GET /v2/tts/models/:id` was called with an unknown model ID. | *** Docs for agents: [llms.txt](/llms.txt) # Overview Source: https://docs.bland.ai/api-v2/overview What the Agents API covers, how an agent is structured, and where to start. The Agents API is the programmatic surface for agents built in the new Bland dashboard at `v2.app.bland.ai`. Every endpoint here mirrors something the agent builder does: saving a configuration, publishing it to an environment, branching to try a change, or routing a phone number to an agent. It does not replace the rest of the Bland API. Calls, numbers, knowledge bases, tools, and the other groups in this reference work alongside it, and those endpoints are unchanged. Endpoints under **Legacy** at the end of the sidebar belong to the original platform (conversational pathways, personas, and similar). They still work for existing integrations, but new builds should use agents. ### How an agent is structured Most of this API follows from four ideas, so it is worth reading these before the endpoint pages. **An agent** is an org-scoped record. Creating one gives you three empty environments and nothing else, because an agent holds no configuration of its own. **A version** is a complete agent configuration, saved and never modified afterwards. Saving a version does not deploy it. **Environments** are `dev`, `staging`, and `production`. Each one pins a single version. Publishing moves the staging pin, promoting moves the production pin, and rolling back moves it to an earlier version. Calls run whatever version the environment currently pins. **Branches** are dev workspaces. Save onto a branch to work without touching the dev timeline, then rebase and merge it back. Three features build on those: checks gate promotions, experiments run a variant against an environment's pin, and dispositions classify call outcomes. Dispositions are enabled per organization. ### Base URL and authentication Every route lives under `https://api.bland.ai/v2/agents`. Send your API key in the `authorization` header. A successful response returns your payload in `data` with `errors` set to `null`. On any error, `data` is `null` and `errors` carries one or more entries with an `error` code and a `message`. ```json Success theme={null} { "data": { "id": "9f3d0b1c-4a77-4f3e-91a6-2c0d8e5b6a14" }, "errors": null } ``` ```json Error theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` ### Where to start If you have not built an agent yet, [Build your first agent](/build-your-first-agent) walks through the dashboard first, which makes these endpoints easier to follow. To create one over the API, the shortest path to a live agent is [Create Agent](/api-v2/post/agents), then [Create Agent Version](/api-v2/post/agents-id-versions), then [Publish Agent](/api-v2/post/agents-id-publish) and [Promote Agent](/api-v2/post/agents-id-promote). *** Docs for agents: [llms.txt](/llms.txt) # Update Agent Source: https://docs.bland.ai/api-v2/patch/agents-id PATCH https://api.bland.ai/v2/agents/{agent_id} Change an agent's display name. ### Overview Changes an agent's display name. The agent's configuration lives in its versions, not on the agent record; to change behavior, save a new version with [Create Agent Version](/api-v2/post/agents-id-versions). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **name** `string` *required* New display name. Must be non-empty after trimming whitespace. Returns `400 INVALID_NAME` otherwise. ### Response **data** `object` The updated agent record. Environments are not included; use [Get Agent](/api-v2/get/agents-id) for those. **agent object** **id** `string` Unique identifier for the agent. **org\_id** `string` The organization that owns the agent. **name** `string` The agent's new display name. **created\_by** `string | null` ID of the user who created the agent, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of this update. **deleted\_at** `null` Always `null` on a live agent. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "dbc52076-c8bd-4ec7-81a9-8999bc83d2b2", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Front desk (after hours)", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T22:59:51.569Z", "updated_at": "2026-09-10T22:59:52.275Z", "deleted_at": null }, "errors": null } ``` ```json Invalid Name theme={null} { "data": null, "errors": [ { "error": "INVALID_NAME", "message": "name must be a non-empty string" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Disposition Draft Source: https://docs.bland.ai/api-v2/patch/agents-id-dispositions-disposition-id-draft PATCH https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/draft Replace a disposition's draft definition. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Replaces the whole draft definition. The write is guarded by the draft revision: pass the `revision` you read from [Get Disposition Draft](/api-v2/get/agents-id-dispositions-disposition-id-draft) as `expectedDraftRevision`, and the call returns `409` if someone else saved first. Editing the draft never affects the published version or calls already running; publish with [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish) to make changes live. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Body Parameters Unknown fields anywhere in the body are rejected. This is a full replacement, not a merge: every field of `definition` must be present. **expectedDraftRevision** `integer` *required* The draft revision you last read, at least `1`. If the live revision differs, nothing is written and the call returns `409 CONFLICT`. On success the revision becomes `expectedDraftRevision + 1`. **definition** `object` *required* The complete replacement definition. Schema violations return `400 BAD_REQUEST` with message `Invalid request body` and an `ext` string listing each failing path. Rule violations return `400 BAD_REQUEST` with message `Definition failed validation` and an `ext` string carrying `problems`, each with `valueId` and `message`. Drafts are validated less strictly than publishing: a `structured_extraction` value may omit its version pin, and judge or extractor pins may still be editable. **definition object** **name** `string` *required* Display name, 1 to 120 characters. **description** `string` *required* Free-text description, up to 2000 characters. May be empty. **timing** `string` *required* `immediate` runs within 30 minutes of call completion. `within_24h` queues the run with a 24-hour deadline. **values** `array` *required* Up to 50 value objects. Each value produces one field of the result. Value `id`s and `key`s must be unique within the definition. A definition with no values can be saved but not published or tested. **values\[].id** `string` *required* A UUID you generate. It is the value's permanent identity: results, corrections, and the transformation all refer to it. Keep existing ids stable when editing so history stays attached. **values\[].key** `string` *required* Payload field name, 1 to 64 characters matching `^[a-z][a-z0-9_]*$`. May change between drafts. **values\[].label** `string` *required* Human-readable label, 1 to 120 characters. **values\[].schema** `object` *required* The value's output shape. `kind` is one of `boolean`, `string`, `number`, `enum`, `array`, or `object`; every kind accepts an optional `description` up to 2000 characters. `string` accepts `format: "date-time"`. `enum` requires `options`: 1 to 24 entries of `{ "key", "label" }` with `key` 1 to 64 characters, `label` 1 to 120, and keys unique. `array` requires `items` (a nested schema) and accepts `minItems` (at least 0) and `maxItems` (at least 1); neither may exceed 1000 and `minItems` may not exceed `maxItems`. `object` requires `properties` (a map of names up to 64 characters to nested schemas, at most 64 of them) and `required` (unique names that all appear in `properties`). A schema may not exceed 200 nodes, 8 levels of nesting, or 64 KB. **values\[].source** `object` *required* How the value is produced. `kind` selects one of four shapes; the fields for each kind are listed below. A `judge` value's schema must be `boolean` or an `enum` whose keys exactly match the judge's level keys (a pass/fail judge maps to `boolean` or a two-option `pass` and `fail` enum). A `structured_extraction` value's schema must exactly match the pinned extractor's output schema. A `variable_extraction` value's schema must exactly match the `outputSchema` of the matching entry in [Get Variable Catalog](/api-v2/get/agents-id-dispositions-variable-catalog). **values\[].source.kind** `string` *required* One of `variable_extraction`, `structured_extraction`, `judge`, or `custom_code`. **values\[].source.variableKey** `string` `variable_extraction` only, required. Key of an existing variable on the agent, 1 to 128 characters matching `^[A-Za-z_][A-Za-z0-9_.-]{0,127}$`. The variable must exist in the agent's current configuration. **values\[].source.execution** `object` For `variable_extraction`, optional `{ "reasoningEffort" }` defaulting to `auto`. For `structured_extraction` and `judge`, required `{ "reasoningEffort", "inputSourceIds" }`. `reasoningEffort` is `auto`, `low`, `medium`, or `high`. `inputSourceIds` is 1 to 8 of `transcript`, `audio_recording`, `call_metadata`, `pathway_logs`, `tool_logs`, `variables`, `agent_config`, `call_config`. An audio judge must include `audio_recording`. A structured extraction cannot combine `low` effort with `audio_recording`. **values\[].source.extractorId** `string` `structured_extraction` only, required. UUID of an extractor from [List Extractors](/api-v2/get/agents-id-dispositions-extractors) that is org-wide or scoped to this agent. **values\[].source.extractorVersionId** `string` `structured_extraction` only. UUID of a version of that extractor. Optional while drafting; required to publish or run a test, and publish requires a published (archived) version. **values\[].source.frozen** `object` `structured_extraction` only. Written by the server at publish time with a copy of the pinned extractor's prompt, output schema, and inference configuration. You may echo back the copy you read from the draft or omit it; publish rewrites it either way. **values\[].source.judgeId** `string` `judge` only, required. UUID of a judge from [Get Judge Catalog](/api-v2/get/agents-id-dispositions-judge-catalog) that is org-wide or scoped to this agent. **values\[].source.judgeVersionId** `string` `judge` only, required. UUID of a version of that judge. Publish and test runs require a published (archived) version; a draft may temporarily reference an editable one. **values\[].source.snippetId** `string` `custom_code` only, required. UUID of a code snippet owned by your organization. The snippet must be JavaScript. **values\[].source.snippetVersion** `integer` `custom_code` only, required. Snippet version number, at least `1`. **values\[].source.timeoutSeconds** `integer` `custom_code` only, required. 1 to 60. **values\[].source.connections** `object` `custom_code` only, required (may be `{}`). Up to 20 entries keyed by an alias matching `^[A-Za-z_][A-Za-z0-9_]{0,63}$`, each `{ "resourceId": "uuid", "integration": "optional string" }`. Resources must belong to your organization. **values\[].source.secrets** `object` `custom_code` only, required (may be `{}`). Up to 20 entries keyed by an alias with the same pattern, each `{ "secretId": "uuid" }`. **values\[].source.dependencyValueIds** `array` `custom_code` only, required (may be `[]`). Up to 20 unique value ids whose results are passed to the code. Only `variable_extraction`, `structured_extraction`, and `judge` values may be referenced; a code value cannot depend on itself or on another code value. **transformation** `object` *required* `{ "version": 1, "root": node }`. A node is one of `{ "kind": "value", "valueId" }`, `{ "kind": "literal", "value" }`, `{ "kind": "object", "fields": { name: node } }` with names up to 64 characters, or `{ "kind": "array", "items": [node] }` with up to 50 items. Every referenced `valueId` must exist in `values`. At most 2000 nodes. **postCallWebhook** `object` *required* `{ "mode": "hold" }` or `{ "mode": "emit_followup" }`. `hold` is only valid with `timing: "immediate"`. ### Response **data.dispositionId** `string` The disposition this draft belongs to. **data.revision** `number` The new draft revision, `expectedDraftRevision + 1`. **data.baseVersionId** `string | null` The most recently published version, or `null` if never published. **data.definition** `object` The saved definition, as stored. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "dispositionId": "70195e6f-b0b5-4ade-b851-2a2f25dcbde0", "revision": 4, "baseVersionId": "9cf8e056-0ffa-4acf-853e-c37ecaaa7e64", "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "within_24h", "values": [ { "id": "59ef1515-aa81-4010-bd61-790abdebe92f", "key": "callback_window", "label": "Requested callback window", "schema": { "kind": "string", "description": "Preferred callback time in the caller's words" }, "source": { "kind": "structured_extraction", "extractorId": "cf3403ca-16af-4e5e-ad76-e4c044e6611e", "extractorVersionId": "af6ec0dc-ebf5-47a8-bf8c-4b114cd90ddf", "execution": { "reasoningEffort": "medium", "inputSourceIds": ["transcript"] } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "callback_window": { "kind": "value", "valueId": "59ef1515-aa81-4010-bd61-790abdebe92f" } } } }, "postCallWebhook": { "mode": "emit_followup" } } }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Invalid request body", "ext": "{\"errors\":[\"/expectedDraftRevision: Expected required property\"]}" } ] } ``` ```json Definition Invalid theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Definition failed validation", "ext": "{\"problems\":[{\"valueId\":\"59ef1515-aa81-4010-bd61-790abdebe92f\",\"message\":\"Disposition value schema must exactly match the pinned extractor output schema\"}]}" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Draft revision moved (expected 3) — reload and reapply your change" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Disposition Extractor Draft Source: https://docs.bland.ai/api-v2/patch/agents-id-dispositions-extractors-extractor-id-draft PATCH https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors/{extractor_id}/draft Edit an extractor's editable draft version. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Edits the extractor's `editable` version in place. Only the fields you send change; the merged draft is validated with the same rules as [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors). Published versions are never modified; to make the edited draft pinnable, call [Publish Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors-extractor-id-publish). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. **extractor\_id** `string` *required* The extractor's unique identifier. Must be organization-wide or scoped to this agent; otherwise returns `404` with the message `Disposition extractor not found`. A malformed id returns `400` with the message `extractorId must be a valid UUID`. ### Body Parameters Unknown fields are rejected. A body that fails shape validation returns `400` with the message `Invalid request body`; a merged draft that breaks a prompt, schema, or model-profile rule returns `400` with the message `Extractor definition failed validation`. In both cases the error's `ext` field is a JSON string listing each problem. **expectedVersionId** `string` *required* The extractor's current `currentVersionId`. If another update or publish has moved it, the request returns `409 CONFLICT` with the message `Extractor draft changed; refresh and try again`. **expectedDraftRevision** `integer` *required* The extractor's current `draftRevision`. Minimum `1`. A stale value returns the same `409 CONFLICT`. **name** `string` New display name, 1 to 120 characters. Updates both the extractor record and the draft version. **description** `string | null` New description, up to 2000 characters. Send `null` to clear it. Updates both the extractor record and the draft version. **systemPromptMd** `string` New system prompt in Markdown. Up to 8000 characters and 8000 UTF-8 bytes. **promptMd** `string` New extraction prompt in Markdown. 1 to 8000 characters, up to 8000 UTF-8 bytes, and must contain non-whitespace text. `systemPromptMd` and `promptMd` together may not exceed 16000 UTF-8 bytes. **outputSchema** `object` Replaces the whole output schema. Same shape and limits as on [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors). **inferenceConfig** `object` Replaces the whole inference configuration, so `contextSources` is required inside it. Same fields and limits as on [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors). `modelProfileKey` defaults to `balanced` when omitted. ### Response **data.extractor** `object` The extractor record after the update, with `draftRevision` incremented by `1`. **extractor object** **id** `string` Unique identifier for the extractor. **agentId** `string | null` `null` for an organization-wide extractor. Otherwise the id of the one agent it is scoped to. **key** `string` Stable machine key, unique within your organization. **name** `string` The extractor's display name. **description** `string | null` Optional description. **currentVersionId** `string` Unchanged by this call; the same id as `data.currentVersion.id`. **activeVersionId** `string | null` The most recently published version, or `null` if never published. Unchanged by this call. **draftRevision** `integer` The new revision. Pass it as `expectedDraftRevision` on your next update or publish. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of this update. **data.currentVersion** `object` The updated `editable` version. **version object** **id** `string` Unique identifier for the version. **extractorId** `string` The extractor this version belongs to. **versionNumber** `integer` Unchanged by this call. **state** `string` Always `editable` here. **name** `string` Display name after the update. **description** `string | null` Description after the update. **systemPromptMd** `string` System prompt after the update. Empty string when none is set. **promptMd** `string` Extraction prompt after the update. **outputSchema** `object` Output schema after the update. **inferenceConfig** `object` Inference configuration after the update: `modelProfileKey`, `contextSources`, and, when set, `temperature`, `maxOutputTokens`, and `thinking`. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of this update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "extractor": { "id": "0f1f5c7b-3d6e-47b0-981b-d121f6853552", "agentId": "a1250a05-0ae1-45ca-91e6-1ef7930f0093", "key": "callback_window", "name": "Callback window", "description": "When the caller asked to be called back.", "currentVersionId": "cc5a57dc-1f76-4007-a9ea-47378e50de0c", "activeVersionId": null, "draftRevision": 2, "createdAt": "2026-09-08T10:21:37.902Z", "updatedAt": "2026-09-10T17:05:12.446Z" }, "currentVersion": { "id": "cc5a57dc-1f76-4007-a9ea-47378e50de0c", "extractorId": "0f1f5c7b-3d6e-47b0-981b-d121f6853552", "versionNumber": 1, "state": "editable", "name": "Callback window", "description": "When the caller asked to be called back.", "systemPromptMd": "You extract scheduling details from customer service calls.", "promptMd": "Find the day and time window the caller asked for a callback. Leave fields empty if the caller did not ask for one.", "outputSchema": { "kind": "object", "properties": { "requested": { "kind": "boolean", "description": "Whether the caller asked for a callback." }, "window_start": { "kind": "string", "format": "date-time" }, "window_end": { "kind": "string", "format": "date-time" } }, "required": ["requested"] }, "inferenceConfig": { "modelProfileKey": "high_accuracy", "temperature": 0, "thinking": "medium", "contextSources": ["transcript"] }, "createdAt": "2026-09-08T10:21:37.902Z", "updatedAt": "2026-09-10T17:05:12.446Z" } }, "errors": null } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Extractor draft changed; refresh and try again" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition extractor not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Experiment Source: https://docs.bland.ai/api-v2/patch/agents-id-experiments-experiment-id PATCH https://api.bland.ai/v2/agents/{agent_id}/experiments/{experiment_id} Adjust an active experiment's split or conditions. ### Overview Changes an active experiment's traffic split, schedule, dates, or quota. The variant and baseline are fixed for the experiment's life; to test a different version, [stop it](/api-v2/post/agents-id-experiments-experiment-id-stop) and [create a new one](/api-v2/post/agents-id-experiments). Only the fields below are accepted: any other key returns `400 BAD_REQUEST`, and so does an empty body. Completed experiments cannot be edited and return `409 CONFLICT`, as does a second update that arrives while one is still being applied (retry it). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **experiment\_id** `string` *required* The experiment's unique identifier. Must be a valid UUID; returns `400 BAD_REQUEST` otherwise. ### Body Parameters Send at least one field. Fields you omit keep their current value. **traffic\_percentage** `integer` New share of eligible calls routed to the variant, `1` to `100`. Use this to ramp the variant up or down. **run\_hours** `object | null` New weekly schedule, with the same shape and rules as on [Create Experiment](/api-v2/post/agents-id-experiments): an IANA `timezone` and a `days` object keyed `mon` through `sun` whose values are `{ "start": "HH:mm", "end": "HH:mm" }` windows. Pass `null` to remove the schedule and make the variant always eligible. **starts\_at** `string | null` ISO 8601 datetime before which the variant receives no traffic. Pass `null` to clear it. **ends\_at** `string | null` ISO 8601 datetime at which the experiment completes with `date_ended`. Must be in the future and after the effective `starts_at` (the one in this request, or the stored one if not sent). Pass `null` to remove the end date. **variant\_call\_quota** `integer | null` New cap on connected variant calls, `1` to `1000000`, or `null` for no cap. Lowering it to or below the current `variant_calls_routed` completes the experiment immediately with `quota_reached`, and the response reflects that. ### Response **data.experiment** `object` The experiment after the update. **experiment object** **id** `string` Unique identifier for the experiment. **agent\_id** `string` The agent the experiment belongs to. **status** `string` `active`, or `completed` if the update lowered the quota below the routed count. **completed\_reason** `string | null` `null` while active; `quota_reached` if this update completed the experiment. **baseline\_env** `string` The control environment: `production` or `staging`. Not editable. **baseline\_current\_version\_id** `string | null` The version currently pinned to `baseline_env`, read at request time. **variant\_version\_id** `string` The version under test. Not editable. **traffic\_percentage** `integer` The current share of eligible calls routed to the variant. **run\_hours** `object | null` The current weekly schedule, or `null` when always eligible. **starts\_at** `string | null` When variant traffic begins, or `null` for immediately. **ends\_at** `string | null` When the experiment completes on its own, or `null` for no end date. **variant\_call\_quota** `integer | null` The current cap on connected variant calls, or `null` for no cap. **variant\_calls\_routed** `integer` Connected calls routed to the variant so far. **created\_by** `string | null` ID of the user who created the experiment, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **completed\_at** `string | null` `null` while active. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "experiment": { "id": "f4e3870b-7e35-4088-9855-917de3633c54", "agent_id": "ff4b135e-2a7e-48e3-9e75-1303718b2f9d", "status": "active", "completed_reason": null, "baseline_env": "production", "baseline_current_version_id": "41cf1621-96cc-4f7c-8f9c-a8456b65b9fe", "variant_version_id": "82a83fe3-719f-45f8-9207-4424aac1a26d", "traffic_percentage": 50, "run_hours": null, "starts_at": null, "ends_at": "2026-10-01T00:00:00.000Z", "variant_call_quota": 2000, "variant_calls_routed": 318, "created_by": "499bd008-10c1-4fb9-841e-87e1961b5904", "created_at": "2026-09-08T12:40:19.221Z", "completed_at": null } }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "\"variant_version_id\" is not an updatable field (allowed: traffic_percentage, run_hours, starts_at, ends_at, variant_call_quota)" } ] } ``` ```json Completed theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Completed experiments cannot be edited" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Experiment not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Agent Source: https://docs.bland.ai/api-v2/post/agents POST https://api.bland.ai/v2/agents Create an agent with empty dev, staging, and production environments. ### Overview Creates an agent and its three environments (`dev`, `staging`, `production`) in one step. The environments start unpinned; save a version with [Create Agent Version](/api-v2/post/agents-id-versions) and promote it to pin one. To build an agent from the dashboard instead, see [Build your first agent](/build-your-first-agent). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* Display name for the agent. Must be non-empty after trimming whitespace. Returns `400 INVALID_NAME` otherwise. ### Response Returns `201` on success. **data.agent** `object` The new agent. **agent object** **id** `string` Unique identifier for the agent. **org\_id** `string` The organization that owns the agent. **name** `string` The agent's display name. **created\_by** `string | null` ID of the user who created the agent, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of the last update. **deleted\_at** `null` Always `null` on a live agent. **data.environments** `array` The agent's three environments, all unpinned. **environment object** **id** `string` Unique identifier for the environment. **env\_type** `string` One of `dev`, `staging`, `production`. **current\_version\_id** `string | null` The version this environment is pinned to. `null` until a version is published or promoted into it. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "agent": { "id": "2f2750b7-fed3-4798-992a-421ccf8b93b2", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Front desk", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T22:59:51.569Z", "updated_at": "2026-09-10T22:59:51.569Z", "deleted_at": null }, "environments": [ { "id": "7a043546-b896-4680-80e4-5eb9cbde6977", "env_type": "dev", "current_version_id": null }, { "id": "ab412aa2-8827-4e12-ad45-9a964c2c8690", "env_type": "staging", "current_version_id": null }, { "id": "1595512d-ea18-4692-a40b-6c90932396b4", "env_type": "production", "current_version_id": null } ] }, "errors": null } ``` ```json Invalid Name theme={null} { "data": null, "errors": [ { "error": "INVALID_NAME", "message": "name must be a non-empty string" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Archive Agent Node Source: https://docs.bland.ai/api-v2/post/agents-id-archived-nodes POST https://api.bland.ai/v2/agents/{agent_id}/archived-nodes Copy a node from an agent into the organization archive. ### Overview Stores a self-contained copy of a node in the organization archive, attributed to this agent, so you can retire it from the canvas without losing it. Archiving never changes the agent's graph: remove the node yourself by saving a new version with [Create Agent Version](/api-v2/post/agents-id-versions). Browse the archive with [List Archived Nodes](/api-v2/get/agents-library-archived-nodes). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent the node is being archived from. Returns `404 NOT_FOUND` if the agent does not exist in your organization. ### Body Parameters **node** `object` *required* The node to archive, exactly as it appears in a version snapshot's `behavior.nodes`. Must have a non-empty string `id`, a non-empty string `type`, a `position` object with finite numeric `x` and `y`, and an object `data`. A container node's `data.flow` is validated too: every nested node needs `id`, `position`, and `data`, every nested edge needs string `id`, `source`, and `target` that reference nodes in the same flow, and flows may nest at most 10 levels deep. The serialized node may not exceed 1,048,576 bytes. Returns `400 INVALID_NODE` with one error entry per problem. ### Response Returns `201` on success. **data** `object` The new archive entry. **archived node object** **id** `string` Unique identifier for the archive entry. Use it with [Delete Archived Node](/api-v2/delete/agents-library-archived-nodes-archived-node-id). **agent\_id** `string | null` The agent the node was archived from. **agent\_name** `string | null` The agent's name at archive time. **name** `string` Taken from `node.data.name`, or `Untitled node` when absent. **kind** `string` The value of `node.type`. **description** `string | null` The first 160 characters of `node.data.rule`, or of `node.data.prompt` when there is no rule. `null` when the node has neither. **node** `object` The node payload as submitted. **created\_at** `string` ISO 8601 timestamp of when the node was archived. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "ae798cb1-375c-425e-978f-cb2c0ccd5e29", "agent_id": "faa42069-ed8e-4c07-bdf3-3bee134aa033", "agent_name": "Front desk", "name": "Holiday hours", "kind": "scenario", "description": "Tell the caller the office is closed for the holiday and offer to take a message.", "node": { "id": "db7272f8-7c8e-43f5-a442-a30883026bab", "type": "scenario", "position": { "x": 380, "y": 260 }, "data": { "name": "Holiday hours", "rule": "Tell the caller the office is closed for the holiday and offer to take a message.", "target": { "kind": "dialogue", "label": "Holiday hours" }, "loopWhile": "", "variables": [ { "id": "f0bf6e1f-cffa-41bc-a615-31d426c7eb89", "key": "callback_number", "value": "The phone number the caller wants to be reached at", "type": "string", "accurateSpelling": true } ], "entry": { "mode": "llm", "label": "Asks about hours", "description": "", "alwaysPick": false, "conditions": [] } } }, "created_at": "2026-09-10T18:21:07.442Z" }, "errors": null } ``` ```json Invalid Node theme={null} { "data": null, "errors": [ { "error": "INVALID_NODE", "message": "node.type must be a non-empty string" }, { "error": "INVALID_NODE", "message": "node.position must be { x: number, y: number }" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Agent Branch Source: https://docs.bland.ai/api-v2/post/agents-id-branches POST https://api.bland.ai/v2/agents/{agent_id}/branches Create a branch off the agent's dev head. ### Overview Cuts a new branch from the agent's newest dev version. Versions saved to the branch stay off the dev timeline until you land them with [Merge Agent Branch](/api-v2/post/agents-id-branches-branch-id-merge). Use [List Agent Branches](/api-v2/get/agents-id-branches) to see what is open. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **name** `string` *required* The branch name. Trimmed, then must be 1 to 64 characters using only letters, numbers, dots, underscores, and dashes. The names `dev`, `latest`, `staging`, and `production` (any casing) and anything shaped like a version number (for example `1.2.0`) are reserved for version selectors. Any of these problems returns `400 INVALID_NAME` with a message naming the rule. Returns `409 BRANCH_EXISTS` when an open branch already has this name; names of merged or deleted branches can be reused. ### Response Returns `201` on success. **data** `object` The new branch. **branch object** **id** `string` Unique identifier for the branch. Pass it as `{branch_id}` on the other branch endpoints. **agent\_id** `string` The agent the branch belongs to. **name** `string` The trimmed branch name. **base\_version\_id** `string | null` The dev version the branch was cut from. `null` when the agent has no saved versions yet. **created\_by** `string | null` ID of the user who created the branch, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **behind** `boolean` Always `false` on a newly created branch. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "08aacbb3-6f83-4542-a7c0-1fd07b5b3d47", "agent_id": "f4f9fe3f-a996-49a6-934d-6b78b144d43b", "name": "billing-questions", "base_version_id": "0b6b3dba-0c8c-4ee2-a992-4a7bc2f35e25", "created_by": "0d5eee46-6f39-462b-b347-79ff13cf3cf2", "created_at": "2026-09-10T17:42:18.093Z", "behind": false }, "errors": null } ``` ```json Invalid Name theme={null} { "data": null, "errors": [ { "error": "INVALID_NAME", "message": "\"staging\" is reserved for version selectors" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "BRANCH_EXISTS", "message": "An open branch with this name already exists" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Merge Agent Branch Source: https://docs.bland.ai/api-v2/post/agents-id-branches-branch-id-merge POST https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/merge Fast-forward a branch into the agent's dev timeline. ### Overview Lands the branch on dev as a fast-forward: the branch's newest version becomes one new dev version, and the branch is closed. A fast-forward is only possible while the branch's base is still dev's newest version. If dev has moved, the request returns `409 BRANCH_BEHIND`; run [Preview Agent Branch Rebase](/api-v2/post/agents-id-branches-branch-id-rebase-preview) and [Rebase Agent Branch](/api-v2/post/agents-id-branches-branch-id-rebase), then merge again. Takes no body. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **branch\_id** `string` *required* The branch's unique identifier. Must be an open branch on this agent, and must have at least one version saved to it; a branch with no saves of its own returns `400 NO_CHANGES`. ### Response **data.version** `object` The new dev version. Its `snapshot` is the branch head's configuration. The branch no longer appears in [List Agent Branches](/api-v2/get/agents-id-branches). **version object** **id** `string` Unique identifier for the version. This is now dev's newest version. **org\_id** `string` The organization that owns the agent. **agent\_id** `string` The agent the version belongs to. **branch\_id** `null` Always `null`; the merged version lives on dev, not on the branch. **snapshot** `object` The agent configuration: `behavior` (nodes and edges), `settings`, `contact`, and `knowledge` when present. Same shape as the `snapshot` on any saved version. **name** `null` Always `null`; merge versions are unnamed. **created\_via** `string` Always `manual` for a merge version. **revision** `integer` Rewrite counter for the row. `0` on a newly written version. **created\_by** `string | null` ID of the user who merged, or `null` when merged with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "version": { "id": "06e7531f-d327-440f-b17c-cfef565935de", "org_id": "eac199ff-428f-4c48-8835-b7831cadc2a2", "agent_id": "a724172e-d676-42f3-8566-29f04e9c1a89", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "cf5b80db-9199-4cf8-af79-5f1e51adb6ef", "position": { "x": 240, "y": 120 }, "data": { "name": "Verify account", "rule": "Confirm the caller's name, then ask for the account number." } } ], "edges": [] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.", "voice": "maya", "languages": ["en-US"] }, "contact": { "inboundNumbers": [] } }, "name": null, "created_via": "manual", "revision": 0, "created_by": "3c1c51e0-e993-4bb5-a471-fe67db6e7006", "created_at": "2026-09-10T18:09:52.204Z" } }, "errors": null } ``` ```json Branch Behind theme={null} { "data": null, "errors": [ { "error": "BRANCH_BEHIND", "message": "Development moved past this branch — rebase before merging" } ] } ``` ```json No Changes theme={null} { "data": null, "errors": [ { "error": "NO_CHANGES", "message": "The branch has no saved changes to merge" } ] } ``` ```json Merge In Progress theme={null} { "data": null, "errors": [ { "error": "MERGE_IN_PROGRESS", "message": "Another merge or rebase is in progress for this agent, please retry" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent or branch not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Rebase Agent Branch Source: https://docs.bland.ai/api-v2/post/agents-id-branches-branch-id-rebase POST https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase Rebase a branch onto the dev head with resolutions. ### Overview Rebases the branch onto the dev head you previewed against: re-runs the three-way merge, applies your conflict resolutions, saves the merged configuration as a new version on the branch, and moves the branch's base to that dev head. Run [Preview Agent Branch Rebase](/api-v2/post/agents-id-branches-branch-id-rebase-preview) first to get `dev_head_version_id` and the conflict IDs. Once the rebase succeeds, [Merge Agent Branch](/api-v2/post/agents-id-branches-branch-id-merge) fast-forwards. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **branch\_id** `string` *required* The branch's unique identifier. Must be an open branch on this agent. ### Body Parameters **dev\_head\_version\_id** `string | null` *required* The `dev_head_version_id` returned by the preview, passed unchanged (including `null` when the preview returned `null`). If dev has gained a version since, the request returns `409 REBASE_STALE`; preview again and retry. Omitting the field is treated as `null` and fails the same way whenever dev has any version. **resolutions** `object` Map from conflict `id` (as reported by the preview) to how to settle it. Each value is one of: * `"ours"`: keep the branch's value. * `"theirs"`: take dev's value. * `{ "value": ... }`: write this value in place of both. Any JSON value is accepted; the merged configuration is validated as a whole before it is saved. Any other shape returns `400 INVALID_RESOLUTIONS` and nothing is written. Every conflict the merge finds must be covered, or the request returns `400 UNRESOLVED_CONFLICTS` and nothing is written. That error does not list which conflicts are outstanding, so build your resolutions from [Preview Agent Branch Rebase](/api-v2/post/agents-id-branches-branch-id-rebase-preview), which returns the full conflict set. Omit when the preview reported no conflicts. ```json theme={null} { "setting:systemPrompt": "theirs", "node:ae527fa3-25f4-4dbb-ba79-fe7b6aa6b075#data.rule": { "value": "Confirm the caller's name, then ask for the account number." } } ``` ### Response **data.version** `object` The new branch version holding the merged configuration. When the branch is already based on dev's head, nothing is written and the branch's current head version is returned instead. **version object** **id** `string` Unique identifier for the version. **org\_id** `string` The organization that owns the agent. **agent\_id** `string` The agent the version belongs to. **branch\_id** `string` The branch the version was saved to. Matches `{branch_id}`. **snapshot** `object` The merged agent configuration: `behavior` (nodes and edges), `settings`, `contact`, and `knowledge` when present. Same shape as the `snapshot` on any saved version. **name** `null` Always `null`; rebase versions are unnamed. **created\_via** `string` Always `manual` for a rebase version. **revision** `integer` Rewrite counter for the row. `0` on a newly written version. **created\_by** `string | null` ID of the user who ran the rebase, or `null` when run with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "version": { "id": "f9b3ef64-22f7-4189-8a90-2a08a2e233fa", "org_id": "739122d8-a8fb-4b92-b65c-718b25b73431", "agent_id": "4f2abf11-7131-4935-9b8a-aa92cc4447c8", "branch_id": "69e0956d-561e-4c3a-8b6b-d60a84c928b4", "snapshot": { "behavior": { "nodes": [ { "id": "39645cd3-c7a3-4261-9b62-4fbc8155fd76", "position": { "x": 240, "y": 120 }, "data": { "name": "Verify account", "rule": "Confirm the caller's name, then ask for the account number." } } ], "edges": [] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.", "voice": "maya", "languages": ["en-US"] }, "contact": { "inboundNumbers": [] } }, "name": null, "created_via": "manual", "revision": 0, "created_by": "435b84b8-7237-4007-a95c-a9e4515d1255", "created_at": "2026-09-10T18:02:37.518Z" } }, "errors": null } ``` ```json Unresolved Conflicts theme={null} { "data": null, "errors": [ { "error": "UNRESOLVED_CONFLICTS", "message": "Every conflict needs a resolution" } ] } ``` ```json Stale theme={null} { "data": null, "errors": [ { "error": "REBASE_STALE", "message": "Development changed since the preview — preview again" } ] } ``` ```json Invalid Resolutions theme={null} { "data": null, "errors": [ { "error": "INVALID_RESOLUTIONS", "message": "resolutions must map conflict ids to 'ours', 'theirs', or { value }" } ] } ``` ```json Merge In Progress theme={null} { "data": null, "errors": [ { "error": "MERGE_IN_PROGRESS", "message": "Another merge or rebase is in progress for this agent, please retry" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Preview Agent Branch Rebase Source: https://docs.bland.ai/api-v2/post/agents-id-branches-branch-id-rebase-preview POST https://api.bland.ai/v2/agents/{agent_id}/branches/{branch_id}/rebase-preview Preview a branch rebase onto the current dev head. ### Overview Dry-runs a three-way merge of the branch onto dev's current head and reports what a rebase would bring in from dev (`changes`) and where dev and the branch changed the same value differently (`conflicts`). This is a POST but it writes nothing and takes no body. Call it after [Merge Agent Branch](/api-v2/post/agents-id-branches-branch-id-merge) returns `409 BRANCH_BEHIND`, then pass the returned `dev_head_version_id` and a resolution for every conflict to [Rebase Agent Branch](/api-v2/post/agents-id-branches-branch-id-rebase). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **branch\_id** `string` *required* The branch's unique identifier. Must be an open branch on this agent. ### Response **data.dev\_head\_version\_id** `string | null` The dev version the preview ran against. Pass this unchanged to Rebase Agent Branch. `null` when the agent has no dev versions. **data.up\_to\_date** `boolean` `true` when the branch's base is already dev's head (or the agent has no dev versions), so there is nothing to rebase and a merge would fast-forward. `changes` and `conflicts` are empty in that case. **data.auto\_merged** `integer` Number of entries in `changes`. **data.changes** `array` Dev-side edits the branch did not touch. They merge in automatically on rebase; nothing is required from you. **change object** **id** `string` Stable identifier, `kind:key` or `kind:key#path`. **kind** `string` One of `node`, `edge`, `setting`, `contact`, `knowledge`. **key** `string` The node or edge ID, or the `settings`, `contact`, or `knowledge` field name. **path** `string` Dot path to the changed value inside that unit. Empty string when the whole unit changed, such as an added or deleted node. **path\_labels** `array` Display labels aligned with `path`, with element IDs replaced by names where available. **label** `string` Human-readable name of the unit, such as a node's name or a setting's field name. **base** `any` The value at `path` on the branch's base. Omitted when dev added the value. **theirs** `any` Dev's current value at `path`. Omitted when dev deleted the value. **data.conflicts** `array` Values changed differently on both sides. Each needs a resolution before the rebase succeeds; key your `resolutions` map by the conflict's `id`. **conflict object** **id** `string` Stable identifier, `kind:key` or `kind:key#path`. Use it as the key in the `resolutions` body of Rebase Agent Branch. **kind** `string` One of `node`, `edge`, `setting`, `contact`, `knowledge`. **key** `string` The node or edge ID, or the `settings`, `contact`, or `knowledge` field name. **path** `string` Dot path to the conflicting value inside that unit. Empty string when the whole unit conflicts, such as one side deleting a node the other edited. **path\_labels** `array` Display labels aligned with `path`. **label** `string` Human-readable name of the unit. **base** `any` The value on the branch's base. Omitted when both sides added the value. **theirs** `any` Dev's value. Omitted when dev deleted it. **ours** `any` The branch's value. Omitted when the branch deleted it. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b", "up_to_date": false, "auto_merged": 1, "changes": [ { "id": "node:40f4b50d-46a3-4235-99b7-09a299ce628c#data.rule", "kind": "node", "key": "40f4b50d-46a3-4235-99b7-09a299ce628c", "path": "data.rule", "path_labels": ["data", "rule"], "label": "Verify account", "base": "Ask for the account number and confirm the last four digits.", "theirs": "Ask for the account number, then confirm the last four digits and the billing zip code." } ], "conflicts": [ { "id": "setting:systemPrompt", "kind": "setting", "key": "systemPrompt", "path": "", "path_labels": [], "label": "systemPrompt", "base": "You are the front desk assistant for Northwind Dental.", "theirs": "You are the front desk assistant for Northwind Dental. Keep answers under two sentences.", "ours": "You are the scheduling assistant for Northwind Dental. Always offer the next two open slots." } ] }, "errors": null } ``` ```json Up To Date theme={null} { "data": { "dev_head_version_id": "50dc2b1d-854f-4403-8c26-e845238cc03b", "up_to_date": true, "auto_merged": 0, "changes": [], "conflicts": [] }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent or branch not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Cancel Check Run Source: https://docs.bland.ai/api-v2/post/agents-id-check-runs-run-id-cancel POST https://api.bland.ai/v2/agents/{agent_id}/check-runs/{run_id}/cancel Cancel a pending or running check run. ### Overview Marks a `PENDING` or `RUNNING` run `CANCELLED` and stops its scoring work. A cancelled run never produces a final verdict, and cancelling frees the environment so a new run can be started with [Start Check Run](/api-v2/post/agents-id-environments-env-check-runs). Returns `409 CONFLICT` when the run is already `PASSED`, `FAILED`, `ERROR`, or `CANCELLED`. Cancelling never changes an environment pointer. Requires an admin, owner, operator, or prompter role. This endpoint takes no body. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **run\_id** `string` *required* The check run's unique identifier. ### Response **data** `object` The cancelled run, with `status` set to `CANCELLED` and `completed_at` set to the cancellation time. **check run object** **id** `string` Unique identifier for the check run. **agent\_id** `string` The agent the run belongs to. **env\_type** `string` The environment whose checks were run: `staging` or `production`. **agent\_version\_id** `string` The candidate version the run was scoring. **semver** `string | null` The candidate's published version number, or `null` if it has never been published. **version\_name** `string | null` The candidate's saved name, or `null` if it has none. **status** `string` Always `CANCELLED` on success. **judge\_names** `array` Display names of the judges frozen into the run when it started. **scenario\_count** `integer` Number of scenarios the run was driving conversations from. **simulations\_count** `integer` Conversations generated per scenario. **overall\_passed** `boolean | null` `null` for a cancelled run. **verdicts** `array | null` `null` for a cancelled run. See [Get Check Run](/api-v2/get/agents-id-check-runs-run-id) for the verdict object. **simulation\_set\_id** `string | null` ID of the generated conversation set, if generation had started. **eval\_run\_id** `string | null` ID of the scoring run, if scoring had started. **error\_message** `string | null` `null` unless the run had already hit an error. **triggered\_by** `string | null` ID of the user who started the run, or `null` when started with an org-level key. **created\_at** `string` ISO 8601 timestamp the run was created. **started\_at** `string | null` When scoring began, or `null` if the run was cancelled while `PENDING`. **completed\_at** `string | null` The cancellation time. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "9eab4005-81c7-46c4-b4af-cd219844dd53", "agent_id": "358f36b8-91ea-4c19-90ed-f1ebc9f861c9", "env_type": "staging", "agent_version_id": "a26b7ffd-7f60-4f62-9592-861d40fdac3c", "semver": null, "version_name": "Trim hold music prompt", "status": "CANCELLED", "judge_names": ["Resolution quality"], "scenario_count": 3, "simulations_count": 5, "overall_passed": null, "verdicts": null, "simulation_set_id": "9d76db16-4da7-450f-9c78-f72539731e1e", "eval_run_id": null, "error_message": null, "triggered_by": "1473e1e7-c185-4c56-85fb-dab8863394b3", "created_at": "2026-09-10T19:22:07.530Z", "started_at": "2026-09-10T19:22:10.088Z", "completed_at": "2026-09-10T19:25:41.962Z" }, "errors": null } ``` ```json Not Cancellable theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Check run is not in a cancellable state" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Check run not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Disposition Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions POST https://api.bland.ai/v2/agents/{agent_id}/dispositions Create a disposition with an initial draft definition. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Creates a disposition on the agent with the supplied definition as its draft. The disposition starts `disabled` and does not run on calls until you [estimate](/api-v2/post/agents-id-dispositions-disposition-id-estimates) and [publish](/api-v2/post/agents-id-dispositions-disposition-id-publish) it. Edit the draft later with [Update Disposition Draft](/api-v2/patch/agents-id-dispositions-disposition-id-draft). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. ### Body Parameters Unknown fields anywhere in the body are rejected. **key** `string` *required* Stable slug for the disposition, 1 to 64 characters matching `^[a-z][a-z0-9_]*$`. Unique per agent; returns `409 CONFLICT` if another live disposition on this agent already uses it. Cannot be changed after creation. **definition** `object` *required* The full disposition definition. Schema violations return `400 BAD_REQUEST` with message `Invalid request body` and an `ext` string listing each failing path. Rule violations (a judge pin that does not exist, a duplicate value key, a transformation that references an unknown value id) return `400 BAD_REQUEST` with message `Definition failed validation` and an `ext` string carrying `problems`, each with `valueId` and `message`. Drafts are validated less strictly than publishing: a `structured_extraction` value may omit its version pin, and judge or extractor pins may still be editable. ```json theme={null} { "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "timing": "immediate", "values": [ { "id": "c60ed698-7680-4a76-8bf9-da4de408460b", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "judge", "judgeId": "3fec6d8e-053b-4d6b-9544-4bf559a13a1a", "judgeVersionId": "f3a84fb2-81d9-41e7-95e3-3d1f7e44fb31", "execution": { "reasoningEffort": "auto", "inputSourceIds": ["transcript"] } } }, { "id": "e515708f-fa72-4786-90cd-3f4d3696ffcd", "key": "callback_window", "label": "Requested callback window", "schema": { "kind": "string", "description": "Preferred callback time in the caller's words" }, "source": { "kind": "structured_extraction", "extractorId": "8986922b-f300-47c5-8c5d-f506d59c82ab", "extractorVersionId": "8e503b95-67ca-4754-a058-d3ac7b88a217", "execution": { "reasoningEffort": "medium", "inputSourceIds": ["transcript"] } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "booked": { "kind": "value", "valueId": "c60ed698-7680-4a76-8bf9-da4de408460b" }, "callback_window": { "kind": "value", "valueId": "e515708f-fa72-4786-90cd-3f4d3696ffcd" } } } }, "postCallWebhook": { "mode": "emit_followup" } } ``` **definition object** **name** `string` *required* Display name, 1 to 120 characters. **description** `string` *required* Free-text description, up to 2000 characters. May be empty. **timing** `string` *required* `immediate` runs within 30 minutes of call completion. `within_24h` queues the run with a 24-hour deadline. **values** `array` *required* Up to 50 value objects. Each value produces one field of the result. Value `id`s and `key`s must be unique within the definition. A definition with no values can be saved but not published or tested. **values\[].id** `string` *required* A UUID you generate. It is the value's permanent identity: results, corrections, and the transformation all refer to it. Keep it stable across draft edits. **values\[].key** `string` *required* Payload field name, 1 to 64 characters matching `^[a-z][a-z0-9_]*$`. May change between drafts. **values\[].label** `string` *required* Human-readable label, 1 to 120 characters. **values\[].schema** `object` *required* The value's output shape. `kind` is one of `boolean`, `string`, `number`, `enum`, `array`, or `object`; every kind accepts an optional `description` up to 2000 characters. `string` accepts `format: "date-time"`. `enum` requires `options`: 1 to 24 entries of `{ "key", "label" }` with `key` 1 to 64 characters, `label` 1 to 120, and keys unique. `array` requires `items` (a nested schema) and accepts `minItems` (at least 0) and `maxItems` (at least 1); neither may exceed 1000 and `minItems` may not exceed `maxItems`. `object` requires `properties` (a map of names up to 64 characters to nested schemas, at most 64 of them) and `required` (unique names that all appear in `properties`). A schema may not exceed 200 nodes, 8 levels of nesting, or 64 KB. **values\[].source** `object` *required* How the value is produced. `kind` selects one of four shapes; the fields for each kind are listed below. A `judge` value's schema must be `boolean` or an `enum` whose keys exactly match the judge's level keys (a pass/fail judge maps to `boolean` or a two-option `pass` and `fail` enum). A `structured_extraction` value's schema must exactly match the pinned extractor's output schema. A `variable_extraction` value's schema must exactly match the `outputSchema` of the matching entry in [Get Variable Catalog](/api-v2/get/agents-id-dispositions-variable-catalog). **values\[].source.kind** `string` *required* One of `variable_extraction`, `structured_extraction`, `judge`, or `custom_code`. **values\[].source.variableKey** `string` `variable_extraction` only, required. Key of an existing variable on the agent, 1 to 128 characters matching `^[A-Za-z_][A-Za-z0-9_.-]{0,127}$`. The variable's extraction is re-run against the corrected post-call transcript. The variable must exist in the agent's current configuration. **values\[].source.execution** `object` For `variable_extraction`, optional `{ "reasoningEffort" }` defaulting to `auto`. For `structured_extraction` and `judge`, required `{ "reasoningEffort", "inputSourceIds" }`. `reasoningEffort` is `auto`, `low`, `medium`, or `high`. `inputSourceIds` is 1 to 8 of `transcript`, `audio_recording`, `call_metadata`, `pathway_logs`, `tool_logs`, `variables`, `agent_config`, `call_config`. An audio judge must include `audio_recording`. A structured extraction cannot combine `low` effort with `audio_recording`. **values\[].source.extractorId** `string` `structured_extraction` only, required. UUID of an extractor from [List Extractors](/api-v2/get/agents-id-dispositions-extractors) that is org-wide or scoped to this agent. **values\[].source.extractorVersionId** `string` `structured_extraction` only. UUID of a version of that extractor. Optional while drafting; required to publish or run a test, and publish requires a published (archived) version. **values\[].source.frozen** `object` `structured_extraction` only. Written by the server at publish time with a copy of the pinned extractor's prompt, output schema, and inference configuration. Omit it. **values\[].source.judgeId** `string` `judge` only, required. UUID of a judge from [Get Judge Catalog](/api-v2/get/agents-id-dispositions-judge-catalog) that is org-wide or scoped to this agent. **values\[].source.judgeVersionId** `string` `judge` only, required. UUID of a version of that judge. Publish and test runs require a published (archived) version; a draft may temporarily reference an editable one. **values\[].source.snippetId** `string` `custom_code` only, required. UUID of a code snippet owned by your organization. The snippet must be JavaScript. **values\[].source.snippetVersion** `integer` `custom_code` only, required. Snippet version number, at least `1`. **values\[].source.timeoutSeconds** `integer` `custom_code` only, required. 1 to 60. **values\[].source.connections** `object` `custom_code` only, required (may be `{}`). Up to 20 entries keyed by an alias matching `^[A-Za-z_][A-Za-z0-9_]{0,63}$`, each `{ "resourceId": "uuid", "integration": "optional string" }`. Resources must belong to your organization. **values\[].source.secrets** `object` `custom_code` only, required (may be `{}`). Up to 20 entries keyed by an alias with the same pattern, each `{ "secretId": "uuid" }`. **values\[].source.dependencyValueIds** `array` `custom_code` only, required (may be `[]`). Up to 20 unique value ids whose results are passed to the code. Only `variable_extraction`, `structured_extraction`, and `judge` values may be referenced; a code value cannot depend on itself or on another code value. **transformation** `object` *required* `{ "version": 1, "root": node }`. A node is one of `{ "kind": "value", "valueId" }`, `{ "kind": "literal", "value" }`, `{ "kind": "object", "fields": { name: node } }` with names up to 64 characters, or `{ "kind": "array", "items": [node] }` with up to 50 items. Every referenced `valueId` must exist in `values`. At most 2000 nodes. **postCallWebhook** `object` *required* `{ "mode": "hold" }` or `{ "mode": "emit_followup" }`. `hold` delays the call's post-call webhook until this disposition's results are ready and is only valid with `timing: "immediate"`. `emit_followup` sends results in a separate follow-up webhook. ### Response Returns `201` on success. **data** `object` The new disposition summary. **disposition object** **id** `string` Unique identifier for the disposition. **agentId** `string` The agent this disposition belongs to. **key** `string` The slug you supplied. **state** `string` Always `disabled` on a new disposition. **publishedVersionId** `null` Always `null` on a new disposition. **publishedVersionNumber** `null` Always `null` on a new disposition. **draftRevision** `number` Always `1` on a new disposition. Pass it as `expectedDraftRevision` on the first draft update. **draftValueCount** `number` Number of values in the definition you supplied. **hasUnpublishedChanges** `boolean` Always `true` on a new disposition. **name** `string` The definition's name. **description** `string` The definition's description. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of creation. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "cdc753be-4f30-454f-99bf-aec7ba366875", "agentId": "7b72e5e3-362d-4b98-acd6-6929e9ed3995", "key": "appointment_outcome", "state": "disabled", "publishedVersionId": null, "publishedVersionNumber": null, "draftRevision": 1, "draftValueCount": 2, "hasUnpublishedChanges": true, "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "createdAt": "2026-09-10T18:02:11.418Z", "updatedAt": "2026-09-10T18:02:11.418Z" }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Invalid request body", "ext": "{\"errors\":[\"/key: Expected string to match '^[a-z][a-z0-9_]*$'\"]}" } ] } ``` ```json Definition Invalid theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Definition failed validation", "ext": "{\"problems\":[{\"valueId\":\"c60ed698-7680-4a76-8bf9-da4de408460b\",\"message\":\"Pinned judge version does not exist\"}]}" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "A disposition with key \"appointment_outcome\" already exists" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Disable Disposition Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-disable POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/disable Stop a disposition from running on new calls. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Sets `state` to `disabled` so the disposition no longer runs on new completed calls. The request takes no body. The draft, version history, and `publishedVersionId` are left untouched, and test runs still work. There is no separate enable call: to turn it back on, [publish](/api-v2/post/agents-id-dispositions-disposition-id-publish) the draft again, which creates a new version and sets `state` to `enabled`. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Response **data** `object` The updated disposition summary. **disposition object** **id** `string` Unique identifier for the disposition. **agentId** `string` The agent this disposition belongs to. **key** `string` Stable slug, unique per agent. **state** `string` Always `disabled` after this call. **publishedVersionId** `string | null` Unchanged: the most recently published version, or `null` if never published. **publishedVersionNumber** `number | null` Unchanged. **draftRevision** `number` Unchanged. Disabling is not a draft write. **draftValueCount** `number` Number of values in the current draft definition. **hasUnpublishedChanges** `boolean` `true` when the draft differs from the published version. **name** `string` The draft definition's name. **description** `string` The draft definition's description. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of this update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "81ac0fe3-ae66-4d43-b388-1e66237c342d", "agentId": "dbca575b-2060-40db-ab94-9bf0055db8d0", "key": "appointment_outcome", "state": "disabled", "publishedVersionId": "06fbabaa-668d-4699-9fa6-a798f2627ab7", "publishedVersionNumber": 2, "draftRevision": 5, "draftValueCount": 2, "hasUnpublishedChanges": false, "name": "Appointment outcome", "description": "Did the caller book, and did they ask for a callback?", "createdAt": "2026-08-30T15:21:04.118Z", "updatedAt": "2026-09-10T19:03:27.640Z" }, "errors": null } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Estimate Disposition Cost Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-estimates POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/estimates Estimate a disposition's per-call cost before publishing. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Prices the current draft as it would execute once published and returns a per-value and total cost range in USD per processed call. The request takes no body. The estimate is stateless: its `id` is a digest of the draft, its pinned dependencies, and the current pricing basis, so the same draft always yields the same `id`, and any change yields a new one. Pass the `id` as `estimateId` to [Publish Disposition](/api-v2/post/agents-id-dispositions-disposition-id-publish), which recomputes it and rejects a stale one. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Response All money fields are USD per processed call, formatted as decimal strings with four places (for example `"0.0198"`, just under two cents). They include Bland's margin. `min`, `expected`, and `max` are usage scenarios at 0.6x, 1x, and 1.6x of the assumed input and output volumes for a representative call; they are forecasts, not caps. **data.id** `string` Deterministic estimate id, UUID-shaped. Identical for identical inputs. Pass it as `estimateId` when publishing. **data.dispositionId** `string` The disposition that was priced. **data.draftRevision** `number` The draft revision that was priced. Pass the same value as `expectedDraftRevision` when publishing. **data.perValue** `array` One entry per value in the draft, in definition order. **per-value object** **valueId** `string` The value's id. **executionPath** `string` Human-readable label of how the value is produced and billed, for example `Judge · Automatic Intelligence`, `Structured extraction · Medium Intelligence`, `Variable extraction · High Intelligence`, or `Custom code · metered invocation`. When two values share one judge invocation, the second reads `Judge · shared invocation already included` and is priced at zero. The one value that carries the once-per-call corrected transcript pass has ` + corrected transcript (once per call, shared)` appended. **usdPerCall** `object` `{ "min", "expected", "max" }` in USD per call for this value alone. **data.totalUsdPerCall** `object` `{ "min", "expected", "max" }` in USD per call, the sum across `perValue`. **data.assumptions** `object` The fixed inputs behind the forecast. **assumptions object** **averageDurationSeconds** `number` Assumed call length in seconds, currently `254`. Drives audio input volume and the corrected transcript charge. **timing** `string` The draft's `timing`: `immediate` or `within_24h`. **modelCostRange** `string` Always `usage_scenarios`: `min`, `expected`, and `max` are 0.6x, 1x, and 1.6x of the assumed token volumes. **customCode** `object` How `custom_code` values are billed. `billingPolicy` is `monthly_free_tier` (metered at list price after a free monthly allowance) or `enterprise_included` (included, quoted at zero). `monthlyFreeInvocations` is the allowance, currently `1000`. `listPriceUsdPerInvocation` is the list price as a decimal string, currently `"0.0010"`. `freeTierScope` is always `organization`. Under `monthly_free_tier` a code value's `min` is `0.0000` and its `expected` and `max` equal the list price. **data.quoteConfigVersion** `string` Version tag of the pricing assumptions, currently `v3-intelligence-routing`. Changes when the forecast model changes. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "541b9cf3-77fa-4f99-95de-356e656c5670", "dispositionId": "16fc16fe-92af-4e8b-9459-28e10b05f287", "draftRevision": 3, "perValue": [ { "valueId": "91b9a987-ee08-4018-a433-5a7a5d03dade", "executionPath": "Judge · Automatic Intelligence", "usdPerCall": { "min": "0.0121", "expected": "0.0198", "max": "0.0312" } }, { "valueId": "a1756910-0ff1-48be-8eb9-635c8bdfd533", "executionPath": "Structured extraction · Medium Intelligence + corrected transcript (once per call, shared)", "usdPerCall": { "min": "0.0018", "expected": "0.0031", "max": "0.0049" } } ], "totalUsdPerCall": { "min": "0.0139", "expected": "0.0229", "max": "0.0361" }, "assumptions": { "averageDurationSeconds": 254, "timing": "immediate", "modelCostRange": "usage_scenarios", "customCode": { "billingPolicy": "monthly_free_tier", "monthlyFreeInvocations": 1000, "listPriceUsdPerInvocation": "0.0010", "freeTierScope": "organization" } }, "quoteConfigVersion": "v3-intelligence-routing" }, "errors": null } ``` ```json Pricing Unavailable theme={null} { "data": null, "errors": [ { "error": "SERVICE_UNAVAILABLE", "message": "Disposition pricing is temporarily unavailable" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Publish Disposition Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-publish POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/publish Publish a disposition draft as an immutable version. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Freezes the current draft into a new immutable version, points `publishedVersionId` at it, and sets `state` to `enabled` so the disposition runs on every new completed call. Publishing validates strictly: every value must pin a published judge or extractor version, and the definition must have at least one value. Call [Estimate Disposition Cost](/api-v2/post/agents-id-dispositions-disposition-id-estimates) first and pass its `id`; publish recomputes the estimate and refuses if anything moved. Undo with [Disable Disposition](/api-v2/post/agents-id-dispositions-disposition-id-disable). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Body Parameters Unknown fields are rejected. **expectedDraftRevision** `integer` *required* The draft revision you estimated, at least `1`. Returns `409 CONFLICT` if the live revision differs. On success the draft revision becomes `expectedDraftRevision + 1` and the draft is kept in sync with the published snapshot, so `hasUnpublishedChanges` reads `false`. **estimateId** `string` *required* The `id` returned by Estimate Disposition Cost for this exact draft revision. Publish recomputes the estimate against fresh dependency reads and returns `409 CONFLICT` if the id no longer matches. **acknowledgeEstimate** `boolean` Must be exactly `true` when the estimate's `totalUsdPerCall.expected` is greater than `0.0000`; omitting it in that case returns `400 BAD_REQUEST` with the message `Acknowledge the estimated recurring cost before publishing`. Any value other than `true` is rejected as an invalid body. Optional when the expected cost is zero. ### Response **data** `object` The newly created version. **version object** **id** `string` Unique identifier for the version. It is now the disposition's `publishedVersionId`. **dispositionId** `string` The disposition this version belongs to. **versionNumber** `number` Sequential number, one higher than the previous version, or `1` for a first publish. **definition** `object` The frozen definition this version executes. `structured_extraction` sources carry the server-written `frozen` copy of the extractor prompt, output schema, and inference configuration. **publishedAt** `string` ISO 8601 timestamp of publication. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "6168a24b-1863-422b-bbec-ed6d38395c41", "dispositionId": "1b179d4d-8830-43bd-b095-632f23bc4c57", "versionNumber": 2, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "03bcc986-0183-4449-b9a6-a98b914edb72", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "judge", "judgeId": "dee902eb-e05c-46d3-8a33-0347c3871c07", "judgeVersionId": "c2781909-2c00-46d5-a2dd-db020a0f1b1f", "execution": { "reasoningEffort": "auto", "inputSourceIds": ["transcript"] } } } ], "transformation": { "version": 1, "root": { "kind": "object", "fields": { "booked": { "kind": "value", "valueId": "03bcc986-0183-4449-b9a6-a98b914edb72" } } } }, "postCallWebhook": { "mode": "emit_followup" } }, "publishedAt": "2026-09-10T18:40:03.512Z" }, "errors": null } ``` ```json Definition Invalid theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Definition failed validation", "ext": "{\"problems\":[{\"valueId\":null,\"message\":\"Publish requires at least one value\"}]}" } ] } ``` ```json Estimate Not Acknowledged theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Acknowledge the estimated recurring cost before publishing" } ] } ``` ```json Estimate Changed theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Pricing estimate changed — review the latest estimate before publishing" } ] } ``` ```json Revision Moved theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Draft revision moved (expected 3) — re-estimate and publish again" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Disposition Test Run Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-runs POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs Run a disposition against completed production calls. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Starts an asynchronous test run of the draft or the published definition against up to 250 of the agent's completed production calls, or replays the frozen cohort of an earlier run. The response is the queued run; poll [Get Disposition Test Run](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id) for progress and read results with [Get Test Run Rows](/api-v2/get/agents-id-dispositions-disposition-id-runs-run-id-rows). Test runs bill inference like production runs. An organization may start at most 10 test runs per hour and hold at most 3 in `queued` or `running` at once. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. ### Body Parameters The body takes one of two shapes: a current-definition run (`target` plus `population`, with optional `executionSla`) or a replay (`replayRunId` alone). Mixing fields from both shapes, or adding unknown fields, returns `400 BAD_REQUEST` with the message `Invalid request body`. **target** `string` Required for a current-definition run. `draft` runs the live draft, which is first validated as strictly as publish (every value must pin a runnable judge or extractor version, though an editable pin is allowed); failures return `400` with the message `Definition failed validation`. `published` runs the current published version and returns `409 CONFLICT` if the disposition has never been published. A definition with no values returns `400` with the message `Add at least one value before running a test`. **executionSla** `string` `realtime` or `queued`. Defaults from the definition's `timing`: `immediate` gives `realtime`, `within_24h` gives `queued`. **population** `object` Required for a current-definition run. Which completed, non-simulated production calls of this agent to run against. Two shapes: Recent sample: `{ "environment": "production", "requestedSize": 25 }`, optionally with `"mode": "recent"`. `requestedSize` is an integer from 1 to 250; the newest eligible calls are sampled. Returns `400` if the agent has no eligible completed calls to sample. Explicit calls: `{ "mode": "calls", "callIds": ["..."] }`, optionally with `"environment": "production"`. `callIds` is 1 to 250 unique call UUIDs. Every call must belong to this agent and be completed with non-zero duration, otherwise `400` with the message `One or more selected calls are not eligible completed production calls for this agent`. Calls that cannot enter dispositions for compliance reasons return `400` listing the offending ids. **replayRunId** `string` Alternative body: `{ "replayRunId": "..." }` with no other fields. Re-executes the frozen call cohort and definition snapshot of a finished run (`complete`, `partial`, `failed`, or `cancelled`) on this disposition, with `configurationSource: "frozen_run"`. Returns `404` with the message `Replay source test run not found` if no such run exists, `400` with the message `Replay source test run has no frozen call cohort` if it recorded no calls, and `409` with the message `Replay source frozen inputs are incomplete; run a new test instead` if any call lacks a frozen input snapshot. ### Response Returns `201` on success with the run in `queued` status. Returns `503 SERVICE_UNAVAILABLE` if the run could not be handed to the execution queue; the run is recorded as `failed` and the request can be retried. **data** `object` The new test run. Same shape as the entries of [List Disposition Test Runs](/api-v2/get/agents-id-dispositions-disposition-id-runs); the fields that matter on creation are listed here. **test run object** **id** `string` Unique identifier for the test run. Pass it as `{run_id}` to the run endpoints. **dispositionId** `string` The disposition this run belongs to. **target** `string` `draft` or `published`. **configurationSource** `string` `draft`, `published`, or `frozen_run` for a replay. **executionSla** `string` `realtime` or `queued`, as requested or defaulted. **replaySourceRunId** `string | null` The `replayRunId` you passed, or `null`. **definition** `object` The frozen definition snapshot this run executes. For a `draft` target, `structured_extraction` sources are frozen the same way publish freezes them. **population** `object` `{ "environment": "production", "requestedSize" }`. **status** `string` Always `queued` on creation. Later `running`, then `complete`, `partial`, `failed`, or `cancelled`. **requestedSize** `number` The sample size requested, or the number of call ids supplied. **resolvedSize** `number` Always `0` on creation. **completedSize** `number` Always `0` on creation. **failedSize** `number` Always `0` on creation. **evalRunId** `null` Always `null`. **mode** `string` `recent` or `calls`. **inputSetHash** `null` Always `null`. **definitionHash** `string` SHA-256 hex digest of the definition snapshot. **draftRevision** `number | null` The draft revision executed, or `null` for a published target. **dispositionVersionId** `string | null` The published version executed, or `null` for a draft target. **summary** `object` All zeros on creation: `caseCount`, `failedCaseCount`, `producedValueCount`, `totalValueCount`. `correctionCount` is omitted here and appears on later reads. **error** `null` Always `null` on creation. **createdAt** `string` ISO 8601 timestamp of creation. **startedAt** `null` Always `null` on creation. **completedAt** `null` Always `null` on creation. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "08435e5a-e5b8-4e21-8236-85fbe3149fbf", "dispositionId": "19c27589-b319-411a-a4b5-17bb55ff68f8", "target": "draft", "configurationSource": "draft", "executionSla": "realtime", "replaySourceRunId": null, "definition": { "name": "Appointment outcome", "description": "Did the caller book an appointment?", "timing": "immediate", "values": [ { "id": "45ef74d6-b7ba-4ef2-b0a7-6cc4314da544", "key": "booked", "label": "Appointment booked", "schema": { "kind": "boolean" }, "source": { "kind": "variable_extraction", "variableKey": "appointment_booked", "execution": { "reasoningEffort": "auto" } } } ], "transformation": { "version": 1, "root": { "kind": "value", "valueId": "45ef74d6-b7ba-4ef2-b0a7-6cc4314da544" } }, "postCallWebhook": { "mode": "emit_followup" } }, "population": { "environment": "production", "requestedSize": 25 }, "status": "queued", "requestedSize": 25, "resolvedSize": 0, "completedSize": 0, "failedSize": 0, "evalRunId": null, "mode": "recent", "inputSetHash": null, "definitionHash": "1754d979043d46cca6e46a034a39b234c3299a5a4200241e955bdc18bc9394e4", "draftRevision": 4, "dispositionVersionId": null, "summary": { "caseCount": 0, "failedCaseCount": 0, "producedValueCount": 0, "totalValueCount": 0 }, "error": null, "createdAt": "2026-09-10T19:12:44.902Z", "startedAt": null, "completedAt": null }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Invalid request body", "ext": "{\"errors\":[\"/population/requestedSize: Expected integer to be less or equal to 250\"]}" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "This organization already has 3 disposition test runs queued or running — wait for one to finish before starting another" } ] } ``` ```json Never Published theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "This disposition has never been published — target the draft instead" } ] } ``` ```json No Eligible Calls theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "This agent has no completed calls to sample — place a call first, or test the draft after traffic arrives" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many disposition test runs started for this organization — please wait before starting another." } ] } ``` ```json Unavailable theme={null} { "data": null, "errors": [ { "error": "SERVICE_UNAVAILABLE", "message": "Disposition test run could not be started; retry the request" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Align Disposition Test Run Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-disposition-id-runs-run-id-align POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/{disposition_id}/runs/{run_id}/align Propose definition edits from a test run's corrections. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Reads the corrections saved on a finished test run and proposes rewritten prompt or description text for each corrected value, returned as before-and-after diffs with a rationale. Nothing is written: apply a proposal yourself by editing the extractor, the draft definition, or the judge. The run must be in a terminal status (`complete`, `partial`, or `failed`) and have at least one correction from [Correct Test Run Value](/api-v2/put/agents-id-dispositions-disposition-id-runs-run-id-cases-call-id-annotations-value-id). Each corrected value costs one inference call; an organization may make at most 30 align requests per hour. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. Must be a UUID; otherwise returns `400` with the message `agentId must be a valid UUID`. Returns `404 Agent not found` if the agent is not in your organization. **disposition\_id** `string` *required* The disposition's unique identifier. Must be a UUID; otherwise returns `400` with the message `dispositionId must be a valid UUID`. Returns `404 Disposition not found` if it does not belong to this agent. **run\_id** `string` *required* The test run's unique identifier. Must be a UUID; otherwise returns `400` with the message `runId must be a valid UUID`. Returns `404 Test run not found` if it does not belong to this disposition. ### Body Parameters The body is optional; an empty object aligns every corrected value with no extra guidance. Unknown fields return `400 BAD_REQUEST` with the message `Invalid request body`. **valueIds** `array` Restrict alignment to these value ids: 1 to 50 UUIDs. Every id must exist in the run's definition snapshot, otherwise `404` with the message `Disposition value not found in this run`. Values in the list that have no corrections are silently ignored. **instructions** `string` Free-text guidance added to every value's proposal request, up to 2000 characters after trimming. Use it to steer tone or emphasis (for example, "keep prompts under 80 words"). ### Response **data.proposals** `array` One entry per corrected value that produced a usable proposal. A value whose corrections suggest no change appears with an empty `changes` array. **proposal object** **valueId** `string` The definition value. **key** `string` The value's `key`. **kind** `string` `structured_extraction`, `variable_extraction`, or `judge`. `custom_code` values are never proposed against. **changes** `array` Up to 12 field-level edits, each `{ "field", "before", "after", "rationale" }`. `field` is `promptMd` or `systemPromptMd` (structured extraction and judge), `description` (variable extraction, the value schema's description), or `levels.` followed by an existing judge level key and `.promptMd` (a judge level prompt). `before` is the current text, read by the server from the run's frozen definition or the pinned judge version, never from the proposal. `after` is the full replacement text, up to 20,000 characters. `rationale` explains the change in up to 1000 characters. No-op edits and duplicate fields are dropped. **data.skipped** `array` Corrected values that received no proposal, each `{ "valueId", "reason" }`. `reason` is `custom_code` (code values have no editable text), `no_editable_fields` (an unfrozen extraction source or a judge whose pinned version is gone), `proposal_invalid` (no usable proposal after two attempts), or `brief_too_large` (the value's text and corrections exceed the per-request size budget even after trimming). **data.truncatedCorrections** `number` How many corrections were dropped, oldest first, to fit the request within its size budget. `0` when every correction was considered. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "proposals": [ { "valueId": "f4b706ec-43cc-4373-b4a5-a06130fddbbf", "key": "booked", "kind": "judge", "changes": [ { "field": "promptMd", "before": "Decide whether the caller booked an appointment during this call.", "after": "Decide whether the caller booked an appointment during this call. Treat a verbal agreement to a specific day and time as booked, even if the agent did not read back a confirmation number.", "rationale": "Three corrections flipped the verdict from not booked to booked on calls where the caller agreed to a slot but no confirmation number was read back." } ] } ], "skipped": [ { "valueId": "d2dc9bf3-d842-44f9-8002-dea791ff0ad4", "reason": "custom_code" } ], "truncatedCorrections": 0 }, "errors": null } ``` ```json Not Ready theme={null} { "data": null, "errors": [ { "error": "DISPOSITION_ALIGN_NOT_READY", "message": "Aligning requires a terminal test run" } ] } ``` ```json No Corrections theme={null} { "data": null, "errors": [ { "error": "DISPOSITION_ALIGN_NOT_READY", "message": "Correct at least one value on this run before aligning" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many disposition align requests for this organization — please wait before requesting more." } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Disposition value not found in this run" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Disposition Extractor Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-extractors POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors Create an extractor with its first editable version. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Creates an extractor and its version `1` in the `editable` state. An extractor is a prompt plus an output schema that pulls a structured value out of call evidence; a disposition value pins a published extractor version to run it after each call. Edit the draft with [Update Disposition Extractor Draft](/api-v2/patch/agents-id-dispositions-extractors-extractor-id-draft), then make it pinnable with [Publish Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors-extractor-id-publish). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. ### Body Parameters Unknown fields are rejected. A body that fails shape validation returns `400` with the message `Invalid request body`; a body that passes shape validation but breaks a prompt, schema, or model-profile rule returns `400` with the message `Extractor definition failed validation`. In both cases the error's `ext` field is a JSON string listing each problem. **key** `string` *required* Stable machine key for the extractor. 1 to 64 characters matching `^[a-z][a-z0-9_]*$`. Must be unique within your organization; a duplicate returns `409 CONFLICT`. **name** `string` *required* Display name. 1 to 120 characters. **description** `string | null` Optional description, up to 2000 characters. **scopedToAgent** `boolean` (default: false) `true` limits the extractor to this agent. When `false` or omitted, the extractor is organization-wide and available to every agent's dispositions. **systemPromptMd** `string` Optional system prompt in Markdown. Up to 8000 characters and 8000 UTF-8 bytes. **promptMd** `string` *required* The extraction prompt in Markdown. 1 to 8000 characters, up to 8000 UTF-8 bytes, and must contain non-whitespace text. `systemPromptMd` and `promptMd` together may not exceed 16000 UTF-8 bytes. **outputSchema** `object` *required* The shape of the value the extractor produces. A schema node is an object with a `kind` plus kind-specific fields; `array` and `object` nodes nest further schema nodes. The whole schema may nest at most 8 levels deep, contain at most 200 nodes, and serialize to at most 64 KB. **outputSchema fields** **kind** `string` *required* One of `boolean`, `string`, `number`, `enum`, `array`, `object`. **description** `string` Optional guidance for the model, up to 2000 characters. Allowed on every kind. **format** `string` `string` only. The single accepted value is `date-time`. **options** `array` `enum` only, required for that kind. 1 to 24 objects of the form `{ "key": "booked", "label": "Booked" }`. `key` is 1 to 64 characters and must be unique within the enum; `label` is 1 to 120 characters. **items** `object` `array` only, required for that kind. A nested schema node describing each element. **minItems** `integer` `array` only. Minimum `0`, at most 1000, and not greater than `maxItems`. **maxItems** `integer` `array` only. Minimum `1`, at most 1000. **properties** `object` `object` only, required for that kind. Map of property names (up to 64 characters each, at most 64 properties) to nested schema nodes. `__proto__`, `constructor`, and `prototype` are not allowed as names. **required** `array` `object` only, required for that kind. Property names that must be present in the produced value. Each must be declared in `properties`, with no duplicates. Pass `[]` when nothing is required. **inferenceConfig** `object` *required* How the extractor runs. Unknown fields are rejected. **inferenceConfig fields** **contextSources** `array` *required* Evidence the extractor reads. 1 to 8 unique values from `transcript`, `audio_recording`, `call_metadata`, `pathway_logs`, `tool_logs`, `variables`, `agent_config`, `call_config`. Including `audio_recording` requires a model profile whose `supportsAudio` is `true`. **modelProfileKey** `string` (default: balanced) One of the `key` values returned by [Get Model Profile Catalog](/api-v2/get/agents-id-dispositions-model-profile-catalog). 1 to 120 characters. A key that is not in the catalog returns `400` with the message `Extractor model profile is not available`. **temperature** `number | null` Sampling temperature between `0` and `2`. **maxOutputTokens** `integer | null` Output token cap between `1` and `64000`. **thinking** `string | null` Reasoning effort: `low`, `medium`, or `high`. ### Response Returns `201` on success. **data.extractor** `object` The new extractor. **extractor object** **id** `string` Unique identifier for the extractor. **agentId** `string | null` `null` for an organization-wide extractor. Otherwise this agent's id. **key** `string` The `key` you supplied. **name** `string` The extractor's display name. **description** `string | null` Optional description. **currentVersionId** `string` The `editable` draft version, the same id as `data.currentVersion.id`. Pass it as `expectedVersionId` when updating or publishing. **activeVersionId** `null` Always `null` on a new extractor; set by the first publish. **draftRevision** `integer` Always `1` on a new extractor. Pass it as `expectedDraftRevision` when updating or publishing. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **data.currentVersion** `object` Version `1`, in the `editable` state. **version object** **id** `string` Unique identifier for the version. **extractorId** `string` The extractor this version belongs to. **versionNumber** `integer` `1` for a new extractor. Increments on each publish. **state** `string` `editable` for the live draft, `archived` once published. **name** `string` Display name at this version. **description** `string | null` Description at this version. **systemPromptMd** `string` The system prompt. Empty string when none was supplied. **promptMd** `string` The extraction prompt. **outputSchema** `object` The schema you supplied. **inferenceConfig** `object` The configuration you supplied, with `modelProfileKey` always populated (defaulted to `balanced` when omitted). `temperature`, `maxOutputTokens`, and `thinking` are omitted when you did not send them. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last update. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "extractor": { "id": "d6486956-e583-448f-9cb2-3f98dcc0fada", "agentId": null, "key": "appointment_outcome", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "currentVersionId": "ca112e02-a762-49b0-ba0e-dff4c57ee8ad", "activeVersionId": null, "draftRevision": 1, "createdAt": "2026-09-10T16:20:45.312Z", "updatedAt": "2026-09-10T16:20:45.318Z" }, "currentVersion": { "id": "ca112e02-a762-49b0-ba0e-dff4c57ee8ad", "extractorId": "d6486956-e583-448f-9cb2-3f98dcc0fada", "versionNumber": 1, "state": "editable", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "systemPromptMd": "", "promptMd": "Decide whether the caller booked, rescheduled, or declined an appointment. Return unclear if the call ended before a decision.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inferenceConfig": { "modelProfileKey": "balanced", "thinking": "low", "contextSources": ["transcript", "call_metadata"] }, "createdAt": "2026-09-10T16:20:45.312Z", "updatedAt": "2026-09-10T16:20:45.312Z" } }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Invalid request body", "ext": "{\"errors\":[\"/promptMd: Expected required property\"]}" } ] } ``` ```json Invalid Definition theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Extractor definition failed validation", "ext": "{\"problems\":[\"Call audio extraction requires an audio-capable model profile\"]}" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "An extractor with key \"appointment_outcome\" already exists" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Publish Disposition Extractor Source: https://docs.bland.ai/api-v2/post/agents-id-dispositions-extractors-extractor-id-publish POST https://api.bland.ai/v2/agents/{agent_id}/dispositions/extractors/{extractor_id}/publish Publish an extractor draft as an immutable version. ### Overview > [!NOTE] > > Dispositions are enabled per organization. If your organization does not have access, these endpoints return `404`. Validates the `editable` draft, moves it to the `archived` state as the extractor's new `activeVersionId`, and opens a fresh `editable` copy with the next `versionNumber` as the new `currentVersionId`. The published version is immutable and appears in [Get Extractor Catalog](/api-v2/get/agents-id-dispositions-extractor-catalog), where a disposition value can pin it. Dispositions that already pinned an earlier version keep running that version. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. A malformed id returns `400` with the message `agentId must be a valid UUID`. **extractor\_id** `string` *required* The extractor's unique identifier. Must be organization-wide or scoped to this agent; otherwise returns `404` with the message `Disposition extractor not found`. A malformed id returns `400` with the message `extractorId must be a valid UUID`. ### Body Parameters Unknown fields are rejected and return `400` with the message `Invalid request body`. If the draft fails the same prompt, schema, or model-profile rules as [Create Disposition Extractor](/api-v2/post/agents-id-dispositions-extractors), the request returns `400` with the message `Extractor definition failed validation` and nothing is published. **expectedVersionId** `string` *required* The extractor's current `currentVersionId`, the draft being published. If another update or publish has moved it, the request returns `409 CONFLICT` with the message `Extractor draft changed; refresh and try again`. **expectedDraftRevision** `integer` *required* The extractor's current `draftRevision`. Minimum `1`. A stale value returns the same `409 CONFLICT`. ### Response **data.extractor** `object` The extractor record after publishing. `activeVersionId` now points at `data.publishedVersion.id`, `currentVersionId` at `data.currentVersion.id`, and `draftRevision` has incremented by `1`. **extractor object** **id** `string` Unique identifier for the extractor. **agentId** `string | null` `null` for an organization-wide extractor. Otherwise the id of the one agent it is scoped to. **key** `string` Stable machine key, unique within your organization. **name** `string` The extractor's display name. **description** `string | null` Optional description. **currentVersionId** `string` The new `editable` version, the same id as `data.currentVersion.id`. **activeVersionId** `string` The version just published, the same id as `data.publishedVersion.id`. **draftRevision** `integer` The new revision. Pass it as `expectedDraftRevision` on your next update or publish. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of this publish. **data.publishedVersion** `object` The version that was just published, now `archived` and immutable. **version object** **id** `string` Unique identifier for the version. This is the id a disposition value pins. **extractorId** `string` The extractor this version belongs to. **versionNumber** `integer` The published version number. **state** `string` Always `archived` here. **name** `string` Display name at this version. **description** `string | null` Description at this version. **systemPromptMd** `string` The frozen system prompt. Empty string when none is set. **promptMd** `string` The frozen extraction prompt. **outputSchema** `object` The frozen output schema. **inferenceConfig** `object` The frozen inference configuration: `modelProfileKey`, `contextSources`, and, when set, `temperature`, `maxOutputTokens`, and `thinking`. **createdAt** `string` ISO 8601 timestamp of creation. **updatedAt** `string` ISO 8601 timestamp of the last draft edit before publishing. **data.currentVersion** `object` The new `editable` draft, a copy of the published version with `versionNumber` incremented by `1`. Same fields as `data.publishedVersion`, with `state` set to `editable`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "extractor": { "id": "6816b867-754b-413f-9c19-1a7e94c541b4", "agentId": null, "key": "appointment_outcome", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "currentVersionId": "ddf9de6a-0ba7-4f73-8a0c-c0d52afcd355", "activeVersionId": "ab65bde8-78d1-443c-9406-e3a8c8934b7b", "draftRevision": 2, "createdAt": "2026-09-01T15:02:11.480Z", "updatedAt": "2026-09-10T17:32:08.905Z" }, "publishedVersion": { "id": "ab65bde8-78d1-443c-9406-e3a8c8934b7b", "extractorId": "6816b867-754b-413f-9c19-1a7e94c541b4", "versionNumber": 1, "state": "archived", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "systemPromptMd": "", "promptMd": "Decide whether the caller booked, rescheduled, or declined an appointment. Return unclear if the call ended before a decision.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inferenceConfig": { "modelProfileKey": "balanced", "thinking": "low", "contextSources": ["transcript", "call_metadata"] }, "createdAt": "2026-09-01T15:02:11.480Z", "updatedAt": "2026-09-01T15:02:11.480Z" }, "currentVersion": { "id": "ddf9de6a-0ba7-4f73-8a0c-c0d52afcd355", "extractorId": "6816b867-754b-413f-9c19-1a7e94c541b4", "versionNumber": 2, "state": "editable", "name": "Appointment outcome", "description": "Whether an appointment was booked, rescheduled, or declined.", "systemPromptMd": "", "promptMd": "Decide whether the caller booked, rescheduled, or declined an appointment. Return unclear if the call ended before a decision.", "outputSchema": { "kind": "enum", "description": "Final appointment outcome for this call.", "options": [ { "key": "booked", "label": "Booked" }, { "key": "rescheduled", "label": "Rescheduled" }, { "key": "declined", "label": "Declined" }, { "key": "unclear", "label": "Unclear" } ] }, "inferenceConfig": { "modelProfileKey": "balanced", "thinking": "low", "contextSources": ["transcript", "call_metadata"] }, "createdAt": "2026-09-10T17:32:08.905Z", "updatedAt": "2026-09-10T17:32:08.905Z" } }, "errors": null } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "Extractor draft changed; refresh and try again" } ] } ``` ```json Invalid Definition theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Extractor definition failed validation", "ext": "{\"problems\":[\"Extractor prompt must contain non-whitespace text\"]}" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Start Check Run Source: https://docs.bland.ai/api-v2/post/agents-id-environments-env-check-runs POST https://api.bland.ai/v2/agents/{agent_id}/environments/{env}/check-runs Start a check run against a candidate version. ### Overview Starts a check run for one environment. The server generates `simulations_count` conversations per configured scenario against the candidate version, scores each with the configured judges, and records a verdict. The run is returned immediately as `PENDING`, moves to `RUNNING`, and ends `PASSED`, `FAILED`, `ERROR`, or `CANCELLED`. Poll [Get Check Run](/api-v2/get/agents-id-check-runs-run-id) until the status is terminal, then gate your own [publish](/api-v2/post/agents-id-publish) or [promote](/api-v2/post/agents-id-promote) call on `overall_passed`. A check run never moves an environment pointer. The run freezes the config as it stands when it starts; later edits with [Set Checks](/api-v2/put/agents-id-environments-env-checks) do not affect it. One run at a time per environment. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **env** `string` *required* `staging` or `production`. Any other value returns `400 BAD_REQUEST`. ### Body Parameters **version\_id** `string` The version to score. Must be a version of this agent; any version qualifies, so you can re-check an older one. Omit it (or pass an empty string) to score what a promotion into this environment would deploy: for `production`, the version pinned to `staging`; for `staging`, the newest version saved on the main line. Returns `400 BAD_REQUEST` when the ID is not a version of this agent, or when the default cannot be resolved (staging is unpinned, or the agent has no saved versions). ### Response Returns `202` with the new run. If the run could not be scheduled, the response is still `202` but the run's `status` is `ERROR` with an `error_message`, so read the status rather than assuming `PENDING`. Returns `400 BAD_REQUEST` when the environment has no check config, the config is disabled, or the config is no longer runnable (for example, a scenario was deleted). Returns `409 CONFLICT` while another run for the same environment is `PENDING` or `RUNNING`; cancel it with [Cancel Check Run](/api-v2/post/agents-id-check-runs-run-id-cancel) or wait for it to finish. **data** `object` The new check run. **check run object** **id** `string` Unique identifier for the check run. Pass it as `{run_id}` when polling. **agent\_id** `string` The agent the run belongs to. **env\_type** `string` The environment whose checks were run: `staging` or `production`. **agent\_version\_id** `string` The candidate version the run scores. **semver** `string | null` The candidate's published version number. `null` when the candidate has not been published yet, which is the normal case for a `staging` run. **version\_name** `string | null` The candidate's saved name, or `null` if it has none. **status** `string` `PENDING` on a successful start, or `ERROR` if the run could not be scheduled. Later values are `RUNNING`, `PASSED`, `FAILED`, `ERROR`, and `CANCELLED`. **judge\_names** `array` Display names of the judges frozen into the run. **scenario\_count** `integer` Number of scenarios the run drives conversations from. **simulations\_count** `integer` Conversations generated per scenario. **overall\_passed** `boolean | null` `null` until the run completes. `true` when every `required` judge passed, `false` otherwise. **verdicts** `array | null` `null` until the run completes. See [Get Check Run](/api-v2/get/agents-id-check-runs-run-id) for the verdict object. **simulation\_set\_id** `string | null` ID of the generated conversation set. `null` until generation starts. **eval\_run\_id** `string | null` ID of the scoring run. `null` until scoring starts. **error\_message** `string | null` Why the run ended in `ERROR`, or `null`. **triggered\_by** `string | null` ID of the user who started the run, or `null` when started with an org-level key. **created\_at** `string` ISO 8601 timestamp the run was created. **started\_at** `string | null` When scoring began. `null` while `PENDING`. **completed\_at** `string | null` When the run reached a terminal status. `null` while in flight. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "e8b994db-eeaa-4948-a4b8-3edbca49ca9c", "agent_id": "9b97c1a6-3171-4139-b83d-b9119586080d", "env_type": "production", "agent_version_id": "b7a09422-c97c-49d8-b66f-8991b14e8253", "semver": "1.4.0", "version_name": "Shorter greeting", "status": "PENDING", "judge_names": ["Resolution quality", "No policy violations"], "scenario_count": 2, "simulations_count": 5, "overall_passed": null, "verdicts": null, "simulation_set_id": null, "eval_run_id": null, "error_message": null, "triggered_by": "c43222b9-b7ab-4823-950d-517ac22291ff", "created_at": "2026-09-10T17:02:39.115Z", "started_at": null, "completed_at": null }, "errors": null } ``` ```json No Config theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "No checks are configured for this environment" } ] } ``` ```json Run In Progress theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "A check run is already in progress" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Experiment Source: https://docs.bland.ai/api-v2/post/agents-id-experiments POST https://api.bland.ai/v2/agents/{agent_id}/experiments Start an A/B experiment on a variant version. ### Overview Starts an A/B experiment that sends `traffic_percentage` percent of the agent's eligible calls to `variant_version_id`, with the rest running the version pinned to `baseline_env`. Only calls that do not explicitly select a version or environment are eligible. An agent has at most one active experiment: stop it with [Stop Experiment](/api-v2/post/agents-id-experiments-experiment-id-stop) before creating another, or adjust it in place with [Update Experiment](/api-v2/patch/agents-id-experiments-experiment-id). Returns `409 CONFLICT` while one is active. An experiment completes on its own when `ends_at` passes, when `variant_call_quota` connected variant calls have been routed, or when the baseline environment is repointed to another version (for example by a publish or promote). Completion is permanent, and all eligible traffic returns to the baseline pin. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **variant\_version\_id** `string` *required* The version to test. Must be a UUID, a version of this agent, and different from the baseline environment's current pin. The variant is prepared for live calls before the experiment is created, so a version that cannot run returns `400 BAD_REQUEST` here rather than failing on calls. **traffic\_percentage** `integer` *required* Share of eligible calls routed to the variant, `1` to `100`. The remainder runs the baseline pin. **baseline\_env** `string` (default: production) `production` or `staging`. The environment whose pinned version is the control arm. Returns `400 BAD_REQUEST` if that environment has no pinned version. **run\_hours** `object | null` (default: null) Weekly schedule during which the variant receives traffic, evaluated in `timezone` at each call so daylight-saving changes are handled automatically. Outside the schedule every eligible call runs the baseline. `null` means the variant is always eligible. ```json theme={null} { "timezone": "America/New_York", "days": { "mon": { "start": "09:00", "end": "17:00" }, "tue": { "start": "09:00", "end": "17:00" }, "fri": { "start": "22:00", "end": "02:00" } } } ``` **run\_hours.timezone** `string` *required* An IANA timezone name such as `America/Chicago`. Returns `400 BAD_REQUEST` for an unknown name. **run\_hours.days** `object` *required* Keyed by `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`, with at least one day. Each value is `{ "start": "HH:mm", "end": "HH:mm" }` in 24-hour time, and `start` and `end` must differ. A day that is absent never routes to the variant. When `end` is earlier than `start`, the window wraps past midnight into the following day. **starts\_at** `string | null` (default: null) ISO 8601 datetime. The variant receives no traffic before this time. `null` starts immediately. **ends\_at** `string | null` (default: null) ISO 8601 datetime. The experiment completes with `completed_reason: "date_ended"` once this time passes. Must be in the future and, when `starts_at` is set, after it. `null` means no end date. **variant\_call\_quota** `integer | null` (default: null) Maximum connected variant calls, `1` to `1000000`. The experiment completes with `completed_reason: "quota_reached"` when the count is reached. Only calls that connect count, so unanswered outbound calls never consume quota. `null` means no cap. ### Response **data.experiment** `object` The new experiment, in `active` status. **experiment object** **id** `string` Unique identifier for the experiment. Pass it as `{experiment_id}` on the other experiment endpoints. **agent\_id** `string` The agent the experiment belongs to. **status** `string` `active` on creation. Becomes `completed` when the experiment ends; completion is terminal. **completed\_reason** `string | null` `null` while active. On completion, one of `manual` (stopped through the API), `date_ended`, `quota_reached`, or `baseline_changed` (the baseline environment was repointed). **baseline\_env** `string` The control environment: `production` or `staging`. **baseline\_current\_version\_id** `string | null` The version currently pinned to `baseline_env`, read at request time. While the experiment is active this is the control arm. **variant\_version\_id** `string` The version under test. **traffic\_percentage** `integer` Share of eligible calls routed to the variant. **run\_hours** `object | null` The weekly schedule as submitted, or `null` when the variant is always eligible. **starts\_at** `string | null` When variant traffic begins, or `null` for immediately. **ends\_at** `string | null` When the experiment completes on its own, or `null` for no end date. **variant\_call\_quota** `integer | null` Maximum connected variant calls, or `null` for no cap. **variant\_calls\_routed** `integer` Connected calls routed to the variant so far. Always `0` on creation; live while active, frozen at completion. **created\_by** `string | null` ID of the user who created the experiment, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **completed\_at** `string | null` `null` while active. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "experiment": { "id": "5c590769-b12c-4f5e-8608-85dd2ac29bb1", "agent_id": "4fdd0f5b-4416-42f6-bb85-fb42d3ceec29", "status": "active", "completed_reason": null, "baseline_env": "production", "baseline_current_version_id": "d717a103-f912-42f4-ae07-6a2a8b5395b0", "variant_version_id": "dc7c8387-c78e-4942-8190-b8899f31237d", "traffic_percentage": 20, "run_hours": { "timezone": "America/Chicago", "days": { "mon": { "start": "09:00", "end": "17:00" }, "tue": { "start": "09:00", "end": "17:00" }, "wed": { "start": "09:00", "end": "17:00" }, "thu": { "start": "09:00", "end": "17:00" }, "fri": { "start": "09:00", "end": "17:00" } } }, "starts_at": null, "ends_at": "2026-09-24T00:00:00.000Z", "variant_call_quota": 500, "variant_calls_routed": 0, "created_by": "3ba21c4b-2b23-413d-8a09-1ce549a29391", "created_at": "2026-09-10T20:14:33.508Z", "completed_at": null } }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "traffic_percentage must be an integer between 1 and 100" } ] } ``` ```json Variant Not Found theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "variant_version_id is not a version of this agent" } ] } ``` ```json Already Active theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "This agent already has an active experiment — stop it first" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Stop Experiment Source: https://docs.bland.ai/api-v2/post/agents-id-experiments-experiment-id-stop POST https://api.bland.ai/v2/agents/{agent_id}/experiments/{experiment_id}/stop End an active experiment and return traffic to baseline. ### Overview Completes an active experiment with `completed_reason: "manual"`. Eligible calls immediately return to the baseline pin, and the final `variant_calls_routed` count is frozen on the record. Completion is permanent: a stopped experiment cannot be resumed, so use [Create Experiment](/api-v2/post/agents-id-experiments) to test again. Returns `409 CONFLICT` if the experiment is already completed for any reason. Requires an admin, owner, operator, or prompter role. This endpoint takes no body. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. **experiment\_id** `string` *required* The experiment's unique identifier. Must be a valid UUID; returns `400 BAD_REQUEST` otherwise. ### Response **data.experiment** `object` The stopped experiment. **experiment object** **id** `string` Unique identifier for the experiment. **agent\_id** `string` The agent the experiment belonged to. **status** `string` Always `completed` on success. **completed\_reason** `string` Always `manual` on success. **baseline\_env** `string` The control environment: `production` or `staging`. **baseline\_current\_version\_id** `string | null` The version currently pinned to `baseline_env`, which all eligible traffic now runs. **variant\_version\_id** `string` The version that was under test. **traffic\_percentage** `integer` The share of eligible calls the variant was receiving when stopped. **run\_hours** `object | null` The weekly schedule that was in effect, or `null`. **starts\_at** `string | null` The configured start, or `null`. **ends\_at** `string | null` The configured end date, or `null`. **variant\_call\_quota** `integer | null` The configured cap, or `null`. **variant\_calls\_routed** `integer` Final count of connected calls routed to the variant. **created\_by** `string | null` ID of the user who created the experiment, or `null` when created with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **completed\_at** `string` ISO 8601 timestamp of this stop. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "experiment": { "id": "339da41c-429f-4a5b-81c5-5f33fe01a266", "agent_id": "b8c322a1-9498-4a20-abd0-78ab3957b7d8", "status": "completed", "completed_reason": "manual", "baseline_env": "staging", "baseline_current_version_id": "4f8eb28b-8d56-44bb-9297-afe154f5acea", "variant_version_id": "2adb110d-e30d-49db-9e68-1d0904e462e3", "traffic_percentage": 40, "run_hours": null, "starts_at": null, "ends_at": null, "variant_call_quota": null, "variant_calls_routed": 96, "created_by": "c52e0087-b404-46af-aa5f-073edb5a3913", "created_at": "2026-09-09T09:05:44.310Z", "completed_at": "2026-09-10T21:37:12.654Z" } }, "errors": null } ``` ```json Already Completed theme={null} { "data": null, "errors": [ { "error": "CONFLICT", "message": "The experiment is already completed" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Experiment not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Send Test Contact Card Source: https://docs.bland.ai/api-v2/post/agents-id-identity-contact-card-test POST https://api.bland.ai/v2/agents/{agent_id}/identity/contact-card/test Send the agent's contact card to one number to check how it arrives. ### Overview Sends the agent's contact card to a number you choose so you can see how it looks on a real device. > [!WARNING] > > Each request sends a real message and is billed to your organization like any other outbound message. It is not a preview. Limited to 5 requests per minute per agent. The test is independent of the automatic delivery switch, so you can send one whether or not `vcf_delivery_enabled` is on, and you can repeat it. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **to** `string` *required* Destination number in E.164, for example `+15550000000`. Anything that does not normalize to E.164 returns `400 BAD_REQUEST`. **channel** `string` *required* One of `sms`, `imessage`, or `rcs`. Any other value returns `400 BAD_REQUEST` listing the accepted values. ### Response **data.channel** `string` The channel you requested. **data.to** `string` The destination number, normalized to E.164. **data.from** `string` The agent number the card was sent from. **data.delivered\_via** `string` How it was actually delivered: `mms`, `imessage`, or `rcs`. This can differ from `channel` when the requested channel falls back. **data.message\_sid** `string | null` Provider identifier for the sent message, or `null` when the channel does not return one. **data.note** `string` Present only when there is something worth saying about how the send was handled. **errors** `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`. ```json Response theme={null} { "data": { "channel": "sms", "to": "+15550000000", "from": "+18005551234", "delivered_via": "mms", "message_sid": "6f0d6b4d-6b0e-4a58-9a1b-6f2d7b6a2f10" }, "errors": null } ``` ```json No Bound Number theme={null} { "data": null, "errors": [ { "error": "NO_BOUND_NUMBER", "message": "This agent has no phone number attached to send from" } ] } ``` ```json Payment Required theme={null} { "data": null, "errors": [ { "error": "PAYMENT_REQUIRED", "message": "Your balance does not cover sending this message" } ] } ``` ```json Invalid Channel theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "`channel` must be one of: sms, imessage, rcs" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Upload Agent Logo Source: https://docs.bland.ai/api-v2/post/agents-id-identity-logo POST https://api.bland.ai/v2/agents/{agent_id}/identity/logo Upload the logo shown on the agent's contact card. ### Overview Replaces the agent's logo. Send the image as a multipart form upload in a field named `file`, not as JSON. Uploading a logo rebuilds the contact card, so `vcf_file_id` and `vcf_url` change in the response. Requires an admin, owner, operator, or prompter role. ```bash theme={null} curl -X POST https://api.bland.ai/v2/agents/{agent_id}/identity/logo \ -H "authorization: YOUR_API_KEY" \ -F "file=@logo.png;type=image/png" ``` ### Headers **authorization** `string` *required* Your API key for authentication. **content-type** `string` *required* `multipart/form-data`. Most HTTP clients set this for you when you attach a file. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **file** `file` *required* The logo image. PNG or JPEG only, at most 2 MB, one file per request. A request with no file returns `400 BAD_REQUEST`, and any other image type is rejected with `Logo must be a PNG or JPEG image`. ### Response Returns the full identity in the same shape as [Get Agent Identity](/api-v2/get/agents-id-identity), with the new `logo_file_id` and a fresh `logo_url`. **data** `object` The updated identity. See [Get Agent Identity](/api-v2/get/agents-id-identity) for every field. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "b88c3ce2-54d4-406c-bd21-733c61556151", "org_id": "4bb834b5-8e95-487a-908d-d712a201008c", "agent_id": "ec74c83e-5370-450b-9aa0-59757ec25a81", "display_name": "Northwind Dental", "tagline": "Front desk", "support_email": "help@northwind.example", "website": "https://northwind.example", "address": "", "logo_file_id": "5db9aecc-5013-4f97-8592-b0330617a6d0", "vcf_file_id": "2ee5217f-562e-477c-8e30-0b1a68e44c2f", "vcf_delivery_enabled": false, "rcs_enabled": true, "bcid_enabled": false, "bcid_status": "not_submitted", "bcid_submission": null, "phone_numbers": [], "logo_url": "https://files.bland.ai/agent-identity/5db9aecc-5013-4f97-8592-b0330617a6d0?signature=...", "vcf_url": "https://files.bland.ai/agent-identity/2ee5217f-562e-477c-8e30-0b1a68e44c2f?signature=...", "created_at": "2026-09-15T05:08:35.092Z", "updated_at": "2026-09-15T05:09:02.118Z" }, "errors": null } ``` ```json No File theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "A `file` image field is required" } ] } ``` ```json Wrong Type theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Logo must be a PNG or JPEG image" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Attach Numbers to Agent Source: https://docs.bland.ai/api-v2/post/agents-id-inbound-attach POST https://api.bland.ai/v2/agents/{agent_id}/inbound/attach Route inbound calls on your phone numbers to an agent. ### Overview Points one or more of your phone numbers at the agent so inbound calls run it. Any existing pathway or persona assignment on those numbers is replaced. Calls answer with the agent's `production` version once one is promoted; until then they run the newest version saved on the dev timeline at the time of the attach, so re-attach after saving to refresh it. Enterprise plans can pass `environment: "staging"` so calls run the version pinned to staging instead. The agent must have at least one saved version. Use [Detach Numbers from Agent](/api-v2/post/agents-id-inbound-detach) to undo. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **inbound\_numbers** `string[]` *required* Phone numbers to attach, each exactly as it appears on your account (for example `+18005551234`). Must be a non-empty array of non-empty strings; surrounding whitespace is trimmed. Returns `400 INVALID_BODY` if the array is missing, empty, or contains a non-string. Returns `400 INVALID_INBOUND_NUMBERS` if any number is not on your account, in which case nothing is attached. **environment** `string` Which environment calls to these numbers run: `production` or `staging`. When you omit it, a number already attached to this agent on staging stays on staging, and every other number answers on production. Pass `production` to move a staging number back. Any other value returns `400 INVALID_BODY`. `staging` is enterprise only and applies to calls. Texts to a staging number still run the production version. Every check below runs before anything is written: * `403 ENTERPRISE_REQUIRED` if your organization is not on an enterprise plan. * `409 STAGING_NUMBER_UNSUPPORTED` if your account or any of the numbers runs on dedicated infrastructure. * `409 AGENT_ENV_UNPINNED` if nothing is published to staging. * `409 AGENT_VARIABLE_UNRESOLVED` if a variable the staging version references has no staging value, or `409 AGENT_SNAPSHOT_INVALID` if the staging version can't run. ### Response **data.agent\_id** `string` The agent ID from the request path. **data.persona\_id** `string` ID of the persona the attached numbers route through. Created on the agent's first attach and reused afterwards. **data.pathway\_id** `string` ID of the pathway compiled from the agent's version for this binding. Regenerated on every attach. **data.compiled\_from\_version** `string` ID of the agent version the binding was compiled from: the newest version on the dev timeline. Versions saved on branches are ignored. **data.attached** `string[]` The numbers that were attached, after trimming. **errors** `null | array` `null` on success, or a list of error objects if the request failed. Returns `404 NOT_FOUND` for an unknown agent, `400 NO_VERSIONS` when the agent has no saved versions, and `422 COMPILE_FAILED` when the newest version cannot be compiled. ```json Response theme={null} { "data": { "agent_id": "56ad3ffc-41c3-4466-b41f-220d17779a74", "persona_id": "4cbdee81-f067-4fb7-8738-0995316ab3ce", "pathway_id": "48e86cb8-4d1a-4be6-a85a-4c277255eeb4", "compiled_from_version": "4adbe770-fc45-42ea-aa17-7533429c34f3", "attached": [ "+18005551234", "+18005556789" ] }, "errors": null } ``` ```json Staging Not Published theme={null} { "data": null, "errors": [ { "error": "AGENT_ENV_UNPINNED", "message": "Staging has no published version. Publish to staging first." } ] } ``` ```json Invalid Numbers theme={null} { "data": null, "errors": [ { "error": "INVALID_INBOUND_NUMBERS", "message": "Some phone numbers were not found or do not belong to you" } ] } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "INVALID_BODY", "message": "inbound_numbers must be a non-empty array of phone numbers" } ] } ``` ```json No Versions theme={null} { "data": null, "errors": [ { "error": "NO_VERSIONS", "message": "Agent has no saved versions — save it in the builder first" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Detach Numbers from Agent Source: https://docs.bland.ai/api-v2/post/agents-id-inbound-detach POST https://api.bland.ai/v2/agents/{agent_id}/inbound/detach Stop routing inbound calls on phone numbers to an agent. ### Overview Removes the agent from the given phone numbers. Only numbers currently attached to this agent are affected; any others in the list are skipped and not counted. Detached numbers have no inbound assignment until you attach them somewhere else. The reverse operation is [Attach Numbers to Agent](/api-v2/post/agents-id-inbound-attach). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **inbound\_numbers** `string[]` *required* Phone numbers to detach, each exactly as it appears on your account (for example `+18005551234`). Must be a non-empty array of non-empty strings; surrounding whitespace is trimmed. Returns `400 INVALID_BODY` otherwise. ### Response **data.agent\_id** `string` The agent ID from the request path. **data.detached\_count** `integer` How many of the given numbers were attached to this agent and are now detached. `0` when none were, including when the agent has never had numbers attached or the agent ID is unknown. This endpoint does not return `404` for an unknown agent. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "agent_id": "8a60ad62-9f9e-4d97-817f-ac47ee2639cc", "detached_count": 2 }, "errors": null } ``` ```json Invalid Body theme={null} { "data": null, "errors": [ { "error": "INVALID_BODY", "message": "inbound_numbers must be a non-empty array of phone numbers" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Infer Agent Memory Schema Source: https://docs.bland.ai/api-v2/post/agents-id-memory-schema-infer POST https://api.bland.ai/v2/agents/{agent_id}/memory/schema/infer Generate a suggested memory schema by reading the agent. ### Overview Reads the agent and proposes what it should remember about each contact. The proposal is returned and nothing is saved: to keep it, put it on `settings.memorySchema` and save a version with [Create Agent Version](/api-v2/post/agents-id-versions). By default it reads the agent's newest dev version. Send a `snapshot` to have it read an unsaved configuration instead, which is what the builder does while you are still editing. This runs a language model over the compiled agent, so it is limited to 6 requests per minute per agent and it is not instant. The agent must have a saved version, or a `snapshot` in the body, and that configuration must compile. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **snapshot** `object` A full agent configuration to read instead of the saved dev version, in the same shape [Create Agent Version](/api-v2/post/agents-id-versions) accepts. Validated before use: structural problems return `400 INVALID_SNAPSHOT` with one entry per problem. Omit the field entirely to use the newest dev version. ### Response **data.entity\_schemas** `array` The proposed entity types, in the same shape as [Get Agent Memory Schema](/api-v2/get/agents-id-memory-schema). Nothing is persisted. **errors** `null | array` `null` on success, or a list of error objects if the request failed. An agent with no saved version returns `404 AGENT_VERSION_NOT_FOUND`, and a configuration that cannot be compiled returns `400 AGENT_SNAPSHOT_INVALID`. ```json Response theme={null} { "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 } ], "outcomes": ["booked", "cancelled"] } ] }, "errors": null } ``` ```json No Saved Version theme={null} { "data": null, "errors": [ { "error": "AGENT_VERSION_NOT_FOUND", "message": "Agent has no saved versions yet (agent_version: \"dev\")" } ] } ``` ```json Will Not Compile theme={null} { "data": null, "errors": [ { "error": "AGENT_SNAPSHOT_INVALID", "message": "Agent version snapshot failed to compile" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Promote Agent to Production Source: https://docs.bland.ai/api-v2/post/agents-id-promote POST https://api.bland.ai/v2/agents/{agent_id}/promote Pin production to the version currently in staging. ### Overview Moves the agent's `production` pointer to whatever `staging` is pinned to and records a deployment carrying that version's original semver; promoting never mints a new number. Phone numbers attached to the agent begin answering with the promoted version. No request body. The server does not run checks here: start one with [Start Check Run](/api-v2/post/agents-id-environments-env-check-runs) beforehand and gate on its result yourself. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Response **data.semver** `string` The promoted version's number, for example `1.4.0`. **data.environments** `array` The agent's three environments after the promote. Each has `id`, `env_type` (`dev`, `staging`, or `production`), and `current_version_id` (the pinned version, or `null` if unpinned). `staging` and `production` now point at the same version. **errors** `null | array` `null` on success, or a list of error objects if the request failed. Returns `400 STAGING_UNPINNED` when nothing has been published to staging yet. ```json Response theme={null} { "data": { "semver": "1.4.0", "environments": [ { "id": "3d5a2d9b-0457-4610-b6d0-86d09b42d8bc", "env_type": "dev", "current_version_id": null }, { "id": "f1ad8610-caea-4c4f-9d9b-3f35bf1a1a43", "env_type": "staging", "current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627" }, { "id": "de65595f-4fbf-4d9e-9ce4-13dd995e863e", "env_type": "production", "current_version_id": "46201abd-c8e6-4095-a65f-d5135a673627" } ] }, "errors": null } ``` ```json Staging Unpinned theme={null} { "data": null, "errors": [ { "error": "STAGING_UNPINNED", "message": "Publish to staging before promoting to production" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Publish Agent to Staging Source: https://docs.bland.ai/api-v2/post/agents-id-publish POST https://api.bland.ai/v2/agents/{agent_id}/publish Publish a version to the staging environment. ### Overview Moves the agent's `staging` pointer. The body picks one of three modes: send `snapshot` to save a new version and publish it, send `version_id` to publish an existing dev-timeline version, or send neither to publish the newest saved dev version. A version published for the first time is given a semver using `bump`; republishing a version that already has one re-records its original number. Move it on to production with [Promote Agent to Production](/api-v2/post/agents-id-promote). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **snapshot** `object` A full agent configuration to save as a new version and publish, the same object accepted by [Create Agent Version](/api-v2/post/agents-id-versions). Top-level keys: `behavior` (`{ nodes, edges }`), `settings` (`displayName` and `systemPrompt` strings, optional `guardrails` with at most 5 custom entries), `contact` (`inboundNumbers` array), and optional `knowledge` (`{ kbIds: string[] }`). Serialized size must not exceed 2 MB. Returns `400 INVALID_SNAPSHOT` with one error entry per problem. Custom guardrails require an enterprise plan: a snapshot that adds one on another plan returns `403 ENTERPRISE_REQUIRED`. When present, `version_id` is ignored. **version\_id** `string` ID of an existing version on the agent's dev timeline to publish without saving anything new. Versions saved on a branch are not accepted; merge the branch first. Returns `404 VERSION_NOT_FOUND` if the ID is not on the dev timeline. Ignored when `snapshot` is present. **bump** `string` (default: patch) Which component to increment when this publish mints a new version number: `patch`, `minor`, or `major`. The increment is applied to the highest number ever minted for the agent, so a first publish yields `0.0.1`, `0.1.0`, or `1.0.0`. Ignored when the version already has a number. Returns `400 INVALID_BUMP` for any other value. ### Response Returns `201` on success. Returns `200` instead when `version_id` names the version already pinned to staging; nothing changes and the current number is returned. **data.version** `object` The published version, including its full `snapshot`. **version object** **id** `string` Unique identifier for the version. **org\_id** `string` The organization that owns the version. **agent\_id** `string` The agent the version belongs to. **branch\_id** `null` Always `null`; only dev-timeline versions can be published. **snapshot** `object` The agent configuration stored in this version. **name** `string | null` The version's saved name, or `null`. **created\_via** `string` `manual` or `autosave`, depending on how the version was originally saved. A version created by this call is `manual`. **revision** `integer` Rewrite counter for autosaved versions. `0` for a version created by this call. **created\_by** `string | null` ID of the user who saved the version, or `null` when saved with an org-level key. **created\_at** `string` ISO 8601 timestamp the version was saved. **data.semver** `string` The version number recorded on this deployment, for example `1.4.0`. **data.environments** `array` The agent's three environments after the publish. Each has `id`, `env_type` (`dev`, `staging`, or `production`), and `current_version_id` (the pinned version, or `null` if unpinned). **data.warnings** `string[]` Non-blocking advisories about the saved snapshot (for example a transfer step with no target). Only present in `snapshot` mode and only when there is at least one. **data.warning\_details** `array` Present alongside `warnings`. Each entry has `message` and, when the advisory concerns a single step, `nodeId`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. Returns `404 NOT_FOUND` for an unknown agent, `400 NO_VERSIONS` when the body has neither `snapshot` nor `version_id` and the agent has no saved versions, and `409 PUBLISH_IN_PROGRESS` when another publish for the same agent is still running; retry after a moment. ```json Response theme={null} { "data": { "version": { "id": "5bf56fc0-6ad5-4cd9-bb96-90cb63121526", "org_id": "cee059fe-ac03-4fb4-acb1-6e8ef9dc4c39", "agent_id": "9e676162-cf94-4d38-b9e7-4f2e8528989b", "branch_id": null, "snapshot": { "behavior": { "nodes": [], "edges": [] }, "settings": { "displayName": "Front desk", "systemPrompt": "You answer calls for Northwind Dental and book appointments." }, "contact": { "inboundNumbers": [] } }, "name": null, "created_via": "manual", "revision": 0, "created_by": "68140a61-70e5-4a16-a5dc-70a0b923f52b", "created_at": "2026-09-10T19:02:44.310Z" }, "semver": "1.4.0", "environments": [ { "id": "a8e0f34d-0d4a-421e-b13e-26dd1bbd5161", "env_type": "dev", "current_version_id": null }, { "id": "c0835434-da77-4691-8452-bcfd7a2e6bee", "env_type": "staging", "current_version_id": "5bf56fc0-6ad5-4cd9-bb96-90cb63121526" }, { "id": "95e84904-2fe9-45e8-bb2a-137eb5bb40eb", "env_type": "production", "current_version_id": "65039217-bb14-4b1a-85b4-bfde372485a3" } ] }, "errors": null } ``` ```json Invalid Snapshot theme={null} { "data": null, "errors": [ { "error": "INVALID_SNAPSHOT", "message": "settings.systemPrompt must be a string" }, { "error": "INVALID_SNAPSHOT", "message": "contact.inboundNumbers must be an array" } ] } ``` ```json Nothing To Publish theme={null} { "data": null, "errors": [ { "error": "NO_VERSIONS", "message": "Save a version before publishing to staging" } ] } ``` ```json Conflict theme={null} { "data": null, "errors": [ { "error": "PUBLISH_IN_PROGRESS", "message": "Another publish is in progress for this agent, please retry" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Roll Back Agent Source: https://docs.bland.ai/api-v2/post/agents-id-rollback POST https://api.bland.ai/v2/agents/{agent_id}/rollback Repoint production at a previously deployed version. ### Overview Moves the agent's `production` pointer back to a version that has been deployed to production before, recording a new deployment with that version's original semver. Phone numbers attached to the agent begin answering with the restored version. Find candidates with [List Agent Deployments](/api-v2/get/agents-id-deployments), where `is_rollback_eligible` is `true`. `staging` is not changed. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **version\_id** `string` *required* ID of the version to restore. It must belong to this agent, have at least one production deployment on record, and not be the current production pin. Missing or empty returns `400 BAD_REQUEST`. A version never deployed to production, or one that is already live, also returns `400 BAD_REQUEST` with a message explaining which. An ID that is not one of this agent's versions returns `404 NOT_FOUND`. ### Response **data.semver** `string` The restored version's number, for example `1.3.1`. **data.environments** `array` The agent's three environments after the rollback. Each has `id`, `env_type` (`dev`, `staging`, or `production`), and `current_version_id` (the pinned version, or `null` if unpinned). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "semver": "1.3.1", "environments": [ { "id": "3b4442ac-eaff-4a8d-bd9b-103affc43fc4", "env_type": "dev", "current_version_id": null }, { "id": "6e92b74f-071f-4a09-85a5-5a3e6625ddf5", "env_type": "staging", "current_version_id": "4671db05-2d34-4171-9626-79a468e73f61" }, { "id": "2c0ff980-fedf-4ebc-9117-dd21702d6e27", "env_type": "production", "current_version_id": "e6926b11-5513-4187-9dcf-5800b899f8da" } ] }, "errors": null } ``` ```json Never Deployed theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Cannot roll back to a version that was never deployed to production" } ] } ``` ```json Already Current theme={null} { "data": null, "errors": [ { "error": "BAD_REQUEST", "message": "Production is already pinned to this version" } ] } ``` ```json Version Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Version not found on this agent" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Agent Version Source: https://docs.bland.ai/api-v2/post/agents-id-versions POST https://api.bland.ai/v2/agents/{agent_id}/versions Save an agent configuration snapshot as a new version. ### Overview Validates a full configuration snapshot and saves it as an immutable version on the agent's dev timeline, or on an open branch when `branch_id` is set. Saving does not deploy anything; staging and production pin a version through [Publish Agent](/api-v2/post/agents-id-publish) and [Promote Agent](/api-v2/post/agents-id-promote). Read the current head with [Get Latest Agent Version](/api-v2/get/agents-id-versions-latest). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **agent\_id** `string` *required* The agent's unique identifier. ### Body Parameters **snapshot** `object` *required* The complete agent configuration: `behavior`, `settings`, `contact`, and optionally `knowledge`. Structural problems return `400 INVALID_SNAPSHOT` with one error entry per problem (up to 20). A snapshot larger than 2,097,152 bytes when serialized is rejected outright. > [accordion] behavior (required) > > The root behavior graph, shaped `{ "nodes": [], "edges": [] }`. > > Each node needs a string `id` that is unique within its flow, a `position` of `{ "x": number, "y": number }`, and a `data` object. `type` names the node kind (for example `start`, `scenario`, `complex-scenario`, `auth`). Container nodes carry a nested `data.flow` with the same `{ nodes, edges }` shape, validated recursively; flows may nest at most 10 levels deep. > > Each edge needs string `id`, `source`, and `target` values, and `source` and `target` must reference nodes in the same flow. > [accordion] settings (required) > > Agent-wide configuration. `displayName` and `systemPrompt` must be strings. The remaining keys the dashboard writes (`voice`, `languages`, `enableMemory`, `interruptionSensitivity`, `backgroundNoise`, `voiceCall`, `webChat`, `requestData`, `metadata`, `color`, and others) are stored as sent and applied at call time. > > `guardrails` is optional. When present it must be an array (not `null`). Each entry has a unique string `id`, a `kind`, and an `actions` array whose items are `{ "type": "end_call" }`, `{ "type": "transfer", "phoneNumber": "..." }`, or `{ "type": "move_to_node", "nodeId": "..." }`. Accepted kinds: > > * `tcpa:ai_disclosure`, `tcpa:recording_disclosure`, `tcpa:self_introduction`: also require `endSeconds`, an integer from 1 to 600. > * `tcpa:opt_out`: no extra fields. > * `custom`: requires a non-empty `name`, a string `description`, and a non-empty `prompt`. At most 5 custom guardrails per agent. > > Each built-in kind may appear once. A `move_to_node` target must be a step the agent can actually move to. Custom guardrails require an enterprise plan: adding one that is not already saved on this agent returns `403 ENTERPRISE_REQUIRED`. Custom guardrails already saved keep running and can still be edited. > [accordion] contact (required) > > `inboundNumbers` must be an array of phone number strings routed to this agent, or a single `{{env.KEY}}` reference string that resolves to an environment variable at call time. > [accordion] knowledge (optional) > > When present, must be `{ "kbIds": string[] }`, the knowledge base item IDs the agent retrieves against on every call. `null` is rejected; omit the key instead. Order carries no meaning. **name** `string` Display name for the version. Leading and trailing whitespace is trimmed; an empty or whitespace-only value is treated as no name. A named version is always written as a new row and is never pruned. **branch\_id** `string` Save onto an open branch instead of the dev timeline. Returns `404 BRANCH_NOT_FOUND` if the branch is not open or does not belong to this agent. **autosave** `boolean` (default: false) Mark this as an editor background save. While the timeline's head is an unnamed autosave that nothing references (no environment pin, deployment, branch base, experiment, or check run), the save rewrites that head in place and increments its `revision` instead of appending. The response then carries version metadata only, without `org_id` or `snapshot`. Any value other than `true` is treated as `false`. **parent\_version\_id** `string | null` Compare-and-set guard. The version ID you believe is the current head of the timeline you are saving onto; send `null` to assert the timeline is empty. On a branch with no saves of its own, the head is the branch's base version. If the real head differs, nothing is written and the response is `409 STALE_HEAD` with the real head's ID and revision at the top level of the body as `head_version_id` and `head_revision`. Omit the field to skip the check. **parent\_revision** `integer` Second half of the compare-and-set: the head's `revision` as you last saw it. An in-place autosave keeps the head's ID stable, so `parent_version_id` alone cannot detect a concurrent autosave from another editor; the revision can. Checked only when `parent_version_id` matches. Non-integer values are ignored. Omit to skip. ### Response Returns `201` on success. A manual save returns the full version row. An `autosave` returns the same object without `org_id` and `snapshot`. **data** `object` The saved version. **version object** **id** `string` Unique identifier for the version. Send it back as `parent_version_id` on your next save. **org\_id** `string` The organization that owns the agent. Omitted on autosave responses. **agent\_id** `string` The agent this version belongs to. **branch\_id** `string | null` The branch the version was saved onto, or `null` on the dev timeline. **snapshot** `object` The configuration as saved: `behavior`, `settings`, `contact`, and `knowledge` when supplied. Omitted on autosave responses. **name** `string | null` The version's display name, or `null` if none was given. **created\_via** `string` `manual` or `autosave`. **revision** `integer` Starts at `0` and increments each time an autosave rewrites this row in place. Send it back as `parent_revision` on your next save. **created\_by** `string | null` ID of the user who saved the version, or `null` when saved with an org-level key. **created\_at** `string` ISO 8601 timestamp of the first write. Not updated when an autosave rewrites the row. **warnings** `array` Non-blocking advisories about the saved configuration (for example a transfer step with no target). Present only when there are any. **warning\_details** `array` The same advisories as objects with `message` and, when the advisory is about one step, `nodeId`. Present only when `warnings` is. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "53bb14d7-2bb3-400b-81fb-45f23017bf84", "org_id": "4bb834b5-8e95-487a-908d-d712a201008c", "agent_id": "ec74c83e-5370-450b-9aa0-59757ec25a81", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "d375e44c-69d4-43c3-9e06-6f9ef052fd85", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "a0ddbf3b-0d9a-42a3-90c4-2dcc66dcd2e0", "type": "scenario", "position": { "x": 320, "y": 0 }, "data": { "name": "Book appointment", "rule": "Collect the caller's preferred date and time, then confirm the booking.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [], "entry": { "mode": "llm", "label": "Caller wants to book", "description": "", "alwaysPick": false, "conditions": [] } } } ], "edges": [ { "id": "af8cb5af-9407-4abd-ba41-bb39f0da2682", "source": "d375e44c-69d4-43c3-9e06-6f9ef052fd85", "target": "a0ddbf3b-0d9a-42a3-90c4-2dcc66dcd2e0" } ] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for a dental clinic.", "languages": ["en"], "enableMemory": false, "backgroundNoise": "off" }, "contact": { "inboundNumbers": ["+14155550123"] }, "knowledge": { "kbIds": [] } }, "name": "Adds booking flow", "created_via": "manual", "revision": 0, "created_by": "6109c149-783b-4882-943f-0bd9c5dd6cdf", "created_at": "2026-09-10T23:02:11.418Z" }, "errors": null } ``` ```json Invalid Snapshot theme={null} { "data": null, "errors": [ { "error": "INVALID_SNAPSHOT", "message": "settings.displayName must be a string" }, { "error": "INVALID_SNAPSHOT", "message": "contact.inboundNumbers must be an array" } ] } ``` ```json Stale Head theme={null} { "data": null, "errors": [ { "error": "STALE_HEAD", "message": "The agent was updated by someone else — reload to get the latest." } ], "head_version_id": "0483f68e-d39b-42da-a7f5-c18a2264389c", "head_revision": 3 } ``` ```json Enterprise Required theme={null} { "data": null, "errors": [ { "error": "ENTERPRISE_REQUIRED", "message": "Adding a custom guardrail requires an enterprise plan. Custom guardrails already saved on this agent keep running and can still be edited." } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "NOT_FOUND", "message": "Agent not found" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Migrate Pathway Source: https://docs.bland.ai/api-v2/post/agents-migrate POST https://api.bland.ai/v2/agents/migrate Plan and build an agent from a legacy pathway graph. ### Overview Takes an exported pathway graph and uses Bland's migration planner to re-architect it as an agent: the planner decides the scenario structure, and every legacy prompt, code snippet, and webhook body is carried over verbatim. By default the call is a dry run that returns the plan, the proposed agent snapshot, and a lint report for review; set `create` to `true` to also persist a new agent with its first version. A run takes several minutes; to receive progress events while it runs, use [Stream Pathway Migration](/api-v2/post/agents-migrate-stream). For a deterministic conversion with no planner, see [Migrate Pathways](/api-v2/post/agents-migrate-pathways). Limited to 10 migration starts per hour per organization, counted together with [Stream Pathway Migration](/api-v2/post/agents-migrate-stream) and [Start Pathway Translation](/api-v2/post/agents-migrate-translations). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **pathway** `object` *required* The legacy pathway graph, in the shape the pathway editor exports. Returns `400 INVALID_PATHWAY` if `nodes` or `edges` is missing or `nodes` is empty, and `400 PATHWAY_TOO_LARGE` beyond 500 nodes, 2,000 edges, or 2 MB serialized. **pathway fields** **nodes** `array` *required* The pathway's nodes. Each has a string `id` and, typically, `type` and `data`. Must be non-empty. **edges** `array` *required* The pathway's edges. Each has `source` and `target` node IDs and optional `data`. May be empty. **name** `string` The pathway's name. Used to label the run and as the basis for the default agent name. **globalPrompt** `string` The pathway's global prompt, if it had one. **name** `string` Display name for the new agent when `create` is `true`. Whitespace is trimmed. Defaults to ` (migrated)`, or `unnamed pathway (migrated)` when the pathway has no name. **create** `boolean` (default: false) When `true`, the migrated snapshot is saved as a new agent with its first version and the response is `201`. Any other value is treated as `false` (dry run, `200`). ### Response Returns `200` for a dry run and `201` when an agent was created. Returns `422` when the migrated snapshot fails validation or lint, or, in create mode, when the planner's report contains a blocking loss (`MIGRATION_BLOCKING_LOSS`), an open question (`MIGRATION_OPEN_QUESTION`), or a custom-code step with no saved snippet (`MIGRATION_CUSTOM_CODE_UNSUPPORTED`). In those cases review the dry-run output before creating. **data.plan** `object` The planner's migration plan. It references legacy nodes by ID rather than repeating their content. **plan object** **displayName** `string` Proposed agent display name. **hubPrompt** `string` The prompt for the agent's central hub node, including a routing directory naming every scenario. **languages** `array` Spoken languages detected for the agent. Omitted when the planner did not set any. **requestData** `array` Request-data keys the pathway relied on, as `{ key, value }` pairs. Omitted when none. **scenarios** `array` Planned scenarios. Each has `kind` (`simple`, `complex`, or `auth-zone`), `name`, and `entry` (`mode` of `llm` or `deterministic`, `label`, and optional `description`, `alwaysPick`, `conditions`). A `simple` scenario carries `ruleParts` (text pieces, each either `{ text }` or `{ legacyPromptOf: }`) plus optional `variablesFrom`, `extraVariables`, `tools`, `carryToolsFrom`, and `settingsFrom`. A `complex` scenario carries `rule`, `steps`, and `edges`. An `auth-zone` carries `method`, `detail`, `steps`, `edges`, and `gates` (names of scenarios it protects). **endCalls** `array` Planned end-call nodes, each with `name`, `entry`, `promptParts`, and optional `variablesFrom` and `extraVariables`. **report** `object` The planner's accounting: `architectureSummary` (string), `dispositions` (one entry per legacy node group with `nodeIds`, `disposition`, `rationale`), `droppedOrApproximated` (entries with `item`, `severity` of `blocking`, `behavioral`, or `cosmetic`, and `note`), and `openQuestions` (strings). **data.snapshot** `object` The proposed agent configuration: `behavior` (`nodes` and `edges`), `settings`, `contact`, and optionally `knowledge`. This is the same shape [Create Agent Version](/api-v2/post/agents-id-versions) accepts, so you can edit it and save it to any agent. Abbreviated in the example below. **data.lint** `object` Structural checks on the snapshot: `errors` (array of strings; non-empty blocks creation) and `warnings` (array of strings). **data.usage** `object` Planner usage for the run: `inputTokens`, `outputTokens`, and `iterations`. **data.created** `boolean` `false` for a dry run, `true` when an agent and first version were saved. **data.agent** `object` Present only when `created` is `true`. The new agent record: `id`, `org_id`, `name`, `created_by` (`string | null`), `created_at`, `updated_at`, and `deleted_at` (`null`). Its `dev`, `staging`, and `production` environments are created unpinned; see [Get Agent](/api-v2/get/agents-id). **data.version** `object` Present only when `created` is `true`. The agent's first version: `id`, `org_id`, `agent_id`, `branch_id` (`null`), `snapshot` (identical to `data.snapshot`), `name` (`Migrated from pathway: `), `created_via` (`manual`), `revision` (`0`), `created_by` (`string | null`), and `created_at`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "plan": { "displayName": "Front desk", "hubPrompt": "Greet the caller and find out what they need.\n\n## Routing\n\nAfter each user turn, enter the scenario that matches where the conversation is now. The scenarios you can enter:\n\n- \"Book appointment\": the caller wants to schedule a visit", "languages": ["english"], "scenarios": [ { "kind": "simple", "name": "Book appointment", "entry": { "mode": "llm", "label": "Wants to book", "description": "The caller wants to schedule a visit" }, "ruleParts": [ { "legacyPromptOf": "73a855b4-7257-4c6e-bd7d-f151a763c9fa" } ], "variablesFrom": ["73a855b4-7257-4c6e-bd7d-f151a763c9fa"], "settingsFrom": "73a855b4-7257-4c6e-bd7d-f151a763c9fa" } ], "endCalls": [], "report": { "architectureSummary": "A two-node booking pathway collapsed into one hub and one booking scenario.", "dispositions": [ { "nodeIds": ["73a855b4-7257-4c6e-bd7d-f151a763c9fa"], "disposition": "Became scenario \"Book appointment\"", "rationale": "Single dialogue step with variable extraction." }, { "nodeIds": ["ddc0765a-8086-4826-bfaf-77b889fb3022"], "disposition": "Merged into the hub prompt", "rationale": "Greeting-only node with no branching." } ], "droppedOrApproximated": [], "openQuestions": [] } }, "snapshot": { "behavior": { "nodes": [ { "id": "inbound", "type": "inbound", "position": { "x": 360, "y": -180 }, "data": { "number": "" } }, { "id": "agent", "type": "agent", "position": { "x": 192, "y": 0 }, "data": { "prompt": "Greet the caller and find out what they need.\n\n## Routing\n\nAfter each user turn, enter the scenario that matches where the conversation is now. The scenarios you can enter:\n\n- \"Book appointment\": the caller wants to schedule a visit", "loopWhile": "", "variables": [] } }, { "id": "545fe342-06be-4151-aae2-bd10bf128464", "type": "scenario", "position": { "x": 0, "y": 260 }, "data": { "name": "Book appointment", "rule": "Ask which day and time works for the caller, then confirm the appointment back to them.", "target": { "kind": "dialogue", "label": "Book appointment" }, "loopWhile": "", "variables": [ { "id": "78bf9689-57fb-4106-9402-34bce288b561", "key": "appointment_time", "value": "The date and time the caller chose", "type": "string", "accurateSpelling": false } ], "entry": { "mode": "llm", "label": "Wants to book", "description": "The caller wants to schedule a visit", "alwaysPick": false, "conditions": [] } } } ], "edges": [ { "id": "e-inbound-agent", "source": "inbound", "target": "agent" }, { "id": "e-agent-book", "source": "agent", "target": "545fe342-06be-4151-aae2-bd10bf128464", "data": { "mode": "llm", "label": "Wants to book", "description": "The caller wants to schedule a visit", "alwaysPick": false, "conditions": [] } } ] }, "settings": { "displayName": "Front desk", "systemPrompt": "You are the front desk assistant for a dental office.", "voice": "", "languages": ["english"], "enableMemory": false, "interruptionSensitivity": 350, "backgroundNoise": "off" }, "contact": { "inboundNumbers": [] } }, "lint": { "errors": [], "warnings": [] }, "usage": { "inputTokens": 48211, "outputTokens": 6120, "iterations": 4 }, "created": false }, "errors": null } ``` ```json Invalid Pathway theme={null} { "data": null, "errors": [ { "error": "INVALID_PATHWAY", "message": "body.pathway must be a legacy pathway graph with non-empty nodes[] and edges[]" } ] } ``` ```json Create Blocked theme={null} { "data": null, "errors": [ { "error": "MIGRATION_OPEN_QUESTION", "message": "open question: The transfer node has no phone number configured. Which number should the agent transfer to?" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many pathway migrations started for this organization — please wait before starting another." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Migrate Pathways Source: https://docs.bland.ai/api-v2/post/agents-migrate-pathways POST https://api.bland.ai/v2/agents/migrate/pathways Convert stored or inline pathways into agent scenarios. ### Overview Deterministically converts up to 20 pathways into complex scenarios, one per pathway, with no AI planning involved. Each pathway is either referenced by ID or supplied inline as an exported graph (the JSON-file import). By default the scenarios are wrapped in a new agent whose system prompt is built from the pathways' global prompts, and the agent plus its first version are created (`201`). Set `create` to `false` to receive just the scenario nodes for insertion into an existing agent (`200`). For planner-driven translation, use [Start Pathway Translation](/api-v2/post/agents-migrate-translations). Limited to 60 imports per hour per organization. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **pathways** `array` *required* One to 20 entries. Each entry must contain exactly one of `pathway_id` or `pathway`. Returns `400 INVALID_PATHWAYS` for an empty array or a malformed entry, and `400 TOO_MANY_PATHWAYS` beyond 20. **entry fields** **pathway\_id** `string` UUID of a pathway your organization owns. Returns `422 PATHWAYS_MIGRATION_FAILED` if the pathway is not found in your organization. **version** `integer` Stored pathways only. Pin a specific version number (a positive integer). Defaults to the pathway's published production version, or its live graph when nothing is published. Returns `422 PATHWAYS_MIGRATION_FAILED` if the version does not exist, and `400 INVALID_PATHWAYS` if set on an inline entry. **mode** `string` (default: one\_to\_one) `one_to_one` or `translate`. This endpoint only performs `one_to_one`; a `translate` entry returns `400 TRANSLATE_NOT_SUPPORTED`. Inline entries must be `one_to_one`. **pathway** `object` An exported pathway graph sent inline. Accepts both the legacy export (`nodes`, `edges`) and the current builder export (`nodes`, `edges`, `globalPrompt`, `memoryEnabled`, `startNodeId`, `analysisOptions`; the last two are ignored). Fields: `nodes` (required, non-empty array of objects, at most 2,000), `edges` (array of objects, at most 4,000, defaults to empty), `name` (string, defaults to `Imported pathway`), `description` (string), `globalPrompt` (string), `memoryEnabled` (boolean). Returns `400 INVALID_PATHWAYS` for a shape or size violation, and `422 INVALID_PATHWAYS` when node or edge data inside the graph cannot be converted. **name** `string` Display name for the new agent. Whitespace is trimmed. Defaults to the pathway's name when exactly one pathway is given, otherwise `Migrated pathways`. **create** `boolean` (default: true) When `false`, no agent is created; the response carries the converted scenario nodes instead, ready to add to an existing agent's `behavior.nodes` with [Create Agent Version](/api-v2/post/agents-id-versions). ### Response Returns `201` when an agent was created and `200` in convert-only mode. Returns `422` with `INVALID_MIGRATED_SNAPSHOT` or `MIGRATION_LINT_FAILED` when the converted result does not validate. **data.created** `boolean` `true` when an agent and first version were saved, `false` in convert-only mode. **data.agent** `object` Present when `created` is `true`. The new agent record: `id`, `org_id`, `name`, `created_by` (`string | null`), `created_at`, `updated_at`, and `deleted_at` (`null`). See [Get Agent](/api-v2/get/agents-id) for its environments. **data.version** `object` Present when `created` is `true`. The agent's first version: `id`, `org_id`, `agent_id`, `branch_id` (`null`), `snapshot` (the full agent configuration, abbreviated in the example below), `name` (`Migrated from N pathway(s)`), `created_via` (`manual`), `revision` (`0`), `created_by` (`string | null`), and `created_at`. **data.scenarios** `array` Present when `created` is `false`. One `complex-scenario` node per pathway, each with `id`, `type`, `position`, and `data` (including the nested `data.flow`). IDs are unique within the response; remap them if they collide with nodes already in your agent. **data.warnings** `array` Human-readable notes about constructs the conversion could not carry faithfully. In convert-only mode this also notes each pathway whose global prompt or memory setting was not carried, since those belong to the agent rather than a scenario. When several pathways have global prompts in create mode, a warning notes they were merged into the system prompt. **data.lint** `object` Structural checks on the converted result: `errors` (always empty on success) and `warnings` (array of strings). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "created": true, "agent": { "id": "a5cac058-df94-428d-b0e8-2db52b8eff1b", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Migrated pathways", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T19:30:41.118Z", "updated_at": "2026-09-10T19:30:41.118Z", "deleted_at": null }, "version": { "id": "34db303a-e928-4821-901f-8be9c60f9fe2", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "agent_id": "a5cac058-df94-428d-b0e8-2db52b8eff1b", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "inbound", "type": "inbound", "position": { "x": 360, "y": -180 }, "data": { "number": "" } }, { "id": "agent", "type": "agent", "position": { "x": 192, "y": 0 }, "data": { "prompt": "Greet the caller and find out what they need.\n\n## Routing\n\nAfter each user turn, enter the scenario that matches where the conversation is now. The scenarios you can enter:\n\n- \"Order status\": Look up an existing order\n- \"Returns\": Start a return", "loopWhile": "", "variables": [] } }, { "id": "8fcbc0f5-6756-444b-b4b0-0355e883ea20", "type": "complex-scenario", "position": { "x": -380, "y": 260 }, "data": { "name": "Order status", "rule": "Look up an existing order", "target": { "kind": "dialogue", "label": "Order status" }, "entry": { "mode": "llm", "label": "Order status", "description": "Look up an existing order", "alwaysPick": false, "conditions": [] }, "flow": { "nodes": [ { "id": "start", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "b325a789-9ddc-422c-a8cf-4840853f4147", "type": "prompt", "position": { "x": 0, "y": 160 }, "data": { "name": "Get order number", "prompt": "Ask for the order number and read it back to confirm.", "useStaticText": false, "loopWhile": "", "variables": [], "useAudioExtraction": false, "ignorePreviousExtractions": false, "settings": {} } }, { "id": "end", "type": "end", "position": { "x": 0, "y": 320 }, "data": {} } ], "edges": [ { "id": "e-start-order", "source": "start", "target": "b325a789-9ddc-422c-a8cf-4840853f4147" }, { "id": "e-order-end", "source": "b325a789-9ddc-422c-a8cf-4840853f4147", "target": "end" } ] } } }, { "id": "5bea25e9-89b5-49c5-813d-5929d01f03f3", "type": "complex-scenario", "position": { "x": 0, "y": 260 }, "data": { "name": "Returns", "rule": "Start a return", "target": { "kind": "dialogue", "label": "Returns" }, "entry": { "mode": "llm", "label": "Returns", "description": "Start a return", "alwaysPick": false, "conditions": [] }, "flow": { "nodes": [ { "id": "start", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "db3149cc-131b-40ed-a39e-8e4f8cec6bd8", "type": "prompt", "position": { "x": 0, "y": 160 }, "data": { "name": "Reason for return", "prompt": "Ask why the caller is returning the item.", "useStaticText": false, "loopWhile": "", "variables": [], "useAudioExtraction": false, "ignorePreviousExtractions": false, "settings": {} } }, { "id": "end", "type": "end", "position": { "x": 0, "y": 320 }, "data": {} } ], "edges": [ { "id": "e-start-reason", "source": "start", "target": "db3149cc-131b-40ed-a39e-8e4f8cec6bd8" }, { "id": "e-reason-end", "source": "db3149cc-131b-40ed-a39e-8e4f8cec6bd8", "target": "end" } ] } } } ], "edges": [ { "id": "e-inbound-agent", "source": "inbound", "target": "agent" }, { "id": "e-agent-orders", "source": "agent", "target": "8fcbc0f5-6756-444b-b4b0-0355e883ea20", "data": { "mode": "llm", "label": "Order status", "description": "Look up an existing order", "alwaysPick": false, "conditions": [] } }, { "id": "e-agent-returns", "source": "agent", "target": "5bea25e9-89b5-49c5-813d-5929d01f03f3", "data": { "mode": "llm", "label": "Returns", "description": "Start a return", "alwaysPick": false, "conditions": [] } } ] }, "settings": { "displayName": "Migrated pathways", "systemPrompt": "", "voice": "", "languages": ["english"], "enableMemory": false, "interruptionSensitivity": 350, "backgroundNoise": "off" }, "contact": { "inboundNumbers": [] } }, "name": "Migrated from 2 pathway(s)", "created_via": "manual", "revision": 0, "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T19:30:41.118Z" }, "warnings": [], "lint": { "errors": [], "warnings": [] } }, "errors": null } ``` ```json Invalid Pathways theme={null} { "data": null, "errors": [ { "error": "INVALID_PATHWAYS", "message": "every body.pathways entry needs exactly one of pathway_id or pathway" } ] } ``` ```json Translate Not Supported theme={null} { "data": null, "errors": [ { "error": "TRANSLATE_NOT_SUPPORTED", "message": "AI-translated pathway migration runs as a job — POST /v2/agents/migrate/translations, or switch those pathways to 1:1 to migrate synchronously" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many pathway imports for this organization — please wait before importing another." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Migrate Persona Source: https://docs.bland.ai/api-v2/post/agents-migrate-persona POST https://api.bland.ai/v2/agents/migrate/persona Build an agent from a persona and its attached pathways. ### Overview Deterministically converts a persona into a new agent, with no AI planning involved. The persona's prompts, voice, and call settings become the agent's settings, each attached pathway becomes a complex scenario holding a one-to-one conversion of its graph, and the persona's skills become simple scenarios. The persona's published version is used, falling back to its draft. The agent and its first version are always created; the response is `201`. To have the planner re-architect the persona's pathways instead, use [Start Pathway Translation](/api-v2/post/agents-migrate-translations) with the same body. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **persona\_id** `string` *required* UUID of a persona in your organization. Returns `400 INVALID_PERSONA_ID` if it is not a UUID, `404 PERSONA_NOT_FOUND` if no such persona exists in your organization, and `422 PERSONA_HAS_NO_VERSION` if the persona has neither a published nor a draft version. **name** `string` Display name for the new agent. Whitespace is trimmed. Defaults to the persona's name. **pathway\_modes** `array` One entry per pathway attached to the persona, in the persona's order, each `one_to_one` or `translate`. The length must match the persona's pathway count or the request returns `400 INVALID_PATHWAY_MODES`. This endpoint only performs `one_to_one`; any `translate` entry returns `400 TRANSLATE_NOT_SUPPORTED`. Omit the field to convert every pathway one-to-one. ### Response Returns `201` on success. Returns `422` with `INVALID_MIGRATED_SNAPSHOT` or `MIGRATION_LINT_FAILED` when the converted agent does not validate, and `422 PERSONA_MIGRATION_FAILED` when a referenced pathway cannot be loaded (for example, it was deleted or belongs to another organization). **data.agent** `object` The new agent record. **agent object** **id** `string` Unique identifier for the agent. **org\_id** `string` The organization that owns the agent. **name** `string` The agent's display name. **created\_by** `string | null` ID of the user who ran the migration, or `null` when run with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **updated\_at** `string` ISO 8601 timestamp of the last update. **deleted\_at** `null` Always `null` on a live agent. **data.version** `object` The agent's first version, saved on the dev timeline. **version object** **id** `string` Unique identifier for the version. **org\_id** `string` The organization that owns the version. **agent\_id** `string` The agent this version belongs to. **branch\_id** `null` Always `null`; migrations save to the dev timeline, not a branch. **snapshot** `object` The full agent configuration (`behavior`, `settings`, `contact`, and `knowledge` when the persona had knowledge base items). Same shape as [Create Agent Version](/api-v2/post/agents-id-versions) accepts. Abbreviated in the example below. **name** `string` `Migrated from persona: `. **created\_via** `string` Always `manual`. **revision** `integer` Always `0` on a new version. **created\_by** `string | null` ID of the user who ran the migration, or `null` when run with an org-level key. **created\_at** `string` ISO 8601 timestamp of creation. **data.warnings** `array` Human-readable notes about constructs the one-to-one conversion could not carry faithfully. Review each before publishing the agent. **data.lint** `object` Structural checks on the saved snapshot: `errors` (always empty on a `201`) and `warnings` (array of strings). **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "agent": { "id": "3096f27e-d17c-4fe8-a469-dac7da1d8d57", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "name": "Support line", "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T19:02:15.907Z", "updated_at": "2026-09-10T19:02:15.907Z", "deleted_at": null }, "version": { "id": "d24c0c2b-ea67-4ad2-97f7-aad1c9aef52f", "org_id": "45794f66-94ca-44a2-9248-202c5ff22717", "agent_id": "3096f27e-d17c-4fe8-a469-dac7da1d8d57", "branch_id": null, "snapshot": { "behavior": { "nodes": [ { "id": "inbound", "type": "inbound", "position": { "x": 360, "y": -180 }, "data": { "number": "" } }, { "id": "agent", "type": "agent", "position": { "x": 192, "y": 0 }, "data": { "prompt": "You are the support line for Acme Utilities. Greet the caller and find out what they need.\n\n## Routing\n\nAfter each user turn, enter the scenario that matches where the conversation is now. The scenarios you can enter:\n\n- \"Report an outage\": the caller has lost service", "loopWhile": "", "variables": [] } }, { "id": "67a8c229-341e-423f-8295-e837e301134b", "type": "complex-scenario", "position": { "x": 0, "y": 260 }, "data": { "name": "Report an outage", "rule": "The caller has lost service", "target": { "kind": "dialogue", "label": "Report an outage" }, "entry": { "mode": "llm", "label": "Report an outage", "description": "The caller has lost service", "alwaysPick": false, "conditions": [] }, "flow": { "nodes": [ { "id": "start", "type": "start", "position": { "x": 0, "y": 0 }, "data": {} }, { "id": "08e7085c-e318-42d8-a071-a5cd91f202cc", "type": "prompt", "position": { "x": 0, "y": 160 }, "data": { "name": "Collect address", "prompt": "Ask for the service address and when the outage started.", "useStaticText": false, "loopWhile": "", "variables": [], "useAudioExtraction": false, "ignorePreviousExtractions": false, "settings": {} } }, { "id": "end", "type": "end", "position": { "x": 0, "y": 320 }, "data": {} } ], "edges": [ { "id": "e-start-address", "source": "start", "target": "08e7085c-e318-42d8-a071-a5cd91f202cc" }, { "id": "e-address-end", "source": "08e7085c-e318-42d8-a071-a5cd91f202cc", "target": "end" } ] } } } ], "edges": [ { "id": "e-inbound-agent", "source": "inbound", "target": "agent" }, { "id": "e-agent-outage", "source": "agent", "target": "67a8c229-341e-423f-8295-e837e301134b", "data": { "mode": "llm", "label": "Report an outage", "description": "The caller has lost service", "alwaysPick": false, "conditions": [] } } ] }, "settings": { "displayName": "Support line", "systemPrompt": "Be concise and empathetic. Never promise a restoration time.", "voice": "maya", "languages": ["english"], "enableMemory": true, "interruptionSensitivity": 350, "backgroundNoise": "off" }, "contact": { "inboundNumbers": [] }, "knowledge": { "kbIds": ["53156238-c466-459f-8057-1f88c256d55b"] } }, "name": "Migrated from persona: Support line", "created_via": "manual", "revision": 0, "created_by": "bd8ae00b-c51d-4364-b1b3-245ad579c44a", "created_at": "2026-09-10T19:02:15.907Z" }, "warnings": [], "lint": { "errors": [], "warnings": [] } }, "errors": null } ``` ```json Persona Not Found theme={null} { "data": null, "errors": [ { "error": "PERSONA_NOT_FOUND", "message": "persona not found in this organization" } ] } ``` ```json Translate Not Supported theme={null} { "data": null, "errors": [ { "error": "TRANSLATE_NOT_SUPPORTED", "message": "AI-translated persona pathways run as a job — POST /v2/agents/migrate/translations with the persona_id, or switch those pathways to 1:1 to migrate synchronously" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Stream Pathway Migration Source: https://docs.bland.ai/api-v2/post/agents-migrate-stream POST https://api.bland.ai/v2/agents/migrate/stream Run a pathway migration with live progress events. ### Overview Runs the same migration as [Migrate Pathway](/api-v2/post/agents-migrate) with the same body and the same outcome, but delivers it as a Server-Sent Events stream so you can show progress during the multi-minute planner run. The final `done` event carries exactly the status, `data`, and `errors` the JSON endpoint would have returned. If you disconnect before the run finishes, the planner is aborted and nothing is created. Limited to 10 migration starts per hour per organization, counted together with [Migrate Pathway](/api-v2/post/agents-migrate) and [Start Pathway Translation](/api-v2/post/agents-migrate-translations). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **pathway** `object` *required* The legacy pathway graph, in the shape the pathway editor exports: `nodes` (required, non-empty array), `edges` (required array, may be empty), and optional `name` and `globalPrompt`. Returns `400 INVALID_PATHWAY` if `nodes` or `edges` is missing or `nodes` is empty, and `400 PATHWAY_TOO_LARGE` beyond 500 nodes, 2,000 edges, or 2 MB serialized. See [Migrate Pathway](/api-v2/post/agents-migrate) for field details. **name** `string` Display name for the new agent when `create` is `true`. Defaults to ` (migrated)`, or `unnamed pathway (migrated)` when the pathway has no name. **create** `boolean` (default: false) When `true`, the migrated snapshot is saved as a new agent with its first version. Any other value is treated as `false` (dry run). ### Response Body validation and the rate limit are checked before the stream opens, so those failures arrive as ordinary JSON responses (`400` or `429`). Once accepted, the response is `200` with `Content-Type: text/event-stream`, `Cache-Control: no-cache, no-transform`, and `Connection: keep-alive`. Each event is a single `data:` line holding a JSON object whose `type` field identifies it; no `event:` names are used. A comment line `: ping` is sent every 10 seconds as a heartbeat and should be ignored. The stream closes after the `done` or `error` event. **type** `string` Present on every event. One of `start`, `read_reference`, `read_nodes`, `iteration`, `plan_submitted`, `materializing`, `done`, `error`. **start** `event` Emitted once when the planner begins. **start payload** **pathway** `string` The pathway label (its `name`, or `unnamed pathway`). **nodes** `integer` Number of nodes in the submitted graph. **edges** `integer` Number of edges in the submitted graph. **read\_reference** `event` The planner consulted one of its internal reference documents. `name` (string) identifies the document. **read\_nodes** `event` The planner read the full content of specific legacy nodes. `ids` (array of strings) lists their IDs. **iteration** `event` One planner turn finished. Turns can be one to three minutes apart. **iteration payload** **iteration** `integer` 1-based turn counter. **stopReason** `string | null` Why the turn ended, for example `tool_use` or `end_turn`. **outputTokens** `integer` Tokens the planner produced in this turn. **toolCalls** `array` Names of the planner actions taken this turn, such as `read_nodes` or `submit_migration_plan`. **plan\_submitted** `event` The planner submitted a plan. Carries `scenarios`, `endCalls`, and `openQuestions` (integers). A rejected plan is repaired and resubmitted within the same run, so this can fire more than once. **materializing** `event` The plan is being turned into an agent snapshot. No other fields. **done** `event` The run finished. Emitted once, then the stream closes. **done payload** **status** `integer` The HTTP status [Migrate Pathway](/api-v2/post/agents-migrate) would have returned: `200` (dry run), `201` (agent created), `422` (validation, lint, or create blocked), or `500`. **data** `object` The same `data` object as [Migrate Pathway](/api-v2/post/agents-migrate): `plan`, `snapshot`, `lint`, `usage`, `created`, and in create mode `agent` and `version`. Unlike the JSON endpoint, a `422` here still includes the partial `data` (at minimum `plan`, `lint`, and `usage`) so you can inspect what failed. **errors** `null | array` `null` when `status` is `200` or `201`, otherwise the error list. **error** `event` The planner itself failed. `message` (string) is safe to show to users. The stream closes after it. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```text Event Stream theme={null} data: {"type":"start","pathway":"Front desk booking","nodes":2,"edges":1} data: {"type":"read_reference","name":"inversion-rules"} data: {"type":"read_nodes","ids":["73a855b4-7257-4c6e-bd7d-f151a763c9fa","ddc0765a-8086-4826-bfaf-77b889fb3022"]} : ping data: {"type":"iteration","iteration":1,"stopReason":"tool_use","outputTokens":1420,"toolCalls":["read_reference","read_nodes"]} : ping data: {"type":"plan_submitted","scenarios":1,"endCalls":0,"openQuestions":0} data: {"type":"materializing"} data: {"type":"iteration","iteration":2,"stopReason":"end_turn","outputTokens":4700,"toolCalls":["submit_migration_plan"]} data: {"type":"done","status":200,"data":{"plan":{"displayName":"Front desk","hubPrompt":"Greet the caller and find out what they need.\n\n## Routing\n\n- \"Book appointment\": the caller wants to schedule a visit","scenarios":[{"kind":"simple","name":"Book appointment","entry":{"mode":"llm","label":"Wants to book"},"ruleParts":[{"legacyPromptOf":"73a855b4-7257-4c6e-bd7d-f151a763c9fa"}]}],"endCalls":[],"report":{"architectureSummary":"A two-node booking pathway collapsed into one hub and one booking scenario.","dispositions":[{"nodeIds":["73a855b4-7257-4c6e-bd7d-f151a763c9fa"],"disposition":"Became scenario \"Book appointment\"","rationale":"Single dialogue step."},{"nodeIds":["ddc0765a-8086-4826-bfaf-77b889fb3022"],"disposition":"Merged into the hub prompt","rationale":"Greeting-only node."}],"droppedOrApproximated":[],"openQuestions":[]}},"snapshot":{"behavior":{"nodes":[{"id":"inbound","type":"inbound","position":{"x":360,"y":-180},"data":{"number":""}},{"id":"agent","type":"agent","position":{"x":192,"y":0},"data":{"prompt":"Greet the caller and find out what they need.\n\n## Routing\n\n- \"Book appointment\": the caller wants to schedule a visit","loopWhile":"","variables":[]}},{"id":"545fe342-06be-4151-aae2-bd10bf128464","type":"scenario","position":{"x":0,"y":260},"data":{"name":"Book appointment","rule":"Ask which day and time works for the caller, then confirm the appointment back to them.","target":{"kind":"dialogue","label":"Book appointment"},"loopWhile":"","variables":[],"entry":{"mode":"llm","label":"Wants to book","description":"","alwaysPick":false,"conditions":[]}}}],"edges":[{"id":"e-inbound-agent","source":"inbound","target":"agent"},{"id":"e-agent-book","source":"agent","target":"545fe342-06be-4151-aae2-bd10bf128464","data":{"mode":"llm","label":"Wants to book","description":"","alwaysPick":false,"conditions":[]}}]},"settings":{"displayName":"Front desk","systemPrompt":"You are the front desk assistant for a dental office.","voice":"","languages":["english"],"enableMemory":false,"interruptionSensitivity":350,"backgroundNoise":"off"},"contact":{"inboundNumbers":[]}},"lint":{"errors":[],"warnings":[]},"usage":{"inputTokens":48211,"outputTokens":6120,"iterations":2},"created":false},"errors":null} ``` ```json Invalid Pathway theme={null} { "data": null, "errors": [ { "error": "PATHWAY_TOO_LARGE", "message": "pathway exceeds 500 nodes / 2000 edges" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many pathway migrations started for this organization — please wait before starting another." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Start Pathway Translation Source: https://docs.bland.ai/api-v2/post/agents-migrate-translations POST https://api.bland.ai/v2/agents/migrate/translations Start an async job translating pathways into scenarios. ### Overview Starts a background job that converts pathways into agent scenarios, using Bland's migration planner for entries in `translate` mode and the deterministic one-to-one conversion for the rest. The body takes either the pathway-selection shape of [Migrate Pathways](/api-v2/post/agents-migrate-pathways) (stored pathways only) or the persona shape of [Migrate Persona](/api-v2/post/agents-migrate-persona); a body containing `persona_id` is treated as a persona run. The response is `202` with a run record. Poll it with [Get Pathway Translation Run](/api-v2/get/agents-migrate-translations-run-id) and stop it with [Cancel Pathway Translation Run](/api-v2/post/agents-migrate-translations-run-id-cancellations). Limited to 10 starts per hour per organization, counted together with [Migrate Pathway](/api-v2/post/agents-migrate) and [Stream Pathway Migration](/api-v2/post/agents-migrate-stream). At most 5 pathways per job may be in `translate` mode, and at most 3 jobs per organization may be active at once. Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters Send one of the two shapes below. If `persona_id` is present the persona shape is used and `pathways` is ignored. **Pathway selection** **pathways** `array` *required* One to 20 entries, each referencing a stored pathway. Returns `400 INVALID_PATHWAYS` for an empty array or a malformed entry, `400 TOO_MANY_PATHWAYS` beyond 20, `400 INLINE_PATHWAY_NOT_SUPPORTED` if any entry carries an inline `pathway` graph, and `400 TOO_MANY_TRANSLATIONS` if more than 5 entries are in `translate` mode. **entry fields** **pathway\_id** `string` *required* UUID of a pathway your organization owns. **version** `integer` Pin a specific version number (a positive integer). Defaults to the pathway's published production version, or its live graph when nothing is published. **mode** `string` (default: one\_to\_one) `translate` to have the planner re-architect the pathway into scenarios, or `one_to_one` for the deterministic conversion. Any mix is accepted within one job. **name** `string` Display name for the new agent when `create` is `true`. Whitespace is trimmed. Defaults to the pathway's name when exactly one pathway is given, otherwise `Migrated pathways`. **create** `boolean` (default: true) When `false`, the job produces scenario nodes only (returned in the run's `result.scenarios`) instead of creating an agent. **Persona** **persona\_id** `string` *required* UUID of a persona in your organization. Its attached pathways become the job's items and its prompts and settings become the agent shell, so a persona run always creates an agent. Returns `400 INVALID_PERSONA_ID` if not a UUID, `404 PERSONA_NOT_FOUND` if no such persona exists in your organization, `422 PERSONA_HAS_NO_VERSION` if it has neither a published nor a draft version, `400 NO_PATHWAY_CONDITIONS` if it has no attached pathways (use [Migrate Persona](/api-v2/post/agents-migrate-persona) instead), and `400 TOO_MANY_PATHWAYS` if it has more than 20. **name** `string` Display name for the new agent. Defaults to the persona's name. **pathway\_modes** `array` One entry per attached pathway, in the persona's order, each `one_to_one` or `translate`. The length must match the persona's pathway count or the request returns `400 INVALID_PATHWAY_MODES`. Defaults to `translate` for every pathway. More than 5 `translate` entries returns `400 TOO_MANY_TRANSLATIONS`. ### Response Returns `202` on success. Returns `429 TOO_MANY_ACTIVE_TRANSLATIONS` when 3 jobs are already active for your organization. **data.run** `object` The new run, always in `PENDING` status. **run object** **id** `string` Unique identifier for the run. Pass it as `{run_id}` when polling or cancelling. **status** `string` `PENDING` on creation. Later one of `RUNNING`, `FINALIZING`, `COMPLETE`, `FAILED`, `CANCELLED`. **total\_pathways** `integer` Number of pathways in the job. **completed\_pathways** `integer` Pathways processed so far. `0` on creation. **result** `null` Always `null` until the run reaches a terminal state. **error\_code** `string | null` `null` on creation. **error\_message** `string | null` `null` on creation. **created\_at** `string` ISO 8601 timestamp of when the run was created. **completed\_at** `null` Always `null` until the run reaches a terminal state. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "run": { "id": "eb732a2a-94a9-45ae-9def-ecbc56c4a5bf", "status": "PENDING", "total_pathways": 2, "completed_pathways": 0, "result": null, "error_code": null, "error_message": null, "created_at": "2026-09-10T20:01:12.530Z", "completed_at": null } }, "errors": null } ``` ```json Too Many Translations theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_TRANSLATIONS", "message": "at most 5 pathways can be AI-translated in one job — split the selection or switch some to 1:1" } ] } ``` ```json Too Many Active Jobs theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_ACTIVE_TRANSLATIONS", "message": "at most 3 translation jobs can run at once — wait for one to finish or cancel it" } ] } ``` ```json Rate Limited theme={null} { "data": null, "errors": [ { "error": "TOO_MANY_REQUESTS", "message": "Too many pathway migrations started for this organization — please wait before starting another." } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Cancel Pathway Translation Run Source: https://docs.bland.ai/api-v2/post/agents-migrate-translations-run-id-cancellations POST https://api.bland.ai/v2/agents/migrate/translations/{run_id}/cancellations Cancel a pending or running translation job. ### Overview Marks a job started with [Start Pathway Translation](/api-v2/post/agents-migrate-translations) as `CANCELLED` and stops its background work. Only runs in `PENDING` or `RUNNING` status can be cancelled; once a run is `FINALIZING` (creating the agent) or already terminal, the request returns `409`. No body is required. Check the outcome with [Get Pathway Translation Run](/api-v2/get/agents-migrate-translations-run-id). Requires an admin, owner, operator, or prompter role. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **run\_id** `string` *required* The run's unique identifier. Returns `400 INVALID_RUN_ID` if it is not a UUID and `404 TRANSLATION_RUN_NOT_FOUND` if no run with that ID exists in your organization. ### Response Returns `202` on success. The run's `error_code` becomes `TRANSLATION_CANCELLED` and no agent is created. **data.id** `string` The cancelled run's ID. **data.status** `string` Always `CANCELLED`. **errors** `null | array` `null` on success, or a list of error objects if the request failed. ```json Response theme={null} { "data": { "id": "7250267f-851e-4353-bf04-b9c8fa67be31", "status": "CANCELLED" }, "errors": null } ``` ```json Finalizing theme={null} { "data": null, "errors": [ { "error": "TRANSLATION_RUN_FINALIZING", "message": "the run is already finishing — it can no longer be cancelled" } ] } ``` ```json Already Finished theme={null} { "data": null, "errors": [ { "error": "TRANSLATION_RUN_TERMINAL", "message": "the run already finished (COMPLETE)" } ] } ``` ```json Not Found theme={null} { "data": null, "errors": [ { "error": "TRANSLATION_RUN_NOT_FOUND", "message": "no translation run with that id" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Speech (OpenAI-compatible) Source: https://docs.bland.ai/api-v2/post/audio-speech POST https://api.bland.ai/v2/audio/speech Use Bland voices through the OpenAI text-to-speech request and error shapes. ## Overview This endpoint implements OpenAI's `/audio/speech` contract. If you already use an OpenAI SDK or a compatible router such as LiteLLM, change the base URL, API key, and model to route speech through Bland. ```python theme={null} import os from pathlib import Path from openai import OpenAI client = OpenAI( api_key=os.environ["BLAND_API_KEY"], base_url="https://api.bland.ai/v2", ) with client.audio.speech.with_streaming_response.create( model="btts-3", voice="coral", input="Hello from Bland.", ) as response: response.stream_to_file(Path("hello.mp3")) ``` For LLM tokens, interruptions, and the lowest conversational latency, use [Realtime Speech (WebSocket)](/api-v2/post/tts-ws). For a complete input string with Bland-specific audio controls, use [Synthesize Speech (HTTP)](/api-v2/post/tts). ## Headers **authorization** `string` *required* `Bearer `. OpenAI SDKs send this from their `api_key` or `apiKey` configuration. ## Body parameters **model** `string` *required* `btts-3` or `btts-2`. OpenAI model IDs such as `tts-1` and `gpt-4o-mini-tts` are not aliased. Unknown IDs return `400` with code `model_not_found`. The model must match the selected Bland voice. A mismatch returns `400` with code `model_voice_mismatch`. **input** `string` *required* Non-empty text to speak. Maximum 4,096 characters. **voice** `string` *required* A recognized OpenAI voice name, mapped to a Bland core voice, or a Bland voice UUID for the full catalog. | OpenAI name | Bland voice | | - | - | | `alloy`, `ash`, `coral`, `fable` | River | | `amber`, `august`, `lily`, `nova`, `shimmer` | Karen | | `ballad`, `blue`, `echo`, `onyx`, `sage`, `verse` | Matthew | Names are case-insensitive. An unrecognized name returns `400`. **response\_format** `string` (default: mp3) `mp3`, `opus`, `aac`, `flac`, `wav`, or `pcm`. `pcm` is raw 24 kHz signed 16-bit little-endian mono audio. The other formats use a 48 kHz render and include their normal file or stream framing. **speed** `number` (default: 1.0) Only `1.0` is accepted. Other values return `400` because Bland does not currently expose speed control on this endpoint. **stream\_format** `string` (default: audio) Only `audio` is supported. `sse` returns `400`. **instructions** `string` Accepted and ignored. This OpenAI field has no Bland equivalent. ## Response The response body contains audio bytes. `Content-Type` matches the requested format: | `response_format` | `Content-Type` | | - | - | | `mp3` | `audio/mpeg` | | `opus` | `audio/ogg` | | `aac` | `audio/aac` | | `flac` | `audio/flac` | | `wav` | `audio/wav` | | `pcm` | `audio/pcm` | MP3, Opus, AAC, FLAC, and raw PCM can begin streaming before synthesis completes. WAV is buffered until its final RIFF header length is known. **x-request-id** `string` Unique request ID. Include it in support requests. ## Errors Errors use OpenAI's envelope so SDK error handling remains readable: ```json theme={null} { "error": { "message": "The model 'tts-1' does not exist. Supported models: btts-3, btts-2.", "type": "invalid_request_error", "param": "model", "code": "model_not_found" } } ``` | Condition | HTTP | Code | | - | - | - | | Missing or malformed field | 400 | `null` | | Unknown model | 400 | `model_not_found` | | Model does not match the selected voice | 400 | `model_voice_mismatch` | | Unsupported voice type | 400 | `null` | | Out of credits | 402 | `insufficient_quota` | | Professional voice is still a draft | 403 | `voice_not_live` | | Voice UUID is not found or accessible | 404 | `voice_not_found` | | Synthesis fails before audio begins | 500 | `synthesis_failed` | ## Examples ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v2/audio/speech" \ -H "Authorization: Bearer $BLAND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "btts-3", "input": "Hello from Bland.", "voice": "coral", "response_format": "mp3" }' \ --output hello.mp3 ``` ```python OpenAI SDK theme={null} import os from pathlib import Path from openai import OpenAI client = OpenAI( api_key=os.environ["BLAND_API_KEY"], base_url="https://api.bland.ai/v2", ) with client.audio.speech.with_streaming_response.create( model="btts-3", voice="coral", input="Hello from Bland.", ) as response: response.stream_to_file(Path("hello.mp3")) ``` ```python LiteLLM theme={null} import os import litellm litellm.speech( model="openai/btts-3", voice="coral", input="Hello from Bland.", api_base="https://api.bland.ai/v2", api_key=os.environ["BLAND_API_KEY"], ) ``` ```js Node.js theme={null} import fs from "node:fs/promises"; import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.BLAND_API_KEY, baseURL: "https://api.bland.ai/v2", }); const response = await client.audio.speech.create({ model: "btts-3", voice: "coral", input: "Hello from Bland.", }); await fs.writeFile("hello.mp3", Buffer.from(await response.arrayBuffer())); ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Batch Source: https://docs.bland.ai/api-v2/post/batches POST https://api.bland.ai/v2/batches/create Create a new batch of calls using direct input. ### Headers **authorization** `string` *required* Your API key for authentication. **encrypted\_key** `string` Optional encrypted key used for securing batch payloads. Learn more about BYOT [here](/tutorials/custom-twilio). ### Body **call\_objects** `array` A list of individual call objects to include in the batch. Each object follows the same schema as `/v1/calls`. ```json Example theme={null} "call_objects": [ { "phone_number": "+1234567890", "task": "Say hello to the nice person!", "start_time": "2026-01-01 12:00:00-05:00", // Provide a UUID v7 Compliant ID for this Call ahead of time. // Requires entitlements to use. Contact your Account Executive for more information. "b_cid": "" // Remainder of /v1/call properties ... }, { "phone_number": "+1234567891", "task": "Say hello to the bad person!", "record": false, "start_time": "2026-01-01 1:00:00-05:00" //timezone is optional, defaults to UTC // /v1/call properties } ] ``` **global** `object` *required* Global call properties to apply to all `call_objects`, unless overridden per entry. \ \ **Required keys:** * Must include at least one of: `"task"` or `"pathway_id"`. \ \ **Forbidden keys:** * `"phone_number"` is **not allowed** in the global object. Example: ```json Example theme={null} "global": { "task": "Say hello to the nice person!", "record": true, "start_time": "2026-01-01 12:00:00-05:00" //timezone is optional, defaults to UTC // /v1/call properties } ``` **description** `string` A short label for the batch shown in the dashboard. Maximum 60 characters. Defaults to `"Untitled Batch"` if not provided. **status\_webhook** `string` Optional URL to receive batch status updates. We send a single POST per lifecycle phase and one final POST when the batch completes or fails. Payload is JSON with `batch_id`, `status`, and `timestamp`; final events include `calls_total` / `calls_successful` / `calls_failed` or `code` and `reason` on failure. Your endpoint should respond with 200 within a few seconds; we wait up to 10 seconds per call. See [Status webhook](#status-webhook) below for payload details. ### Response **data** `object` The response includes the `batch_id` of the newly created batch. **data.batch\_id** `string` The unique identifier for the batch. **errors** `null` Always `null` on success. ```json Response theme={null} { "data": { "batch_id": "8b8e8c57-9e6e-4e4d-84d2-9826b2268c22" }, "errors": null } ``` ### Status webhook If you provide **`status_webhook`**, we POST to that URL at each lifecycle phase and once when the batch finishes. All requests use `Content-Type: application/json`. **Status values:** `validating` | `dispatching` | `in_progress` | `in_progress_chunked` | `waiting_for_scheduled_calls` | `completed` | `failed` | `completed_partial` **Common fields on every request:** `batch_id` (string), `status` (string), `timestamp` (ISO 8601). Progress events may include `message` (string). Final events include call counts or error details as below. **Progress examples:** ```json Validating theme={null} { "batch_id": "42eb41ed-1842-40c3-b2e6-47d690c179ad", "status": "validating", "timestamp": "2026-02-20T15:00:05.123Z" } ``` ```json In progress (with message) theme={null} { "batch_id": "42eb41ed-1842-40c3-b2e6-47d690c179ad", "status": "in_progress", "message": "Requested: 100. Validated: 100. Dispatched: 100. CPS: 12.50.", "timestamp": "2026-02-20T15:00:18.789Z" } ``` **Final events:** ```json Completed theme={null} { "batch_id": "42eb41ed-1842-40c3-b2e6-47d690c179ad", "status": "completed", "calls_total": 100, "calls_successful": 98, "calls_failed": 2, "timestamp": "2026-02-20T15:30:00.000Z" } ``` ```json Failed theme={null} { "batch_id": "42eb41ed-1842-40c3-b2e6-47d690c179ad", "status": "failed", "code": "source_invalid", "reason": "Entry #7 did not have a phone number.", "timestamp": "2026-02-20T15:00:10.000Z" } ``` ```json Completed partial (e.g. timeout) theme={null} { "batch_id": "42eb41ed-1842-40c3-b2e6-47d690c179ad", "status": "completed_partial", "code": "batch_early_exit", "reason": "Condition not met within 86400 seconds", "calls_total": 50, "calls_successful": 45, "calls_failed": 5, "timestamp": "2026-02-21T15:00:00.000Z" } ``` We send one attempt per event with a 10-second timeout. If the request fails or times out, we log and continue; the workflow is not retried or failed. Respond with 2xx quickly and perform any heavy work asynchronously. *** Docs for agents: [llms.txt](/llms.txt) # Stop Batch Source: https://docs.bland.ai/api-v2/post/batches-id-stop POST https://api.bland.ai/v2/batches/{batch_id}/stop Stop a batch that is currently running or scheduled. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **batch\_id** `string` *required* The unique identifier of the batch to stop. ### Response **data** `null` Always `null` on success. **errors** `null` `null` if the batch was successfully stopped. ```json Response theme={null} { "data": null, "errors": null } ``` *** Docs for agents: [llms.txt](/llms.txt) # Create Tool Source: https://docs.bland.ai/api-v2/post/tools POST https://api.bland.ai/v2/tools Create a new tool. Tools connect to built-in integrations (e.g. Slack, OpenAPI) and are invoked automatically by your agent during calls and SMS conversations. ### Headers **authorization** `string` *required* Your API key for authentication. ### Body Parameters **name** `string` *required* The name the AI will see when deciding to use this tool. Must be at least 1 character. Avoid names that conflict with reserved internal tools: `input`, `speak`, `transfer`, `switch`, `wait`, `finish`, `press`, `button`, `say`, `pause`, `record`, `play`, `dial`, `hang`. **description** `string` *required* Description of what the tool does. Shown to the AI to help it decide when to use this tool. **integration** `string` *required* The integration key to use. Must be one of: `bland-sms`, `custom-code`, `slack`, `salesforce`, `rest_api`, `hubspot`, `calendly`, `cal-com-v2`, `notion`. **action** `string` *required* The action key to invoke within the integration. To discover available action keys, call `GET /v1/integrations/{integration}/actions`. Returns `400 ACTION_NOT_FOUND` with the list of valid actions if the key is invalid. **input\_schema** `object` Must be a valid OpenAI function calling parameter schema. Defines the parameters the AI will fill in when invoking this tool. ```json theme={null} { "type": "object", "properties": { "channel": { "type": "string" }, "message": { "type": "string" } }, "required": ["channel", "message"] } ``` **body** `string | object` Request body template sent to the integration. Supports prompt variables from `input_schema` (e.g. `"{{input.channel}}"`). **speech** `string` Text the AI says aloud while executing this tool (e.g. `"One moment while I send that message."`). **timeout** `number` Maximum time in milliseconds to wait for the integration to respond. Minimum `1000`, maximum `60000`. **cache** `boolean` Whether to cache the tool's response. Accepts `true`, `false`, `"true"`, or `"false"`. **response\_data** `array` Defines which fields to extract from the integration response and make available as prompt variables. **response\_data item** **name** `string` *required* Variable name to assign the extracted value. **data** `string` *required* JSON path to the value in the response (e.g. `"$.message_id"`). **context** `string` Optional description of what this data represents. **max\_retries** `number` Number of times to retry the tool on failure. Minimum `0`, maximum `4`. **cooldown** `number` Seconds to wait between retries. Minimum `1`, maximum `30`. **resource\_id** `string` UUID of a connected resource (e.g. a Slack workspace or Salesforce org) to scope this tool to. The resource must be active and belong to your account. Returns `404` if the ID is invalid or inactive. To list available resource IDs for an integration, call `GET /v1/integrations/{integration}/resources`. **public** `boolean` Whether this tool is publicly visible. Defaults to `false`. **label** `string` Optional human-readable label for this tool. ### Response **status** `string` `"success"` on success, `"error"` on failure. **data.id** `string` The ID of the newly created tool. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Request theme={null} { "name": "SendSlackMessage", "description": "Sends a message to a Slack channel", "integration": "slack", "action": "send_message", "input_schema": { "type": "object", "properties": { "channel": { "type": "string" }, "message": { "type": "string" } }, "required": ["channel", "message"] }, "speech": "Sending that message to Slack now.", "timeout": 10000 } ``` ```json Response (Success) theme={null} { "status": "success", "data": { "id": "abc123def456" }, "errors": null } ``` ```json Error (INVALID_PARAMETER) theme={null} { "data": null, "errors": [ { "code": "INVALID_PARAMETER", "message": "name is required" } ] } ``` ```json Error (INVALID_TOOL_TYPE) theme={null} { "data": null, "errors": [ { "code": "INVALID_TOOL_TYPE", "message": "The specified tool type is not supported" } ] } ``` ```json Error (INTEGRATION_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "INTEGRATION_NOT_FOUND", "message": "Integration 'my_integration' is not available. Available integrations: bland-sms, custom-code, slack, salesforce, rest_api, hubspot, calendly, cal-com-v2, notion" } ] } ``` ```json Error (ACTION_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "ACTION_NOT_FOUND", "message": "Action 'my_action' not found for integration 'slack'. Available actions: send_message, create_channel" } ] } ``` ```json Error (RESOURCE_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "RESOURCE_NOT_FOUND", "message": "Resource not found or is inactive" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Update Tool Source: https://docs.bland.ai/api-v2/post/tools-tool-id POST https://api.bland.ai/v2/tools/{tool_id} Update an existing tool. All fields are optional. Only the fields you provide will be updated. ### Headers **authorization** `string` *required* Your API key for authentication. ### Path Parameters **tool\_id** `string` *required* The unique identifier of the tool to update. ### Body Parameters All fields are optional. Only fields included in the request body will be updated. **name** `string` The name the AI will see when deciding to use this tool. **description** `string` Description of what the tool does. **integration** `string` The integration key to update. Must be one of: `bland-sms`, `custom-code`, `slack`, `salesforce`, `rest_api`, `hubspot`, `calendly`, `cal-com-v2`, `notion`. **action** `string` The action key to invoke within the integration. To discover available action keys, call `GET /v1/integrations/{integration}/actions`. Returns `400 ACTION_NOT_FOUND` with the list of valid actions if the key is invalid. **input\_schema** `object` Must be a valid OpenAI function calling parameter schema. Defines the parameters the AI will fill in when invoking this tool. **body** `string | object` Request body template sent to the integration. **speech** `string` Text the AI says aloud while executing this tool. **timeout** `number` Maximum time in milliseconds to wait for the integration. Minimum `1000`, maximum `60000`. **cache** `boolean` Whether to cache the tool's response. **response\_data** `array` Defines which fields to extract from the integration response. **response\_data item** **name** `string` *required* Variable name to assign the extracted value. **data** `string` *required* JSON path to the value in the response. **context** `string` Optional description of what this data represents. **max\_retries** `number` Number of times to retry the tool on failure. Minimum `0`, maximum `4`. **cooldown** `number` Seconds to wait between retries. Minimum `1`, maximum `30`. **resource\_id** `string` UUID of a connected resource (e.g. a Slack workspace or Salesforce org) to scope this tool to. The resource must be active and belong to your account. Returns `404` if the ID is invalid or inactive. To list available resource IDs for an integration, call `GET /v1/integrations/{integration}/resources`. **public** `boolean` Whether this tool is publicly visible. **label** `string` Human-readable label for this tool. ### Response **status** `string` `"success"` on success, `"error"` on failure. **data.id** `string` The ID of the updated tool. **errors** `null|array` `null` on success, or a list of error objects if the request failed. ```json Request (Partial Update) theme={null} { "description": "Sends an urgent message to a Slack channel", "timeout": 15000 } ``` ```json Response (Success) theme={null} { "status": "success", "data": { "id": "abc123def456" }, "errors": null } ``` ```json Error (TOOL_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "TOOL_NOT_FOUND", "message": "Tool not found" } ] } ``` ```json Error (INVALID_PARAMETER) theme={null} { "data": null, "errors": [ { "code": "INVALID_PARAMETER", "message": "timeout must be between 1000 and 60000" } ] } ``` ```json Error (TOOL_V2_UPDATE_VALIDATION_ERROR) theme={null} { "data": null, "errors": [ { "code": "TOOL_V2_UPDATE_VALIDATION_ERROR", "message": "Validation failed for the provided tool configuration" } ] } ``` ```json Error (INVALID_TOOL_TYPE) theme={null} { "data": null, "errors": [ { "code": "INVALID_TOOL_TYPE", "message": "The specified tool type is not supported" } ] } ``` ```json Error (INTEGRATION_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "INTEGRATION_NOT_FOUND", "message": "Integration 'my_integration' is not available. Available integrations: bland-sms, custom-code, slack, salesforce, rest_api, hubspot, calendly, cal-com-v2, notion" } ] } ``` ```json Error (ACTION_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "ACTION_NOT_FOUND", "message": "Action 'my_action' not found for integration 'slack'" } ] } ``` ```json Error (RESOURCE_NOT_FOUND) theme={null} { "data": null, "errors": [ { "code": "RESOURCE_NOT_FOUND", "message": "Resource not found or is inactive" } ] } ``` *** Docs for agents: [llms.txt](/llms.txt) # Synthesize Speech (HTTP) Source: https://docs.bland.ai/api-v2/post/tts POST https://api.bland.ai/v2/tts Generate speech from a complete input string over HTTP. ## Overview Use this endpoint when the complete text is available before synthesis begins. It returns a streaming raw response or a complete WAV file in one HTTP request. For LLM tokens, multiple conversational turns, and interruption support, use [Realtime Speech (WebSocket)](/api-v2/post/tts-ws). It is the primary endpoint for realtime TTS. `text` and `voice` are the only required fields. You get 48 kHz PCM frames by default, ready to play or forward to a client. Set `audio.container` to `wav` for a file you can download and open. > [!NOTE] > > Use a **`BTTS_V3`** voice. `expressiveness` and `stability` are calibrated for > it, and 48 kHz is the rate it renders natively. `BTTS_V2` voices synthesize, but the > controls are not tuned for them. Read `x-model` to see which model a voice resolved to. > [!WARNING] > > **Coming from `/v1/speak`?** `container: "raw"` returns bare audio frames. The v1 > endpoints wrapped `pcm_` in a WAV header, so v1 clients usually skip 44 bytes > before playback. Doing that here removes 44 bytes of real audio. Drop the header > handling, or ask for `container: "wav"`. ## Pricing Text-to-speech is currently billed at **\$0.015 per 1,000 characters**, the same rate on every plan. This is a limited-time launch offer, discounted from the standard \$0.04 per 1,000 characters. Each request carries a minimum charge of \$0.001, so very short generations bill at the minimum rather than the per-character rate. Some public-library voices carry an additional per-character creator fee. For a completed response, the charge comes back in the `x-cost` header. An interrupted raw stream can bill less because delivery accounting happens after that header is sent. Billing follows delivery. A synthesis that fails before any bytes are written is not charged, and a fully delivered request is charged for the whole `text`. If a raw response is interrupted mid-stream, billing estimates the delivered characters at synthesized-chunk granularity. Individual audio bytes cannot be mapped to exact source characters. *** ## Headers **authorization** `string` *required* Your API key. *** ## Body Parameters **text** `string` *required* The text to speak. Maximum 5,000 characters. Insert a pause with `<|N|>`, where N is a positive number of seconds: `"Welcome to Bland. <|0.8|> How can I help?"` **voice** `string` *required* Voice UUID. Names are not accepted. Get a UUID from [List Voices](/api-v1/get/voices). **audio** `object` Output format. All fields optional. **audio fields** **encoding** `string` (default: pcm\_s16le) Audio codec. * `pcm_s16le`: 16-bit signed little-endian PCM. * `mulaw`: 8-bit mu-law, 8 kHz only. For telephony. **sample\_rate** `number` (default: 48000) Output sample rate in Hz: `8000`, `16000`, `24000`, `44100`, or `48000`. 48 kHz is what `BTTS_V3` renders natively, so it is the fastest path. With `mulaw`, the rate is fixed at `8000` and any other value returns a `400`. **container** `string` (default: raw) How the bytes are framed. * `raw`: bare audio frames. For streaming and voice agents. * `wav`: one RIFF/WAVE file with a correct-length header. The full render is buffered before the first byte goes out, since a valid header needs the final size. For downloads. Trying the endpoint by hand? Use `wav`. `raw` returns bare samples that most players cannot open. **controls** `object` How the voice performs. Both are optional and range from `0.0` to `1.0`. **controls fields** **expressiveness** `number` Higher is more varied intonation; lower is flatter and more monotone. **stability** `number` Higher is more consistent between renders; lower is more creative and varied. *** ## Response Audio in the encoding and container you asked for. * `raw` + `pcm_s16le` → `Content-Type: audio/pcm` * `raw` + `mulaw` → `Content-Type: audio/basic` * `wav` (any encoding) → `Content-Type: audio/wav` These headers arrive with the first byte. **x-request-id** `string` Unique ID for this request. Include it in support tickets. **x-model** `string` The model that produced the audio, for example `btts-3`. Set by the voice you chose. **x-voice-id** `string` The voice UUID used. **x-sample-rate** `string` Output sample rate in Hz. **x-cost** `string` Full-response cost in USD. It matches the final charge when the response completes; an interrupted raw stream may have a lower delivery-based charge. **x-latency** `string` Milliseconds to the first audio byte. For `wav`, the full render time. ### Errors Every error returns the same shape, with a stable machine-readable code: ```json theme={null} { "error": { "code": "voice_not_found", "message": "Voice … was not found or is not accessible." } } ``` | Code | HTTP | Meaning | | - | - | - | | `invalid_request` | 400 | A required field is missing or has the wrong shape. | | `text_too_long` | 400 | `text` exceeds 5,000 characters. | | `unsupported_encoding` | 400 | `audio.encoding` is not an allowed value. | | `unsupported_sample_rate` | 400 | `audio.sample_rate` is not allowed for the encoding. | | `unsupported_container` | 400 | `audio.container` is not `raw` or `wav`. | | `unsupported_voice` | 400 | The voice exists but is not a `BTTS_V2` or `BTTS_V3` voice. | | `insufficient_credits` | 402 | The account is out of credits. | | `voice_not_live` | 403 | The professional voice is still a draft. Promote it to live first. | | `voice_not_found` | 404 | The voice UUID does not exist, or you cannot access it. | | `concurrency_limit_reached` | 429 | Your organization is at its [concurrent generation limit](/speech/limits). Wait the number of seconds in `Retry-After`, then retry. | | `synthesis_failed` | 500 | Synthesis failed before or during streaming. | *** ## Examples ### Downloadable WAV file ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v2/tts" \ -H "Authorization: Bearer $BLAND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Hello world.", "voice": "29158307-9893-4149-8a75-bc9ce313d64e", "audio": { "encoding": "pcm_s16le", "sample_rate": 24000, "container": "wav" }, "controls": { "expressiveness": 0.7, "stability": 0.5 } }' \ --output hello.wav ``` ### Default (48 kHz PCM, raw) ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v2/tts" \ -H "Authorization: Bearer $BLAND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Welcome to Bland.", "voice": "29158307-9893-4149-8a75-bc9ce313d64e" }' \ --output out.pcm ``` ### Telephony (μ-law, 8 kHz) ```bash cURL theme={null} curl -X POST "https://api.bland.ai/v2/tts" \ -H "Authorization: Bearer $BLAND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Your appointment is confirmed for Tuesday at 3 PM.", "voice": "29158307-9893-4149-8a75-bc9ce313d64e", "audio": { "encoding": "mulaw", "sample_rate": 8000 } }' \ --output prompt.ulaw ``` ```http Response headers theme={null} HTTP/2 200 content-type: audio/pcm x-request-id: 5f9c…-…-… x-model: btts-3 x-voice-id: 29158307-9893-4149-8a75-bc9ce313d64e x-sample-rate: 48000 x-cost: 0.001000 x-latency: 312