Skip to content
TriedDocs
Chat agents

Create chat agent

Create a text chat agent on a 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": "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.
timezone string No IANA timezone for time variables and bookings. Default Australia/Sydney.
widget object No How the website widget looks for this agent. See Widget object.
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-luna.
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).

Widget object#

Field Type Description
title string Header text and button label. Up to 60 characters. Default Chat with us.
subtitle string Line under the title. Up to 120 characters. Default empty.
color string Hex colour like #2563eb for the button, header and visitor messages. Default #18181b.
position string right or left (bottom corner). Default right.
placeholder string Message box placeholder. Up to 80 characters. Default Type a message.
teaser string Bubble next to the button, shown once per visit. Up to 140 characters. Default empty (none).
suggested_replies string[] Up to 6 replies of up to 60 characters, shown as buttons under the welcome message until the visitor writes. Default [].
pre_chat_form object { "enabled", "fields", "intro" }. fields lists any of name, email, phone (default ["name"]); intro is up to 200 characters. The answers become the chat's customer_name, customer_email and customer_phone dynamic variables. Default enabled: false.

Fields left out take their defaults. On update, widget replaces the whole object.

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": "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": "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": "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": "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-luna",
  "webhook_url": null,
  "webhook_events": ["chat_started", "chat_ended", "chat_analyzed"],
  "end_chat_after_silence_ms": 1800000,
  "timezone": "Australia/Sydney",
  "widget": {
    "title": "Chat with us",
    "subtitle": "",
    "color": "#18181b",
    "position": "right",
    "placeholder": "Type a message",
    "teaser": "",
    "suggested_replies": [],
    "pre_chat_form": { "enabled": false, "fields": ["name"], "intro": "" }
  },
  "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 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.