POST

Ticket.Status

Change ticket status (dashboard change_status_ticket). System defaults: 1=Opened, 2=Closed, 3=Assigned. Status 2 stores close_date. When closing (status=2) and ticket_completion_reason_settings=1, you must send either a list reason (completion_reason_id) or Add manual text (completion_reason) — same as the dashboard Choose completion reason modal.

Permissions

  • User must be logged in with a valid bearer token.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Updates the requested Ticket record after validating permissions and input fields.

Push Service

Pushes event ticket.status to users who should see this change.

Automation

Runs automation event tickets_status with the record id and submitted parameters after the action succeeds.

Special Instructions

  • Send status as an integer id, not the UI label. Alias for status: value.
  • System defaults: 1 = Opened, 2 = Closed, 3 = Assigned. Custom ids: Statuses.List type=ticket.
  • Completion reason fields apply only when status=2 (Closed).
  • When ticket_completion_reason_settings=1 (Ticket.SettingsGet) and status=2, one of these is required:
  • (A) List reason — send completion_reason_id from Ticket.CompletionReasonList. API fills completion_reason from name_en/name_he if text omitted.
  • (B) Add manual — send non-empty completion_reason text. Store completion_reason_id=0 (omit id or send 0).
  • Missing both returns error completion_reason_required. Invalid list id returns invalid_completion_reason_id.
  • When status actually changes, last_status_time is reset (ticket automation in_status timer). Unchanged status does not touch the timer.
  • When completion reasons are OFF, status=2 closes without requiring a reason (dashboard does not show the modal).
  • Check setting with Ticket.SettingsGet before building close UI.

Required Parameters

NameTypeSampleExplanation
ticket_id
post
int900Ticket id to update. Aliases: id, data_id, t_id.
status
post
int2Status id. 1=Opened, 2=Closed, 3=Assigned. Alias: value.

Optional Parameters

NameTypeSampleWhat it gives
completion_reason_id
post
int10List reason id (dropdown). Required path A on close when setting ON. Use 0 / omit with completion_reason for Add manual.
completion_reason
post
stringCustomer cancelledManual reason text (Add manual). Required path B on close when setting ON if no completion_reason_id. Also auto-filled from list id when only id is sent.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/Ticket.Status",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "ticket_id": "900",
        "status": "2",
        "completion_reason_id": "10"
    },
    "body_manual": {
        "ticket_id": "900",
        "status": "2",
        "completion_reason": "Customer cancelled",
        "completion_reason_id": "0"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/Ticket.Status",
    "url_domain": "https:\/\/{domain}\/app\/Ticket.Status"
}

Endpoint

POST /app/Ticket.Status
POST https://{user}.bull36.com/app/Ticket.Status
POST https://{domain}/app/Ticket.Status

Sample Output

{
    "success": 1,
    "message": "Success",
    "ticket_id": 900,
    "status": 2,
    "completion_reason_id": 10,
    "completion_reason": "first reason",
    "automation_event": "tickets_status",
    "socket_event": "ticket.status"
}

JavaScript Example

const token = 'YOUR TOKEN';
// A) List reason
let body = new URLSearchParams({ ticket_id: '900', status: '2', completion_reason_id: '10' });
// B) Add manual
// body = new URLSearchParams({ ticket_id: '900', status: '2', completion_reason: 'Customer cancelled', completion_reason_id: '0' });
const res = await fetch('/app/Ticket.Status', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
console.log(await res.json());

Error Example

{
    "missing_ticket_or_status": {
        "success": 0,
        "message": "Missing required parameter: ticket_id, status"
    },
    "completion_reason_required": {
        "success": 0,
        "message": "Please select or enter a completion reason",
        "error": "completion_reason_required",
        "required_when": {
            "status": 2,
            "ticket_completion_reason_settings": 1
        },
        "hint": "Send completion_reason_id from Ticket.CompletionReasonList, OR completion_reason text for Add manual (completion_reason_id=0)."
    },
    "invalid_completion_reason_id": {
        "success": 0,
        "message": "Invalid completion_reason_id",
        "error": "invalid_completion_reason_id",
        "completion_reason_id": 999,
        "hint": "Use an id from Ticket.CompletionReasonList, or send completion_reason text for Add manual (id=0)."
    }
}