Apply macro

Apply a macro to one ticket and save the result.

POST https://cotlet.dev/api/v1/zendesk/tickets/{ticket_id}/macros/{macro_id}/apply

write Confirm

Applies the macro's actions to the ticket: it can set fields, add tags and insert a comment, then saves the ticket. The response lists what changed. A macro that adds a public comment emails the requester. If the macro changes a field that is not on the ticket form, or your user lacks permission for the change, that action does not happen. If the ticket changed in the meantime, the call fails and asks you to read the ticket again. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: apply_macro
NameTypeDescription
ticket_id integer required integer Ticket ID from search_tickets or list_view_tickets.
macro_id integer required integer Macro ID from list_macros.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/zendesk/tickets/48177/macros/360011204873/apply \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("zendesk", "apply_macro", {"ticket_id":48177,"macro_id":360011204873})
Node.js
const result = await cotlet.call('zendesk', 'apply_macro', {"ticket_id":48177,"macro_id":360011204873});
CLI
cotlet call zendesk apply_macro --data '{"ticket_id":48177,"macro_id":360011204873}'

Example response

JSON

{
  "ticket_id": 48177,
  "macro": {
    "macro_id": 360011204873,
    "title": "Downgrade and inform"
  },
  "changes": {
    "priority": "low"
  },
  "comment": {
    "public": true,
    "body": "Thanks for the idea. We have lowered the priority of your request to low, so it may take longer to get to."
  },
  "updated_at": "2026-10-16T09:03:00Z"
}

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.