> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build overview

> Create and manage the pieces an agent is built from: playbooks, functions, tools, API tools, MCP servers, variables and knowledge base documents.

An agent is assembled from parts: a playbook and the tools it can call, a
function with its branches and variables, an API tool, an MCP server, the
project's variables, and the documents its knowledge base retrieves from.

All of them can be created and changed from outside the Studio, which is what
makes generating agents from a template, importing them from another system, or
keeping a set of projects consistent with each other possible.

## Endpoints

### Agent

| Endpoint | Description |
| - | - |
| GET [Get agent](https://www.voiceflow.com/docs/api-reference/agent/get-agent.md) | Get agent configuration. |
| PATCH [Update agent](https://www.voiceflow.com/docs/api-reference/agent/update-agent.md) | Update agent configuration. |

### Playbook

| Endpoint | Description |
| - | - |
| GET [List playbooks](https://www.voiceflow.com/docs/api-reference/playbook/list-playbooks.md) | List all playbooks by project ID. |
| POST [Create playbook](https://www.voiceflow.com/docs/api-reference/playbook/create-playbook.md) | Create a new playbook. |
| POST [Create many playbooks](https://www.voiceflow.com/docs/api-reference/playbook/create-many-playbooks.md) | Create multiple new playbooks. |
| GET [Get playbook](https://www.voiceflow.com/docs/api-reference/playbook/get-playbook.md) | Get a playbook by ID. |
| PATCH [Update playbook](https://www.voiceflow.com/docs/api-reference/playbook/update-playbook.md) | Update a playbook by ID. |
| DELETE [Delete playbook](https://www.voiceflow.com/docs/api-reference/playbook/delete-playbook.md) | Delete a playbook by ID. |

### Function

| Endpoint | Description |
| - | - |
| GET [List functions](https://www.voiceflow.com/docs/api-reference/function/list-functions.md) | List all functions by project ID. |
| POST [Create function](https://www.voiceflow.com/docs/api-reference/function/create-function.md) | Create a new function. |
| POST [Create many functions](https://www.voiceflow.com/docs/api-reference/function/create-many-functions.md) | Create multiple new functions. |
| GET [Get function](https://www.voiceflow.com/docs/api-reference/function/get-function.md) | Get a function by ID. |
| PATCH [Update function](https://www.voiceflow.com/docs/api-reference/function/update-function.md) | Update a function by ID. |
| DELETE [Delete function](https://www.voiceflow.com/docs/api-reference/function/delete-function.md) | Delete a function by ID. |

### Function path

| Endpoint | Description |
| - | - |
| GET [List paths](https://www.voiceflow.com/docs/api-reference/function-path/list-paths.md) | List all paths by function ID. |
| POST [Create path](https://www.voiceflow.com/docs/api-reference/function-path/create-path.md) | Create a new path. |
| POST [Create many paths](https://www.voiceflow.com/docs/api-reference/function-path/create-many-paths.md) | Create multiple new paths. |
| GET [Get path](https://www.voiceflow.com/docs/api-reference/function-path/get-path.md) | Get a path by ID. |
| PATCH [Update path](https://www.voiceflow.com/docs/api-reference/function-path/update-path.md) | Update a path by ID. |
| DELETE [Delete path](https://www.voiceflow.com/docs/api-reference/function-path/delete-path.md) | Delete a path by ID. |

### Function variable

| Endpoint | Description |
| - | - |
| GET [List variables](https://www.voiceflow.com/docs/api-reference/function-variable/list-variables.md) | List all variables by function ID. |
| POST [Create variable](https://www.voiceflow.com/docs/api-reference/function-variable/create-variable.md) | Create a new variable. |
| POST [Create many variables](https://www.voiceflow.com/docs/api-reference/function-variable/create-many-variables.md) | Create multiple new variables. |
| GET [Get variable](https://www.voiceflow.com/docs/api-reference/function-variable/get-variable.md) | Get a variable by ID. |
| PATCH [Update variable](https://www.voiceflow.com/docs/api-reference/function-variable/update-variable.md) | Update a variable by ID. |
| DELETE [Delete variable](https://www.voiceflow.com/docs/api-reference/function-variable/delete-variable.md) | Delete a variable by ID. |

### Tool

| Endpoint | Description |
| - | - |
| GET [List tools](https://www.voiceflow.com/docs/api-reference/tool/list-tools.md) | List all tools for the agent or a specific playbook. |
| POST [Create tool](https://www.voiceflow.com/docs/api-reference/tool/create-tool.md) | Create a new tool. |
| POST [Create many tools](https://www.voiceflow.com/docs/api-reference/tool/create-many-tools.md) | Create multiple new tools. |
| GET [Get tool](https://www.voiceflow.com/docs/api-reference/tool/get-tool.md) | Get a tool by ID. |
| PATCH [Update tool](https://www.voiceflow.com/docs/api-reference/tool/update-tool.md) | Update a tool by ID. |
| DELETE [Delete tool](https://www.voiceflow.com/docs/api-reference/tool/delete-tool.md) | Delete a tool by ID. |

### API tool

| Endpoint | Description |
| - | - |
| GET [List API tools](https://www.voiceflow.com/docs/api-reference/api-tool/list-api-tools.md) | List all API tools by project ID. |
| POST [Create API tool](https://www.voiceflow.com/docs/api-reference/api-tool/create-api-tool.md) | Create a new API tool. |
| POST [Create many API tools](https://www.voiceflow.com/docs/api-reference/api-tool/create-many-api-tools.md) | Create multiple new API tools. |
| GET [Get API tool](https://www.voiceflow.com/docs/api-reference/api-tool/get-api-tool.md) | Get an API tool by ID. |
| PATCH [Update API tool](https://www.voiceflow.com/docs/api-reference/api-tool/update-api-tool.md) | Update an API tool by ID. |
| DELETE [Delete API tool](https://www.voiceflow.com/docs/api-reference/api-tool/delete-api-tool.md) | Delete an API tool by ID. |

### API tool variable

| Endpoint | Description |
| - | - |
| GET [List variables](https://www.voiceflow.com/docs/api-reference/api-tool-variable/list-variables.md) | List all variables by API tool ID. |
| POST [Create variable](https://www.voiceflow.com/docs/api-reference/api-tool-variable/create-variable.md) | Create a new variable. |
| POST [Create many variables](https://www.voiceflow.com/docs/api-reference/api-tool-variable/create-many-variables.md) | Create multiple new variables. |
| GET [Get variable](https://www.voiceflow.com/docs/api-reference/api-tool-variable/get-variable.md) | Get an variable by ID. |
| PATCH [Update variable](https://www.voiceflow.com/docs/api-reference/api-tool-variable/update-variable.md) | Update an variable by ID. |
| DELETE [Delete variable](https://www.voiceflow.com/docs/api-reference/api-tool-variable/delete-variable.md) | Delete an variable by ID. |

### Variable

| Endpoint | Description |
| - | - |
| GET [List variables](https://www.voiceflow.com/docs/api-reference/variable/list-variables.md) | List all variables by project ID. |
| POST [Create variable](https://www.voiceflow.com/docs/api-reference/variable/create-variable.md) | Create a new variable. |
| POST [Create many variables](https://www.voiceflow.com/docs/api-reference/variable/create-many-variables.md) | Create multiple new variables. |
| GET [Get variable](https://www.voiceflow.com/docs/api-reference/variable/get-variable.md) | Get a variable by ID. |
| PATCH [Update variable](https://www.voiceflow.com/docs/api-reference/variable/update-variable.md) | Update a variable by ID. |
| DELETE [Delete variable](https://www.voiceflow.com/docs/api-reference/variable/delete-variable.md) | Delete a variable by ID. |

### MCP server

| Endpoint | Description |
| - | - |
| GET [List MCP servers](https://www.voiceflow.com/docs/api-reference/mcp-server/list-mcp-servers.md) | List all MCP servers by project ID. |
| POST [Create MCP server](https://www.voiceflow.com/docs/api-reference/mcp-server/create-mcp-server.md) | Create a new MCP server. |
| GET [Get MCP server](https://www.voiceflow.com/docs/api-reference/mcp-server/get-mcp-server.md) | Get an MCP server by ID. |
| PATCH [Update MCP server](https://www.voiceflow.com/docs/api-reference/mcp-server/update-mcp-server.md) | Update an MCP server by ID. |
| DELETE [Delete MCP server](https://www.voiceflow.com/docs/api-reference/mcp-server/delete-mcp-server.md) | Delete an MCP server by ID. |
| PUT [Sync MCP server](https://www.voiceflow.com/docs/api-reference/mcp-server/sync-mcp-server.md) | Sync tool changes for an MCP server by ID. |

### MCP tool

| Endpoint | Description |
| - | - |
| GET [List MCP tools](https://www.voiceflow.com/docs/api-reference/mcp-tool/list-mcp-tools.md) | List all MCP tools by project ID. |
| GET [Get MCP tool](https://www.voiceflow.com/docs/api-reference/mcp-tool/get-mcp-tool.md) | Get an MCP tool by ID. |

### Knowledge base document

| Endpoint | Description |
| - | - |
| GET [List documents](https://www.voiceflow.com/docs/api-reference/document/list-documents.md) | List all documents by project ID. |
| POST [Create URL document](https://www.voiceflow.com/docs/api-reference/document/create-url-document.md) | Create a new document from a URL. |
| POST [Create text document](https://www.voiceflow.com/docs/api-reference/document/create-text-document.md) | Create a new document from raw text. |
| POST [Create table document](https://www.voiceflow.com/docs/api-reference/document/create-table-document.md) | Create a new document from structured data. |
| GET [Get document](https://www.voiceflow.com/docs/api-reference/document/get-document.md) | Get a document by ID. |
| PATCH [Update document](https://www.voiceflow.com/docs/api-reference/document/update-document.md) | Update a document by ID. |
| DELETE [Delete document](https://www.voiceflow.com/docs/api-reference/document/delete-document.md) | Delete a document by ID. |

## How the build endpoints are shaped

Every resource follows the same six-verb pattern, so learning one teaches the
rest:

| Verb | Path | Purpose |
| - | - | - |
| `GET` | `/{resource}` | list everything in the project |
| `POST` | `/{resource}` | create one |
| `POST` | `/{resource}/batch` | create many in a single call |
| `GET` | `/{resource}/{id}` | fetch one |
| `PATCH` | `/{resource}/{id}` | change part of one |
| `DELETE` | `/{resource}/{id}` | remove one |

The `batch` variant matters when you are importing. Creating fifty variables
one call at a time is fifty round trips and fifty chances to end up half
migrated; one batch call is atomic from your side.

## Scoping every call

Build endpoints act inside one environment of one project, so both are
required query parameters:

```bash theme={null}
curl "https://realtime-api.voiceflow.com/v1/stable/function?projectID=$VF_PROJECT_ID&environmentAlias=main" \
  -H "Authorization: Bearer $VF_PAT"
```

Editing `main` changes what your team sees in the Creator. To stage changes
without touching it, clone an environment first, build against the clone, and
[merge](https://www.voiceflow.com/docs/api-reference/environment/merge-environments.md) when you are satisfied.

## How the pieces relate

* A **playbook** is the unit of agent behaviour. It holds instructions and the
  tools it may call.
* **Tools** are what a playbook can do. An **API tool** calls an HTTP endpoint;
  a **function** runs your own code; an **MCP server** contributes a set of
  **MCP tools** discovered from that server.
* **Function paths** are the branches a function can exit through, and
  **function variables** are its inputs and outputs. Both belong to a function
  and are managed separately, so you can add a branch without rewriting the
  function.
* **Variables** are project state that persists across a conversation.
* **Knowledge base documents** are the corpus the agent retrieves from. Create
  them from a URL, from text, or by uploading a table.

## Where to go next

Once an agent is built, [publish it](https://www.voiceflow.com/docs/api-reference/sections/publishing.md) to make
the changes live, and [run a conversation](https://www.voiceflow.com/docs/api-reference/sections/running-agents.md) against
it to see how it behaves.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.