Apply macro
Apply one of your macros to a ticket.
POST https://cotlet.dev/api/v1/gorgias/tickets/{ticket_id}/macro/apply
write Confirm
Runs the macro as an agent would: its reply text goes to the customer and its actions, such as tags, status and assignee, run in the order the macro lists them. Variables in the text are filled from the ticket. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| ticket_id integer required | integer | Ticket ID from search_tickets. |
| macro string required | string | Macro name or macro_id from list_macros. |
| close_ticket boolean | boolean | Use Apply macro and close. Default: false. |
Request
curl -X POST https://cotlet.dev/api/v1/gorgias/tickets/10511/macro/apply \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"macro":"Order status","close_ticket":false}' result = client.call("gorgias", "apply_macro", {"ticket_id":10511,"macro":"Order status","close_ticket":False}) const result = await cotlet.call('gorgias', 'apply_macro', {"ticket_id":10511,"macro":"Order status","close_ticket":false}); cotlet call gorgias apply_macro --data '{"ticket_id":10511,"macro":"Order status","close_ticket":false}' Example response
{
"ticket_id": 10511,
"macro": "Order status",
"reply_sent": true,
"actions_run": [
"Add tags",
"Set status"
],
"ticket_status": "open"
}