Run via API
Everything you can do with an agent in the app, you can do over HTTPS: run agents, create conversations, send messages, and read results from your own systems.
Authenticate
- In Cotera, open Settings → API Keys and create a key (
sk_…). The key carries your user's org access. - Send it as a Bearer token:
curl https://app.cotera.co/api/v1/resource/agent/{agentId}/invoke \
-H "Authorization: Bearer sk_your_key" \
-H "Content-Type: application/json" \
-d '{ "input": { "company_name": "Acme Corp" } }'
The core endpoints
POST /api/v1/resource/agent/{id}/invokeruns an agent with input and returns its (structured) resultPOST /api/v1/resource/chatcreates a conversationPOST /api/v1/resource/chat/{id}/messagessends messages to itGET /api/v1/resource/chat/{id}/statuschecks whether a run is still going
Full reference
The complete guide — the agent object, tools, and worked create → invoke → batch examples — is the Agent API reference.
If you're generating a client, the machine-readable OpenAPI JSON is at app.cotera.co/api/docs/public-json.
Things to know
- Agent runs can take a while. An agent doing real work with tools is not a sub-second RPC. For event-shaped integrations, a webhook trigger is usually a better fit than calling and polling.
- Define structured output on agents you call from code, so you parse fields instead of prose.