SetStatus

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

Changes CRM ticket status. Use this workflow method to 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, writes an action log record, 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, database errors, transaction failures and action-log errors are returned as HTTP 200 ErrorResult business errors.

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