Artificial Intelligence · 1 min read
Deploy to API for Managed Agents
Deploy to API lets your own software talk to a published Managed Agent. Your website, app, or backend can start a conversation, send messages, and get the agent's replies, without building a separate agent or workflow.
How it works
- Adding the Invoked via API trigger makes the agent available through the API.
- The agent can keep its other triggers too.
- API requests always use the agent's published version, so your app gets the version you've already tested.
Set it up
- Go to AI Agents > Agent Studio and open the Managed Agent.
- Do one of the following:
- In the Triggers row, add Invoked via API.
- Open the agent's ⋮ menu and choose Deploy to API.
- Review the endpoint and the sample requests in cURL, Python, or JavaScript.
- Create or choose an API key for your account. Store it securely on your server.
- Publish the agent.
Start and continue a conversation
- Send a request to start a conversation. The response includes a conversation ID.
- Send that conversation ID with later messages so the agent keeps the context.
Invoked via API or from a workflow?
- Use Invoked via API when your own software starts the conversation.
- Use Invoke Managed Agent in a workflow when something in your account, such as a form or tag, should start the agent.
Security tips
- Never put your API key in browser code. Call the API from your server.
- Rotate keys you think may be exposed.