Docs Blog Sign in

Macros

Macros are reusable action templates that agents apply to tickets with a single click. They can set fields, add tags, and attach files.

The macro object

AttributeTypeDescription
idstringUnique identifier
namestringMacro name (max 128 characters)
descriptionstring | nullDescription (max 512 characters)
scopestringpersonal or workspace
ownerIdstringCreator’s user ID
isActivebooleanWhether the macro is active
ruleobjectAction definition (see below)
createdAtstringCreation time (ISO 8601 UTC)

Rule format

{
  "actions": [
    { "field": "status", "action": "set", "value": "pending" },
    { "field": "tags", "action": "add", "value": ["needs-info"] },
    { "field": "priority", "action": "set", "value": "high" }
  ]
}

Action types

ActionDescription
setSet the field to the specified value
addAdd values (used for array fields like tags)
removeRemove values (used for array fields like tags)

List macros

GET /helpdesk/api/macros

Returns personal macros for the current user and all workspace macros.

Create a macro

POST /helpdesk/api/macros

Requires agent role or above.

Request body

{
  "name": "Close as resolved",
  "description": "Set status to resolved and add resolved tag",
  "scope": "workspace",
  "isActive": true,
  "rule": {
    "actions": [
      { "field": "status", "action": "set", "value": "resolved" },
      { "field": "tags", "action": "add", "value": ["resolved"] }
    ]
  }
}

Update a macro

PUT /helpdesk/api/macros/:macroId

Delete a macro

DELETE /helpdesk/api/macros/:macroId

Apply a macro

POST /helpdesk/api/macros/:macroId/apply

Applies the macro’s actions to a ticket.

Request body

{ "ticket_id": "tkt_abc123" }

Returns the updated ticket. Emits real-time WebSocket updates for the ticket.