# Starleads api docs - [Welcome to Starleads](https://docs.starleads.co/documentation/get-started.md): Conversational AI platform — phone, web-widget, SMS & WhatsApp. Integrate with our API to manage campaigns, prospects, and receive results in real-time. - [Authentication](https://docs.starleads.co/documentation/authentification.md): Learn how to authenticate your API requests using your API key. - [Receive Conversation Results](https://docs.starleads.co/documentation/receive-conversation-results.md): Get your agents' conversation results in real-time via webhooks. - [Knowledge Base (RAG)](https://docs.starleads.co/documentation/rag-knowledge-base.md): Build and manage AI-powered knowledge bases. Create datasets, upload documents, configure chat assistants, and connect them to your voice agents. - [API Reference](https://docs.starleads.co/api-reference/introduction.md): Base URL, authentication, pagination and error handling for the Starleads public API. - [Get the current consumption](https://docs.starleads.co/api-reference/consumption/get-current-consumption.md): Returns the credit balance for the current billing period of the company owning the API key: included, consumed and remaining credits, usage percentage, the period boundaries (the end date being when credits recharge) and the subscription status. Figures are reported as-is, including a negative rema… - [Get the consumption breakdown](https://docs.starleads.co/api-reference/consumption/get-consumption-breakdown.md): Returns the credit consumption of the company owning the API key over the requested range, broken down by channel, month and agent (each agent with its own campaign breakdown). Each axis sums to the total. The range is mandatory, must be ordered and may not span more than 366 days. - [List consumption transactions](https://docs.starleads.co/api-reference/consumption/get-consumption-transactions.md): Returns the credit ledger of the company owning the API key over the requested range, one entry per line, paginated with the standard pageNumber/pageSize convention. The range is mandatory, must be ordered and may not span more than 366 days. Every entry type is returned (debits, credits, adjustment… - [Get the subscription contract](https://docs.starleads.co/api-reference/subscription/get-subscription-contract.md): Returns the subscription contract of the company owning the API key: the plan name, the subscription status, the features currently active and the effective limits (each with its resolved value). No price, rate, discount, Stripe identifier, limit override or feature provenance is ever exposed. - [Get all campaigns](https://docs.starleads.co/api-reference/campaign/get-all-campaigns.md) - [Create a campaign](https://docs.starleads.co/api-reference/campaign/create-a-campaign.md) - [Get campaign items with filters](https://docs.starleads.co/api-reference/campaignitem/get-campaign-items-with-filters.md): Retrieves campaign items with optional filters including status, archived state, and pagination. - [Get all items by phone number](https://docs.starleads.co/api-reference/campaignitem/get-all-items-by-phone-number.md) - [Add a new campaign item to a campaign](https://docs.starleads.co/api-reference/campaignitem/add-a-new-campaign-item-to-a-campaign.md) - [Add multiple items to a campaign](https://docs.starleads.co/api-reference/campaignitem/add-multiple-items-to-a-campaign.md): Allows adding multiple items to a specific campaign identified by `campaignId`. Authentication is required using an API key passed in the `X-Api-Key` header. You can retrieve your API key from your profile when logged in to [Starleads](https://app.starleads.co/). - [Delete an item from a campaign](https://docs.starleads.co/api-reference/campaignitem/delete-an-item-from-a-campaign.md) - [Get item audio recording](https://docs.starleads.co/api-reference/campaignitem/get-item-audio-recording.md): Retrieves the call audio recording for a campaign item as a WAV stream. Requires ownership validation: the API key must belong to the same company as the item's campaign. - [Delete item audio recording](https://docs.starleads.co/api-reference/campaignitem/delete-item-audio-recording.md): Permanently deletes the call audio recording for a campaign item. The item itself is not affected. This operation is idempotent: deleting an already-deleted audio returns 204. Deletions are logged for GDPR compliance. - [Get campaign's fields](https://docs.starleads.co/api-reference/campaignfield/get-campaigns-fields.md) - [Get the prompt of an agent](https://docs.starleads.co/api-reference/agent/get-the-prompt-of-an-agent.md): Retrieves the current prompt configured for an agent. The agent must belong to the same company as the API key used for authentication. - [Update the prompt of an agent](https://docs.starleads.co/api-reference/agent/update-the-prompt-of-an-agent.md): Replaces the current prompt of an agent with a new value. The agent must belong to the same company as the API key used for authentication. The prompt must not be empty and cannot exceed 50,000 characters. - [Connect a knowledge base chat to an agent](https://docs.starleads.co/api-reference/agent/connect-a-knowledge-base-chat-to-an-agent.md) - [Get the chat connected to an agent](https://docs.starleads.co/api-reference/agent/get-the-chat-connected-to-an-agent.md) - [Detach the chat from an agent](https://docs.starleads.co/api-reference/agent/detach-the-chat-from-an-agent.md) - [Get an agent](https://docs.starleads.co/api-reference/agent/get-an-agent.md): Returns everything needed to work with the agent through the other endpoints: its channel and direction, its prompt and welcome messages, the variables it expects (`fields`, to pass as `dataBag` or `variables`), the classification tags and extracted values found in results, and what is connected to… - [List the tools connected to an agent](https://docs.starleads.co/api-reference/agent/list-the-tools-connected-to-an-agent.md): Returns the tools currently connected to the agent (id, name and technical name). - [Connect a tool to an agent](https://docs.starleads.co/api-reference/agent/connect-a-tool-to-an-agent.md): Connects a tool to the agent and returns the full list of connected tools. Connecting a tool that is already connected is a no-op. The tool must belong to the same company as the API key. - [Disconnect a tool from an agent](https://docs.starleads.co/api-reference/agent/disconnect-a-tool-from-an-agent.md): Disconnects a tool from the agent and returns the remaining connected tools. Disconnecting a tool that is not connected is a no-op. - [List the sub-agents connected to an agent](https://docs.starleads.co/api-reference/agent/list-the-sub-agents-connected-to-an-agent.md): Returns the sub-agents the agent can delegate to (id, name, technical name and description). Their full configuration is available on the SubAgent endpoints. - [Connect a sub-agent to an agent](https://docs.starleads.co/api-reference/agent/connect-a-sub-agent-to-an-agent.md): Connects a sub-agent to the agent and returns the full list of connected sub-agents. Connecting a sub-agent that is already connected is a no-op. The sub-agent must belong to the same company as the API key. - [Disconnect a sub-agent from an agent](https://docs.starleads.co/api-reference/agent/disconnect-a-sub-agent-from-an-agent.md): Disconnects a sub-agent from the agent and returns the remaining connected sub-agents. Disconnecting a sub-agent that is not connected is a no-op. The sub-agent itself is not deleted. - [Get the history of an agent](https://docs.starleads.co/api-reference/agent/get-the-history-of-an-agent.md): Returns the successive versions of the agent, most recent first. Each entry gives the agent name, the prompt and the connected tools at that time. - [List sub-agents](https://docs.starleads.co/api-reference/subagent/list-sub-agents.md): Returns the sub-agents of the company the API key belongs to, paginated. - [Get a sub-agent](https://docs.starleads.co/api-reference/subagent/get-a-sub-agent.md): Returns the full configuration of a sub-agent. It must belong to the same company as the API key. - [Create a sub-agent](https://docs.starleads.co/api-reference/subagent/create-a-sub-agent.md): Creates a sub-agent in the workspace of the API key. The name must be snake_case and must not start with `subagent_`, which is added when the sub-agent is exposed as a tool. Creating a sub-agent does not connect it to an agent: use `PUT /Agent/{agentId}/subagents/{subAgentId}` for that. - [Update a sub-agent](https://docs.starleads.co/api-reference/subagent/update-a-sub-agent.md): Replaces the configuration of a sub-agent. Every field of the body is written, so send the full configuration. Workspace files, code execution and the per-message command are not part of this contract and keep their current value. - [Delete a sub-agent](https://docs.starleads.co/api-reference/subagent/delete-a-sub-agent.md): Deletes a sub-agent. Refused with 409 while an agent still delegates to it: disconnect it first with `DELETE /Agent/{agentId}/subagents/{subAgentId}`. Archived agents do not block the deletion. - [Start a simulation chat with an agent](https://docs.starleads.co/api-reference/simulationchat/start-a-simulation-chat-with-an-agent.md): Starts a new text conversation with the agent and returns its identifier, the messages so far (the agent's welcome message, if any) and the agent definition. The agent must belong to the same company as the API key. Use `toolMocking` to keep the agent's tools and sub-agents from triggering real acti… - [Get a simulation chat](https://docs.starleads.co/api-reference/simulationchat/get-a-simulation-chat.md): Returns the messages exchanged so far. The agent is only returned by SimulationChat/start (`agent` is null here). A chat is forgotten after 30 minutes of inactivity. - [Send a message to a simulation chat](https://docs.starleads.co/api-reference/simulationchat/send-a-message-to-a-simulation-chat.md): Sends a message as the contact and returns the agent's reply. When `reply.isConversationEnded` is true the chat is over; start a new one to continue testing. Use GET SimulationChat/{simulationChatId} to read the whole conversation. - [List the tests of an agent](https://docs.starleads.co/api-reference/agenttest/list-the-tests-of-an-agent.md): Lists the tests of one of your agents with their latest run status. Use `kind` to keep only simulation or classification tests, and `folderId` on each test to know where it lives. - [Get a test](https://docs.starleads.co/api-reference/agenttest/get-a-test.md): Returns a test with its full definition. Depending on kind, the simulation fields (scenario, criteria, maxTurns, variables) or the classification fields (conversationContext, tagExpected) are set. - [Delete a test](https://docs.starleads.co/api-reference/agenttest/delete-a-test.md): Deletes a test and its runs (queued or running runs are cancelled). - [Create a simulation test](https://docs.starleads.co/api-reference/agenttest/create-a-simulation-test.md): Creates a simulation test on one of your agents: a scenario describing the simulated user, one or more success criteria judged independently, a maximum number of turns and the values of the agent variables. Use `toolMocking` to keep the agent's tools and sub-agents from triggering real actions on yo… - [Update a simulation test](https://docs.starleads.co/api-reference/agenttest/update-a-simulation-test.md): Updates the provided fields of a simulation test. `toolMocking`, when provided, replaces the tool and sub-agent mocking of the test as a whole. - [Create a classification test](https://docs.starleads.co/api-reference/agenttest/create-a-classification-test.md): Creates a classification test on one of your agents: a conversation and the tag the agent is expected to produce for it. - [Update a classification test](https://docs.starleads.co/api-reference/agenttest/update-a-classification-test.md): Updates the provided fields of a classification test. - [Move tests into a folder](https://docs.starleads.co/api-reference/agenttest/move-tests-into-a-folder.md): Moves tests (all of the same agent) into a folder of that agent, or back to the root when folderId is null. - [List the folders of an agent](https://docs.starleads.co/api-reference/agenttestfolder/list-the-folders-of-an-agent.md) - [Get a folder](https://docs.starleads.co/api-reference/agenttestfolder/get-a-folder.md) - [Create a folder](https://docs.starleads.co/api-reference/agenttestfolder/create-a-folder.md): Creates a folder on one of your agents. Folders are flat: they contain tests only. - [Update a folder](https://docs.starleads.co/api-reference/agenttestfolder/update-a-folder.md): Updates the name, color or markdown body of a folder. - [Delete a folder](https://docs.starleads.co/api-reference/agenttestfolder/delete-a-folder.md): Deletes a folder; its tests move back to the root of the agent. No test is deleted. - [Launch tests](https://docs.starleads.co/api-reference/agenttestexecution/launch-tests.md): Launches tests of one of your agents and returns the execution immediately. Give `testIds` to launch a selection, or omit it to launch every test of the agent; `repetitions` (1-5) runs each test several times. Poll the execution until its status is Completed or Cancelled. - [Get an execution](https://docs.starleads.co/api-reference/agenttestexecution/get-an-execution.md): Returns an execution with its status, its counters of runs per status and, per test, the pass rate over the repetitions. Status, counters and dates are derived from the runs. - [List the executions of an agent](https://docs.starleads.co/api-reference/agenttestexecution/list-the-executions-of-an-agent.md): Lists the executions of one of your agents, newest first, paginated. - [Cancel an execution](https://docs.starleads.co/api-reference/agenttestexecution/cancel-an-execution.md): Cancels every queued or running run of the execution. Finished runs are left untouched; the response lists the runs actually cancelled. - [Get a run](https://docs.starleads.co/api-reference/agenttestrun/get-a-run.md): Returns a run with its status, its execution and attempt number and, once finished, its result: transcript and per-criterion verdicts for a simulation, produced tag for a classification. - [List runs](https://docs.starleads.co/api-reference/agenttestrun/list-runs.md): Lists runs newest first, paginated, filtered by agentId, testId, folderId and/or executionId. At least one filter is required; filters combine. - [Cancel runs](https://docs.starleads.co/api-reference/agenttestrun/cancel-runs.md): Cancels queued or running runs selected by run ids and/or test ids. Finished runs are left untouched; the response lists the runs actually cancelled. To cancel a whole launch use POST /AgentTestExecution/{executionId}/cancel. - [List datasets](https://docs.starleads.co/api-reference/dataset/list-datasets.md) - [Create a dataset](https://docs.starleads.co/api-reference/dataset/create-a-dataset.md) - [Get a dataset](https://docs.starleads.co/api-reference/dataset/get-a-dataset.md) - [Update a dataset](https://docs.starleads.co/api-reference/dataset/update-a-dataset.md) - [Delete a dataset](https://docs.starleads.co/api-reference/dataset/delete-a-dataset.md) - [List documents in a dataset](https://docs.starleads.co/api-reference/document/list-documents-in-a-dataset.md) - [Upload documents to a dataset](https://docs.starleads.co/api-reference/document/upload-documents-to-a-dataset.md) - [Download a document file](https://docs.starleads.co/api-reference/document/download-a-document-file.md) - [Update a document](https://docs.starleads.co/api-reference/document/update-a-document.md) - [Delete a document](https://docs.starleads.co/api-reference/document/delete-a-document.md) - [Trigger document parsing](https://docs.starleads.co/api-reference/document/trigger-document-parsing.md) - [Stop document parsing](https://docs.starleads.co/api-reference/document/stop-document-parsing.md) - [List knowledge base chats](https://docs.starleads.co/api-reference/knowledgebasechat/list-knowledge-base-chats.md) - [Create a knowledge base chat](https://docs.starleads.co/api-reference/knowledgebasechat/create-a-knowledge-base-chat.md) - [Get a knowledge base chat](https://docs.starleads.co/api-reference/knowledgebasechat/get-a-knowledge-base-chat.md) - [Update a knowledge base chat](https://docs.starleads.co/api-reference/knowledgebasechat/update-a-knowledge-base-chat.md) - [Delete a knowledge base chat](https://docs.starleads.co/api-reference/knowledgebasechat/delete-a-knowledge-base-chat.md) - [Enable knowledge graph on a dataset](https://docs.starleads.co/api-reference/knowledgegraph/enable-knowledge-graph-on-a-dataset.md) - [Trigger knowledge graph construction](https://docs.starleads.co/api-reference/knowledgegraph/trigger-knowledge-graph-construction.md) - [Get knowledge graph build status](https://docs.starleads.co/api-reference/knowledgegraph/get-knowledge-graph-build-status.md) - [Get the knowledge graph](https://docs.starleads.co/api-reference/knowledgegraph/get-the-knowledge-graph.md) - [Delete the knowledge graph](https://docs.starleads.co/api-reference/knowledgegraph/delete-the-knowledge-graph.md) ## OpenAPI Specs - [openapi](/api-reference/openapi.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.