assistant

POST /v1/assistant/conversations/{conversationId}/messages

Ask the assistant a question and get its answer.

所有 assistant 端点

所有开发者文档

身份验证

请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 tickets.reply 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。

此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。

免费试用

将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。

curl -X POST https://api.zinndigital.com/v1/assistant/conversations/{conversationId}/messages \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "question": <string> }'

已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点

详细信息

Synchronous: one request, two persisted turns, and the answer in the response. ⛔ Not 202 with a poll — §2.16 forbids an interactive path behind a job queue, and a chat that answers on the next poll is not a chat. Expect several seconds. The answer is grounded in published knowledge-base articles and, when site_id names one of your own sites, that site's health as read from our monitoring database. It cannot see another tenant's data, an unpublished draft, or a staff internal note — those are excluded by what the engine fetches, not by asking the model. It cannot act: no tool on this path changes anything. A 503 is a refusal fit to show the customer, and its error_code distinguishes the reasons — ASSISTANT_DAILY_LIMIT, ASSISTANT_DISABLED, ASSISTANT_FAILED, ASSISTANT_UNAVAILABLE. ⭐ Four, not six: an empty or over-long question is refused by validation as a 422 before anything is spent, so its code never reaches this response. Requires tickets.reply.

参数

名称类型必填内容简介
conversationId (path)UuidThe conversation's id.

请求正文

名称类型必填内容简介
questionstringThe customer's question, in their own language. Longer than this is a paste, not a question, and an unbounded prompt is an unbounded bill — so it is a 422.
site_idUuidWhich of your sites this is about. ⛔ Validated against your own sites before anything is read — an id from a client is a request, not a fact.
page_contextstringThe screen you asked from, as a route path — e.g. /sites/{siteId}/backups. "Why is this failing?" asked on the backups screen and on the DNS screen are different questions, and…

响应

名称类型必填内容简介
idUuidUUIDv7 identifier — sortable by creation time (docs/02 §8).
roleAssistantRole
textstring
cited_slugsstring[]Knowledge-base slugs the answer used, for /kb/<slug> links. ⭐ Always a subset of what the engine supplied — a slug the model invented is dropped, because a fabricated citation…
needs_humanbooleanThe model's own statement that it could not answer from what it was given. Recorded from its structured output, never inferred from the prose. This is what the "open a ticket"…
created_atstring

此端点可能返回的错误

401 · 403 · 404 · 422 · 429 · 503