Close

[POST] .../v1/ticket/close

Closes a CRM ticket. Close a support ticket after the issue is resolved or the conversation is finished. The method validates the ticket, uses provided resolved_date or the current server time, sets status Closed and resolved date, creates or closes the linked ticket chat, writes a TicketClosed chat system message, recalculates SLA and missed flag, sends TicketClosed and SLA webhooks, cancels ticket-created notifications and returns row_affected with the ticket id. The request body is required and id must be positive; resolved_date is optional Unix time in seconds and is ignored when non-positive. The caller must have CRM ticket close permission; missing body, invalid id, missing ticket, unsupported extended schema checks, storage errors, chat synchronization errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
id Int64 Required Ticket ID.
resolved_date Int64 Optional Closing date as Unix time in seconds. If omitted, the current time is used.

Request Example

{
  "id": 610,
  "resolved_date": 1773142200
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Update Update operation result.

Response Example

{
  "ok": true,
  "result": {
    "row_affected": 1,
    "ids": [
      610
    ]
  }
}