Use the Agentic Chat
The agentic chat runs the agents enabled for your organization, with their skills and tools. It
lives under /api/v2; everything else in this API is under /api/v1.
Before you begin
- You have an API key (
pai_test_*orpai_live_*) - Feature
api.agentic_chatis enabled for your organization - A turn runs as the user who created the API key, with the agents enabled for the organization
Send a message
text,cardandfilesare the fields to build on.eventsis the raw activity of the turn. Add"include_events": falseto leave it out.- The request waits up to 230 seconds. For long turns send
"stream": trueand read the event stream; the chat ID is in theX-Chat-Idheader.
Continue a chat
Send only the new message with the chat_id. The server keeps the history.
Attach a file
PDF, PNG, JPEG, Markdown, XLSX and DOCX are accepted, up to 500 MB. An attached file is a chat attachment. It does not enter your knowledge library; use Documents for that.
Choose an agent
By default the best agent is picked for each turn. To use a specific one, list the agents and pass
its id:
Answer a card
Some skills stop and ask you to confirm inputs or choose an option. The reply then has
"status": "awaiting_input" and a card:
Answer it in your next request:
For a card that asks you to confirm inputs, use "action": "confirm" and send the card’s rows back
in values.
Download a generated file
Files the agent generates (a report, a marked-up drawing) are listed in files:
The reply has a download_url that is valid for expires_in seconds (300 by default; set ttl
between 60 and 3600).