# CometChat Docs: AI Agents APIs

> Technical documentation & Implementation guides to add In-app Messaging & Voice & Video Calling to your apps and websites in minutes.

## APIs

### BYO Agent APIs

- [BYO Agent APIs](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/overview.md): Create and manage BYO Agent APIs in CometChat for external AI agents, custom tools, actions, and framework integrations.
- [Setup & Authentication](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/setup-and-authentication.md): Navigate to Setup & Authentication documentation.
- [Users & Groups](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/users-and-groups.md): Navigate to Users & Groups documentation.

#### BYO Agents

- [Create BYO Agent](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/agents/create-byo-agent.md): Creates a new BYO Agent that delegates conversations to an external AI Agent. Use this endpoint to register a BYO (Bring Your Own) agent powered by frameworks like Mastra, CrewAI, or LangGraph.  **Val
- [List BYO Agents](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/agents/list-byo-agents.md): Retrieves all BYO Agents configured for your CometChat app. Use this endpoint to view all registered BYO (Bring Your Own) agents and their current configuration.
- [Update BYO Agent](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/agents/update-byo-agent.md): Updates an existing BYO Agent by its UID. Use this endpoint to modify agent configuration, update referenced tools, or change the connected AI framework.  **Validation:** Referenced tools and actions
- [Delete BYO Agent](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/agents/delete-byo-agent.md): Deletes a BYO Agent by its UID.

#### Tools

- [List Tools](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/tools/list-tools.md): Retrieves all tools configured for your CometChat app. Use this endpoint to view available tools and actions, or filter by type.  **Filtering:** Use the `type` query parameter to filter by `action` or
- [Get Tool](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/tools/get-tool.md): Retrieves a specific tool by its unique name. Use this endpoint to inspect a tool's configuration, parameters, and description.
- [Create Tool](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/tools/create-tool.md): Defines custom tools that agents can invoke during conversations.  **Naming:** The tool name must be unique per application.  **Type:** When `doNotExecute` is `true`, the type is set to `tool`. Otherw
- [Update Tool](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/tools/update-tool.md): Updates an existing tool by its unique name. Use this endpoint to modify a tool's description, parameters, or behavior.  **Restrictions:** The tool name cannot be changed after creation. The provided
- [Delete Tool](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/tools/delete-tool.md): Deletes a tool by its unique name.

#### Troubleshoot

