Run macro

Apply a macro to a ticket, as the Update menu does.

POST https://cotlet.dev/api/v1/zammad/tickets/{ticket_id}/macro/run

write Confirm

Applies the named macro to the ticket at once and returns the ticket afterwards. A macro can change state, priority, group and owner, add tags and notes, send a notification or run an AI agent, so what happens depends on how your admin built it. If the ticket lacks a required attribute that the macro does not set, Zammad applies none of its actions and the call returns that error. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: run_macro
NameTypeDescription
ticket_id integer required integer Ticket ID from search_tickets, list_overview_tickets or the ticket address (#ticket/zoom/{ticket_id}).
macro string required string Macro name from list_macros.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/zammad/tickets/1/macro/run \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"macro":"macro"}'
Python
result = client.call("zammad", "run_macro", {"ticket_id":1,"macro":"macro"})
Node.js
const result = await cotlet.call('zammad', 'run_macro', {"ticket_id":1,"macro":"macro"});
CLI
cotlet call zammad run_macro --data '{"ticket_id":1,"macro":"macro"}'

Example response

JSON

{
  "ticket_id": 4830,
  "macro": "Close & Tag as Spam",
  "state": "closed",
  "owner": "Nora Weiss",
  "tags": [
    "spam"
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.