Complete reference of endpoints, webhooks, and integrations scripts to automate your workspace flows programmatically.
Authenticate your requests using Bearer API keys. Add the key in the Authorization header of your HTTP requests. Keep your secret key secure.
curl -H "Authorization: Bearer tc_live_key" \
https://api.trained.chat/v1/auth/verify{
"status": "authenticated",
"organization": "Acme Corp",
"scope": ["read", "write"]
}Send messages to a deployed agent. The API returns the response along with the exact source citation records utilized to synthesize the answers.
curl -X POST \
-H "Authorization: Bearer tc_live_key" \
-H "Content-Type: application/json" \
-d '{
"agentId": "agent_941a",
"message": "Where is my order #124?"
}' \
https://api.trained.chat/v1/chat/message{
"agentId": "agent_941a",
"response": "Your order has shipped.",
"citations": [
{
"source": "shipping-policy.pdf",
"pages": [12]
}
]
}Query your knowledge core directly. Returns the raw parsed text chunks ranked by cosine similarity relevance scores.
curl -X POST \
-H "Authorization: Bearer tc_live_key" \
-d '{
"query": "refund limits"
}' \
https://api.trained.chat/v1/knowledge/search{
"query": "refund limits",
"results": [
{
"chunk": "Refunds are limited...",
"score": 0.941
}
]
}Create, configure, and retrieve agent instances programmatically. Update system prompts and assigned tool schemas.
curl -H "Authorization: Bearer tc_live_key" \
https://api.trained.chat/v1/agents{
"agents": [
{
"id": "agent_941a",
"role": "Support",
"status": "deployed"
}
]
}Subscribe to real-time events. Get notified when agents take actions, require human handoff, or encounter errors.
curl -X POST \
-H "Authorization: Bearer tc_live_key" \
-d '{
"url": "https://yourserver.com/callback",
"events": ["agent.action", "agent.handoff"]
}' \
https://api.trained.chat/v1/webhooks/subscribe{
"id": "webhook_sub_412",
"status": "active"
}