身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 tickets.reply 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/tickets/{ticketId}/close \
-H "Authorization: Bearer zdk_live_…"已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Closes the ticket. Idempotent — closing an already-closed ticket returns it unchanged rather than erroring. Requires `tickets.reply`.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
ticketId (path) | Uuid | 是 | The ticket's id. |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
id | Uuid | 是 | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | 是 | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
subject | string | 是 | — |
status | TicketStatus | 是 | Where a ticket sits in its lifecycle. `open` = waiting on us; `pending` = waiting on the customer; `solved` = we believe it is resolved and a customer reply reopens it; `closed`… |
priority | TicketPriority | 是 | How urgent the ticket is. The customer may propose one; staff decide. |
channel | string | 是 | How the ticket reached us — `dashboard`, `api` or `staff`. Server-decided; an open string so a future channel is additive on both sides. |
site_id | object | 否 | — |
invoice_id | object | 否 | — |
on_behalf_of_org_id | object | 否 | The **client org** a reseller opened this ticket about. Null on every ordinary ticket. ⛔ Validated as a descendant of the ticket's own org and `404`d otherwise, so it can never… |
assignee_name | object | 是 | The owning agent's display name (first name), or null while unassigned. The customer sees a **name** so they know a person owns their ticket; the agent's id and email are staff-… |
first_response_at | object | 否 | — |
resolved_at | object | 否 | — |
closed_at | object | 否 | — |
last_message_at | object | 否 | — |
reopened_count | integer | 是 | — |
message_count | integer | 是 | Customer-visible messages in the thread — internal notes are not counted. |
created_at | string | 是 | — |
updated_at | string | 是 | — |
messages | TicketMessage[] | 是 | The customer-visible thread in chronological order. |
此端点可能返回的错误
401 · 403 · 404 · 429