SetStatus

[POST] .../v1/ticket/setstatus

Changes CRM ticket status. Move a ticket between Open, WaitingClient and WaitingStaff states or send Closed to use the same close flow as Ticket/Close. The method validates status, prevents reopening into an active state when another active ticket already exists for the same client and channel, updates status and waiting-client metadata, resets resolved_date for active states, synchronizes the linked chat open state, recalculates SLA, sends TicketStatusSet and SLA webhooks and returns row_affected with the ticket id. The request body is required; id must be positive and status must not be Default. Passing Closed delegates to Ticket/Close with the current server time as resolved_date. The caller must have CRM ticket edit/status-set permission; missing body, invalid id or status, missing ticket, active duplicate ticket conflicts, storage errors are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
id Int64 Required Ticket ID.
status String Required New status: Open, Closed, WaitingClient or WaitingStaff. Allowed values: Default, Open, Closed, WaitingClient, WaitingStaff.

Request Example

{
  "id": 610,
  "status": "WaitingClient"
}

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
    ]
  }
}