View an agent's API details
View API details shows how to call an agent from your own systems. It gives you ready-made requests to copy, and a file that describes the agent's integration contract.
Before you start
You need your account's API token. The requests in the panel use a placeholder in its place.
Open the API details
- On the Agents screen, select the agent's name to open its details.
- Open the Actions menu.
- Under Config, select View API details.
A panel opens, headed Public API and the agent's name.
What you see
The panel walks you through two steps.
1. Send a message
This step shows the request that sends a message to the agent. Choose the tab you need:
- Message only: send text.
- Message + file: send text with a file attached.
Select Copy to copy the request. The panel's notes explain what to fill in:
- Replace
<YOUR_API_TOKEN>with your account's API token. - Send a user ID on every call. The agent keeps long-term memory for each user ID.
- Create one
sessionIdper conversation, and send the same value on every turn. The agent builds up the conversation's history under it. A file you attach stays with thatsessionIdfor the rest of the conversation. - If you retry a failed send, send a
turnId, so the agent answers the turn only once.
The response includes a conversationId.
2. Poll for the response
This step shows the request that checks for the agent's answer. Replace <CONVERSATION_ID> with the conversationId from step 1, and poll until complete is true.
The conversationId is new on every send. Don't use it as your sessionId, or each turn starts a conversation with no history.
Download the integration contract
Select Download JSON to download the agent's integration contract as a JSON file.
Close the panel
Select Close, select outside the panel, or press Escape.