- [Error Codes](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/error-codes.md): Error Codes for CometChat REST API.
- [Properties and Constraints](https://www.cometchat.com/docs/rest-api/byo-ai-agents-apis/properties-and-constraints.md): Properties and Constraints for CometChat REST API.

### Agent Builder APIs

- [Agent Builder APIs](https://www.cometchat.com/docs/rest-api/ai-agents-apis/overview.md): Create and manage CometChat Agent Builder APIs for AI agents, tools, actions, MCP servers, and knowledge base workflows.
- [Setup & Authentication](https://www.cometchat.com/docs/rest-api/ai-agents-apis/setup-and-authentication.md): Navigate to Setup & Authentication documentation.
- [Users & Groups](https://www.cometchat.com/docs/rest-api/ai-agents-apis/users-and-groups.md): Navigate to Users & Groups documentation.

#### Agents

- [Create Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/create-agent.md): Creates a new agent with optional tools, API tools, MCP servers, and frontend actions. Use this endpoint to set up a fully configured agent in a single request.  **Validation:** All referenced tools,
- [List Agents](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/list-agents.md): Retrieves a paginated list of agents for your CometChat app. Use this endpoint to browse, search, and manage your agents.  **Search:** Use the `search` parameter to filter agents by name, description,
- [Get Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/get-agent.md): Retrieves a specific agent by its UID. Use this endpoint to inspect an agent's full configuration, including its tools, model, and instructions.
- [Update Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/update-agent.md): Updates an existing agent by its UID. Use this endpoint to modify an agent's configuration, instructions, model, or connected tools.  **Validation:** Referenced tools, API tools, and MCP servers are v
- [Delete Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/delete-agent.md): Deletes an agent by its UID.
- [Search Agent Tools](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/search-agent-tools.md): Searches across all tool types available for an agent, including ready-to-use tools, API tools, and MCP servers. Use this endpoint to find specific tools across all categories.  **Filtering:** Use the
- [List Agent Tools and Actions](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/list-agent-tools-and-actions.md): Retrieves all enabled items for a specific agent, categorized by type. Use this endpoint to see which tools, frontend actions, API tools, and MCP servers are currently enabled for an agent.  **Categor
- [List Available Models](https://www.cometchat.com/docs/rest-api/ai-agents-apis/agents/list-available-models.md): Lists the AI models available for agent creation. Returns model identifiers that can be used when creating or updating an agent's configuration.

#### Tools

- [Add Tools to Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/tools/add-tools-to-agent.md): Adds one or more tools to a specific agent. Use this endpoint to extend an agent's capabilities with additional tool integrations.  **Request body:** The `tools` array contains tool slugs. Returns the
- [Remove Tools from Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/tools/remove-tools-from-agent.md): Removes one or more tools from a specific agent. Use this endpoint to revoke tool access from an agent.  **Request body:** The `tools` array contains tool slugs to remove. Returns the updated agent ob
- [Get actions available within a tool for agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/tools/get-tool-actions-for-agent.md): Lists all actions available for a specific tool attached to an agent.
- [Enable actions for a tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/tools/enable-tool-actions.md): Adds actions to a specific tool attached to an agent.
- [Remove actions for a tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/tools/remove-tool-actions.md): Removes actions from a specific tool attached to an agent.

#### Custom API Tools

- [List API Tools](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/list-api-tools.md): Retrieves a paginated list of API tools for the application. Use this endpoint to browse and manage custom API tool configurations.
- [Get API Tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/get-api-tool.md): Retrieves a single custom API tool by its slug.
- [Create API Tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/create-api-tool.md): Creates a new API tool configuration for the application. Use this endpoint to define a custom API endpoint that agents can call during conversations.  **Uniqueness:** The slug must be unique per appl
- [Update API Tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/update-api-tool.md): Updates an existing API tool by its slug. Use this endpoint to modify an API tool's parameters, description, or endpoint configuration.
- [Delete API Tool](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/delete-api-tool.md): Deletes an API tool by its slug.
- [Add API Tools to Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/add-api-tools-to-agent.md): Adds one or more API tools to a specific agent. Use this endpoint to give an agent access to custom API tool integrations.  **Request body:** The `apiTools` array contains API tool slugs. Returns the
- [Remove API Tools from Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/custom-api-tools/remove-api-tools-from-agent.md): Removes one or more API tools from a specific agent. Use this endpoint to revoke API tool access from an agent.  **Request body:** The `apiTools` array contains API tool slugs to remove. Returns the u

#### Frontend Actions

- [List Frontend Actions](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/list-frontend-actions.md): Retrieves a paginated list of frontend actions for the application. Use this endpoint to browse and manage frontend action configurations.
- [Get Frontend Action](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/get-frontend-action.md): Retrieves a single frontend action by its ID.
- [Create Frontend Action](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/create-frontend-action.md): Creates a new frontend action for the application. Use this endpoint to define a client-side UI operation that agents can trigger during conversations.  **Uniqueness:** The trigger function must be un
- [Update Frontend Action](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/update-frontend-action.md): Updates an existing frontend action by its unique ID. Use this endpoint to modify a frontend action's parameters, description, or trigger function.
- [Delete Frontend Action](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/delete-frontend-action.md): Deletes a frontend action by its unique ID.
- [Add Frontend Actions to Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/add-frontend-actions-to-agent.md): Adds one or more frontend actions to a specific agent. Use this endpoint to enable an agent to trigger client-side UI operations.  **Frontend actions** allow agents to interact with the user interface
- [Remove Frontend Actions from Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/frontend-actions/remove-frontend-actions-from-agent.md): Removes one or more frontend actions from a specific agent. Use this endpoint to revoke frontend action capabilities from an agent.  **Request body:** The `frontendActions` array contains frontend act

#### MCP Servers

- [List MCP Servers](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/list-mcp-servers.md): Retrieves a paginated list of MCP servers for the application. Use this endpoint to browse and manage MCP server configurations.
- [Get MCP Server](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/get-mcp-server.md): Retrieves a single MCP server configuration by its slug.
- [Create MCP Server](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/create-mcp-server.md): Creates a new MCP (Model Context Protocol) server configuration for the application. Use this endpoint to register an MCP server that agents can connect to.  **Uniqueness:** The slug must be unique pe
- [Update MCP Server](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/update-mcp-server.md): Updates an existing MCP server by its slug. Use this endpoint to modify an MCP server's configuration or connection details.
- [Delete MCP Server](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/delete-mcp-server.md): Deletes an MCP server by its slug.
- [Add MCP Servers to Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/add-mcp-servers-to-agent.md): Adds one or more MCP servers to a specific agent. Use this endpoint to connect an agent to additional Model Context Protocol servers.  **Request body:** The `mcps` array contains MCP server slugs. Ret
- [Remove MCP Servers from Agent](https://www.cometchat.com/docs/rest-api/ai-agents-apis/mcp-servers/remove-mcp-servers-from-agent.md): Removes one or more MCP servers from a specific agent. Use this endpoint to disconnect MCP servers from an agent.  **Request body:** The `mcps` array contains MCP server slugs to remove. Returns the u

#### Knowledge Base

- [List Knowledge Base Records](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/list-knowledge-base-records.md): Retrieves knowledge base records for the application. Use this endpoint to browse all knowledge base sources including files, text entries, and websites.
- [Get Source Pages](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/get-source-pages.md): Retrieves paginated pages for a specific knowledge base source file. Use this endpoint to inspect the individual pages extracted from a knowledge base source.
- [Retry Knowledge Base Source Indexing](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/retry-knowledge-base-source-indexing.md): Retries the indexing process for a specific knowledge base source that failed during its initial processing. Provide the source type and its unique ID to re-trigger vectorization.  **Supported source
- [Initiate File Uploads](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/initiate-file-uploads.md): Generates presigned URLs and creates upload records for one or more files. Use this endpoint to prepare files for upload to the knowledge base.  **Workflow:** After receiving the presigned URLs, uploa
- [Delete Uploaded File](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/delete-uploaded-file.md): Deletes an uploaded file and all associated data from the knowledge base by its unique ID.  **Cleanup:** Removes the file, associated embeddings, and any agent references to this file.
- [List Text Entries](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/list-text-entries.md): Lists all text-based knowledge base entries for the app.
- [Get Text Entry](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/get-text-entry.md): Retrieves a specific text-based knowledge base entry by its unique ID.
- [Create Text Entry](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/create-text-detail.md): Creates a new text-based knowledge base entry. Use this endpoint to add custom text content that agents can reference during conversations.  **Processing:** Accepts a title and text content, converts
- [Update Text Entry](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/update-text-detail.md): Updates a specific text-based knowledge base entry by its unique ID. Use this endpoint to modify the title or content of an existing text entry.  **Re-indexing:** The content is re-uploaded and the en
- [Delete Text Entry](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/delete-text-detail.md): Deletes a text-based knowledge base entry and all associated data by its unique ID.  **Cleanup:** Removes the text content, associated embeddings, and any agent references to this entry.
- [Poll Knowledge Base Status](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/poll-knowledge-base-status.md): Retrieves the indexing status for one or more knowledge base sources by their IDs. Use this endpoint to monitor the progress of file uploads, text entries, or website crawls being indexed.  **Batch su
- [Add Files to Agent Knowledge Base](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/add-knowledge-base-files.md): Associates uploaded files or text entries with an agent's knowledge base. Use this endpoint after uploading files via the Initiate File Uploads endpoint to make them available to the agent.  **Source
- [Remove Files from Agent Knowledge Base](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/remove-knowledge-base-files.md): Removes files or text entries from an agent's knowledge base. Use this endpoint to disassociate specific sources from an agent without deleting the underlying content.  **Source types:** Specify the s
- [Scrape Single Page](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/scrape-single-page.md): Scrapes a single webpage to extract its content for the knowledge base. Use this endpoint to add a specific page without crawling an entire website.  **Extraction:** Returns the page title, descriptio
- [Crawl Website](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/scrape-website.md): Scrapes a website to discover and crawl its pages for the knowledge base. Use this endpoint to add website content as a knowledge source for agents.  **Configuration:** Supports options for URL filter
- [Get Discovered URLs](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/get-discovered-urls.md): Retrieves all URLs discovered during a website crawl. Use this endpoint to review which pages were found before processing them.
- [Process Discovered URLs](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/process-discovered-urls.md): Marks discovered URLs for exclusion and initiates batch crawling of the remaining URLs. Use this endpoint to selectively process pages discovered during a website crawl.
- [Delete Website](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/delete-website.md): Deletes a website crawl and all associated data from the knowledge base by its unique ID.  **Cleanup:** Removes all crawled pages, associated embeddings, and any agent references to this website.
- [Poll Discovered URLs Status](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/poll-discovered-urls-status.md): Retrieves the processing status of discovered URLs by their unique IDs. Use this endpoint to monitor the progress of URL crawling within a parent website crawl.  **Behavior:** Only returns records for
- [Retry Indexing for Website Pages](https://www.cometchat.com/docs/rest-api/ai-agents-apis/knowledge-base/retry-indexing-for-website-pages.md): Retries the indexing process for specific pages under a website knowledge base source. Pass the unique IDs of the pages to re-index, or send an empty array to automatically retry all pages that failed

#### Variables

- [List All Variables](https://www.cometchat.com/docs/rest-api/ai-agents-apis/variables/get-all-available-variables.md): Retrieves all enabled variables (predefined and custom) for the application. Use this endpoint to view variable definitions and understand where they are used.  **Usage tracking:** Each variable inclu
- [Create Custom Variable](https://www.cometchat.com/docs/rest-api/ai-agents-apis/variables/create-custom-variable.md): Creates a new custom variable for the application. Use this endpoint to define dynamic values that can be injected into agent instructions.  **Source types:** Variables can source values from message
- [Update Custom Variable](https://www.cometchat.com/docs/rest-api/ai-agents-apis/variables/update-custom-variable.md): Updates an existing custom variable by its ID. Use this endpoint to modify a variable's source, default value, or other properties.  **Partial updates:** Only the provided fields are updated; omitted
- [Delete Custom Variable](https://www.cometchat.com/docs/rest-api/ai-agents-apis/variables/delete-custom-variable.md): Deletes a custom variable by its ID.  **Impact:** Any agent instructions referencing this variable will no longer resolve its value.

#### Troubleshoot

- [Error Codes](https://www.cometchat.com/docs/rest-api/ai-agents-apis/error-codes.md): Error Codes for CometChat REST API.
- [Properties and Constraints](https://www.cometchat.com/docs/rest-api/ai-agents-apis/properties-and-constraints.md): Properties and Constraints for CometChat REST API.
