Skip to content

Chats

List Work Chats

List work chats with pagination and outcome-based stats.

Stats: throughput = count(SUCCESS outcomes), efficiency = avg cost per SUCCESS outcome.

Parameters

NameInTypeRequiredDescription
agent_idquerystring (uuid)no
org_idpathstring (uuid)yes
pagequeryintegerno
per_pagequeryintegerno
resolutionquerystringnoFilter by how the work came out: success, partial, failed, stopped. This is the filter a needs-a-human queue wants — status=active returns successes, partials and idle chats alike.
sincequerystringnoTime period for stats: 24h, 7d, 30d
sort_byquerystringnoSort field: created_at, completed_at, total_cost_usd, title
sort_orderquerystringnoasc or desc
statusquerystringno
tagsquerystring[]noFilter by tags (ALL must match)

Responses

StatusDescriptionBody
200Successful ResponseChatWorkListResponse
422Validation ErrorHTTPValidationError

Create Work Chat

Create a new work chat (manual trigger).

Validates the agent, checks for prompt injection, determines initial ChatStatus based on execution mode, and emits chat.work_created to Hatchet when the chat is ACTIVE.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
agent_idstring (uuid)yes
descriptionstringno
tagsstring[]no
titlestringno

Responses

StatusDescriptionBody
201Successful ResponseChatWorkResponse
422Validation ErrorHTTPValidationError

Get Work Chat

Get a single work chat detail.

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseChatWorkResponse
422Validation ErrorHTTPValidationError

Delete Work Chat

Soft-delete a work chat.

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/chats/{chat_id}/outcomes

Section titled “GET /api/orgs/{org_id}/chats/{chat_id}/outcomes”

List Outcomes

List all outcomes recorded for a chat.

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseOutcomeListResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/chats/{chat_id}/outcomes

Section titled “POST /api/orgs/{org_id}/chats/{chat_id}/outcomes”

Create Outcome

Record an outcome against a chat (manual / override).

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
evidencestringno
goalstringyes
statusstringno
summarystringno

Responses

StatusDescriptionBody
201Successful ResponseOutcomeResponse
422Validation ErrorHTTPValidationError

PATCH /api/orgs/{org_id}/chats/{chat_id}/tags

Section titled “PATCH /api/orgs/{org_id}/chats/{chat_id}/tags”

Update Chat Tags

Update tags on a work chat.

Tag names are also registered in the org’s shared tag registry (idempotent) so they appear in GET /tags and can be renamed/recolored there — see ChatService.rename_tag/remove_tag for how a registry change syncs back into a chat’s tag list.

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
tagsstring[]yes

Responses

StatusDescriptionBody
200Successful Responsestring[]
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/chats/{chat_id}/trace

Section titled “GET /api/orgs/{org_id}/chats/{chat_id}/trace”

Get Chat Trace

Lineage tree for a chat, with the building blocks each chat ran.

The tree is rooted at the topmost ancestor and expanded downward, so the response holds ancestors, siblings and descendants — the card highlights is_current rather than asking for a second request per branch.

Parameters

NameInTypeRequiredDescription
chat_idpathstring (uuid)yes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseChatTraceResponse
422Validation ErrorHTTPValidationError

Browse Org Chats

The org-wide All chats table: every agent’s chats in one list.

The same rows, filters, sort and page shape as the per-agent table (/api/orgs/{org_id}/agents/{agent_id}/chats/browse), read at org scope — both go through :func:_chat_list_select and :func:chat_browse_conditions, so a row cannot say one thing here and another there. What differs is the axis each one offers instead of the other’s: this one filters by agent (repeatable), the per-agent one by revision — a revision number only means something inside one agent, so mixing agents makes “v10” a filter that quietly matches unrelated work.

For the same reason revision_version on these rows is only ever a pinned version: resolving an agent’s active revision per row would be one query per agent on the page to fill a column that cannot be compared across them anyway. The org-wide table doesn’t render it.

Visibility is the per-agent table’s, unchanged: private (neutral) chats reach only their creator, and everything is scoped to one org after a membership check.

Parameters

NameInTypeRequiredDescription
agentquerystring (uuid)[]noRepeatable agent id filter.
archivedquerybooleannoTrue returns archived chats only; false (default) returns active ones.
fromquerystring (date-time)noOnly chats whose last activity is at or after this.
limitqueryintegerno
offsetqueryintegerno
orderquery"asc" | "desc"no
org_idpathstring (uuid)yes
qquerystringnoCase-insensitive substring match on the chat title.
resolutionquerystring[]noRepeatable ChatResolution filter.
sortquery"activity" | "cost" | "messages"no
sourcequerystring[]noRepeatable ChatSource filter.
statusquerystring[]noRepeatable ChatStatus filter.
toquerystring (date-time)noOnly chats whose last activity is at or before this.

Responses

StatusDescriptionBody
200Successful ResponseChatBrowseResponse
422Validation ErrorHTTPValidationError

List Chat Statuses

Batch status lookup for chats referenced from another surface.

Exists so a view holding N chat ids (a chat transcript’s start_chat tool rows, say) draws N status icons from ONE request instead of N detail fetches — and draws them from the same rollup the conversation sidebar uses, so one chat never shows two different states in one page.

Parameters

NameInTypeRequiredDescription
idsquerystring (uuid)[]noChat ids to look up (max 50)
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponseChatStatusListResponse
422Validation ErrorHTTPValidationError