Skip to content
TriedDocs
Chat agents

Create chat agent

Create a text chat agent on a Retell LLM or conversation flow.

POSThttps://api.tried.com.au/create-chat-agent

Creates a chat agent for text conversations (chats, the website widget). A chat agent runs the same response engines as voice agents, so you can share one LLM or flow between a voice agent and a chat agent. Custom LLM WebSocket engines are not supported for chat.

Request#

Body#

Field Type Required Description
response_engine object Yes { "type": "retell-llm", "llm_id", "version"? } or { "type": "conversation-flow", "conversation_flow_id", "version"? }. The engine must exist. Without version the latest version is used on every chat.
agent_name string No 1 to 120 characters. Default New chat agent.
post_chat_analysis_data object[] No Analysis fields extracted after each chat into chat_analysis.custom_analysis_data. Default [].
post_chat_analysis_model string No Model for post-chat analysis. Default gpt-5.6-terra.
analysis_summary_prompt string No Custom prompt for chat_summary. Up to 2000 characters.
analysis_successful_prompt string No Custom prompt for chat_successful. Up to 2000 characters.
webhook_url string or null No URL for chat events. When null, the workspace webhook URL is used. Default null.
webhook_events string[] No Any of chat_started, chat_ended, chat_analyzed. Default: all three. Each delivery's body is { "event", "chat" } with the chat object.
end_chat_after_silence_ms integer No End a chat after this long without activity, 60000 to 86400000. Default 3600000 (1 hour).
auto_close_message string No Up to 500 characters. Added as the last agent message when a chat is closed for inactivity (end_chat_after_silence_ms).

Example request#

curl -X POST "https://api.tried.com.au/create-chat-agent" \
  -H "Authorization: Bearer $TRIED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_name": "Bright Dental chat",
  "response_engine": {
    "type": "retell-llm",
    "llm_id": "llm_9c8b7a6f5e4d3c2b1a0f9e8d"
  },
  "post_chat_analysis_data": [
    {
      "type": "boolean",
      "name": "booked",
      "description": "Did the user book an appointment?"
    }
  ],
  "end_chat_after_silence_ms": 1800000
}'
const res = await fetch("https://api.tried.com.au/create-chat-agent", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "agent_name": "Bright Dental chat",
    "response_engine": {
      "type": "retell-llm",
      "llm_id": "llm_9c8b7a6f5e4d3c2b1a0f9e8d"
    },
    "post_chat_analysis_data": [
      {
        "type": "boolean",
        "name": "booked",
        "description": "Did the user book an appointment?"
      }
    ],
    "end_chat_after_silence_ms": 1800000
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://api.tried.com.au/create-chat-agent",
    headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
    json={
        "agent_name": "Bright Dental chat",
        "response_engine": {
            "type": "retell-llm",
            "llm_id": "llm_9c8b7a6f5e4d3c2b1a0f9e8d",
        },
        "post_chat_analysis_data": [
            {
                "type": "boolean",
                "name": "booked",
                "description": "Did the user book an appointment?",
            },
        ],
        "end_chat_after_silence_ms": 1800000,
    },
)
data = res.json()

Response#

201 Created

{
  "chat_agent_id": "chat_agent_6a7b8c9d0e1f2a3b4c5d6e7f",
  "agent_name": "Bright Dental chat",
  "response_engine": { "type": "retell-llm", "llm_id": "llm_9c8b7a6f5e4d3c2b1a0f9e8d" },
  "post_chat_analysis_data": [
    { "type": "boolean", "name": "booked", "description": "Did the user book an appointment?", "required": false }
  ],
  "post_chat_analysis_model": "gpt-5.6-terra",
  "webhook_url": null,
  "webhook_events": ["chat_started", "chat_ended", "chat_analyzed"],
  "end_chat_after_silence_ms": 1800000,
  "last_modification_timestamp": 1792310400000
}
Field Type Description
chat_agent_id string chat_agent_ plus 24 hex characters.
last_modification_timestamp integer Epoch ms.

Chat agents have a single editable record. Published snapshots are separate: see Publish chat agent.

Errors#

Status When
400 Validation failed, or the engine is custom-llm (Chat agents support retell-llm and conversation-flow engines).
401 Missing or invalid API key.
403 The key's IP allowlist or scopes reject the request. This route needs the calls scope.
404 The LLM or flow (or its version) does not exist.
429 Rate limit exceeded. See Rate limits.

See Errors for the body format.