---
updatedAt: 2026-04-20T19:43:50.000Z
agentTools:
  projectIndex: https://developers.gorgias.com/llms.txt
---

# List macros

# OpenAPI definition

```json
{
  "security": [
    {
      "basicAuth": []
    }
  ],
  "info": {
    "description": "The Gorgias REST API. Please go to https://developers.gorgias.com for more details.",
    "title": "Gorgias REST API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://{domain}.gorgias.com",
      "variables": {
        "domain": {
          "default": "your-domain"
        }
      }
    }
  ],
  "x-readme": {
    "proxy-enabled": false
  },
  "paths": {
    "/api/macros": {
      "get": {
        "summary": "List macros",
        "operationId": "list-macros",
        "parameters": [
          {
            "in": "query",
            "name": "tags",
            "schema": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Filter macros containing all tags in the given list."
              }
            },
            "required": false,
            "explode": true,
            "style": "form"
          },
          {
            "in": "query",
            "name": "languages",
            "schema": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Filter macros containing any language in the list."
              }
            },
            "required": false,
            "explode": true,
            "style": "form"
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Value indicating your position in the list of all tags. If omitted, the first tags of the list will be returned.",
            "schema": {
              "type": "string",
              "example": "cHJldl9fNl9fMjAyMS0wMy0wMyAwNjowMDowMA=="
            },
            "required": false
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Maximum number of tags to return.",
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 1,
              "maximum": 100
            },
            "required": false
          },
          {
            "in": "query",
            "name": "message_id",
            "description": "Order macros by the most relevant ones to reply to the given message. When specified, `order_by` must be set to `relevance` and `ticket_id` is required.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "default": null,
              "example": 35893
            },
            "required": false
          },
          {
            "in": "query",
            "name": "order_by",
            "description": "Order macros by the given attribute. If `relevance` is specified, `ticket_id` parameter is required and macros will be ordered by the most relevant macros to reply to the given ticket. In this case, `order_dir` parameter will be ignored.<br>Values <span style={{color: 'red'}}>`name`, `created_datetime`, `update_datetime`, `usage`, `relevance` have been deprecated</span>. Use values with `:asc` or `:desc` instead.",
            "schema": {
              "type": "string",
              "default": "usage",
              "enum": [
                "name",
                "created_datetime",
                "updated_datetime",
                "usage",
                "relevance",
                "language",
                "name:asc",
                "name:desc",
                "created_datetime:asc",
                "created_datetime:desc",
                "updated_datetime:asc",
                "updated_datetime:desc",
                "usage:asc",
                "usage:desc",
                "relevance:asc",
                "relevance:desc",
                "language:asc",
                "language:desc"
              ],
              "example": "usage"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "search",
            "description": "Filter macros containing the given search query.",
            "schema": {
              "type": [
                "string",
                "null"
              ],
              "default": null,
              "example": "order"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "ticket_id",
            "description": "Order macros by the most relevant ones to reply to the given ticket. When specified, `order_by` must be set to `relevance`.",
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "default": null,
              "example": 1482
            },
            "required": false
          },
          {
            "in": "query",
            "name": "number_predictions",
            "description": "Number of relevant macros to return on top of the list.",
            "schema": {
              "type": "integer",
              "default": 0,
              "example": 3
            },
            "required": false
          },
          {
            "in": "query",
            "name": "archived",
            "description": "Filter macros that are archived. If `True`, only archived macros will be returned.",
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "default": false,
              "example": true
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "A list of macros.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Macro"
                  }
                },
                "examples": {
                  "responses": {
                    "value": [
                      {
                        "id": 23453,
                        "external_id": "CUS-324512",
                        "name": "Order status inquiry",
                        "intent": "discount/request",
                        "language": "en",
                        "usage": 58392,
                        "actions": [
                          {
                            "arguments": {
                              "tags": "question, order-status"
                            },
                            "name": "addTags",
                            "title": "add tags",
                            "type": "user"
                          },
                          {
                            "arguments": {
                              "body_html": "<div>Hi {{ticket.customer.firstname}},</div><br><div>Your order has been delivered.</div>",
                              "body_text": "Hi {{ticket.customer.firstname}},\n\nYour order has been delivered."
                            },
                            "name": "setResponseText",
                            "title": "add tags",
                            "type": "user"
                          }
                        ],
                        "created_datetime": "2019-11-23T15:59:41.966927",
                        "updated_datetime": "2020-01-30T11:04:34.345123",
                        "archived_datetime": "2019-11-23T15:59:41.966927",
                        "uri": "/api/macros/23453/"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Macros"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "Macros"
    }
  ],
  "openapi": "3.1.0",
  "components": {
    "schemas": {
      "MacroAction": {
        "type": "object",
        "properties": {
          "arguments": {
            "type": "object",
            "description": "Parameters of the action. These parameters vary according to the name of the action.",
            "example": {
              "tags": "question, order-status"
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Description of what the action does.",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "The name of the action.",
            "example": "addTags"
          },
          "title": {
            "type": "string",
            "description": "The title of the action.",
            "example": "Add tags"
          },
          "type": {
            "type": "string",
            "enum": [
              "system",
              "user"
            ],
            "description": "The type of action.",
            "example": "user"
          }
        },
        "required": [
          "arguments",
          "name",
          "title"
        ],
        "description": "A `MacroAction` is a single operation that can be applied to a ticket. An action can only be part of a [macro](#the-macro-object)."
      },
      "Macro": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID of the macro.",
            "example": 23453
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "External ID of the macro in a foreign system. This field is not used by Gorgias, feel free to set it to your own value.",
            "example": "CUS-324512"
          },
          "name": {
            "type": "string",
            "description": "The name of the Macro. Tips: choose a name that can be easily searched.",
            "example": "Order status inquiry"
          },
          "intent": {
            "type": [
              "string",
              "null"
            ],
            "description": "The intention of the macro should be used for.",
            "example": "discount/request",
            "enum": [
              "discount/request",
              "exchange/request",
              "exchange/status",
              "feedback",
              "order/damaged",
              "order/cancel",
              "order/change",
              "order/wrong",
              "other/no_reply",
              "other/question",
              "other/thanks",
              "product/recommendation",
              "product/question",
              "refund/request",
              "refund/status",
              "return/request",
              "return/status",
              "shipping/change",
              "shipping/delivery-issue",
              "shipping/policy",
              "shipping/status",
              "stock/request",
              "subscription/cancel",
              "subscription/change"
            ]
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "The language of the macro in ISO 639-1 format.",
            "example": "en"
          },
          "usage": {
            "type": "integer",
            "default": 0,
            "readOnly": true,
            "description": "How many times the macro was applied on a ticket.",
            "example": 58392
          },
          "actions": {
            "default": [],
            "description": "A list of [actions](#the-macroaction-object) to be applied on tickets.",
            "example": [
              {
                "arguments": {
                  "tags": "question, order-status"
                },
                "name": "addTags",
                "title": "add tags",
                "type": "user"
              },
              {
                "arguments": {
                  "body_html": "<div>Hi {{ticket.customer.firstname}},</div><br><div>Your order has been delivered.</div>",
                  "body_text": "Hi {{ticket.customer.firstname}},\n\nYour order has been delivered."
                },
                "name": "setResponseText",
                "title": "add tags",
                "type": "user"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MacroAction"
            }
          },
          "created_datetime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the macro was created.",
            "example": "2019-11-23T15:59:41.966927"
          },
          "updated_datetime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the macro was last updated.",
            "example": "2020-01-30T11:04:34.345123"
          },
          "archived_datetime": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the macro was archived.",
            "example": "2019-11-23T15:59:41.966927"
          },
          "uri": {
            "type": "string",
            "readOnly": true,
            "description": "URI of the macro"
          }
        },
        "description": "A macro (canned response) is a list of [actions](#the-macroaction-object) that can be applied to tickets to modify them, and/or reply to them.Macros can be applied manually by agents or automatically by rules.\nFor example, a single macro can add a tag to the ticket, assign an agent to it and send a pre-defined response."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "The username will be the email address of your Gorgias account and the password will be your API key."
      }
    }
  }
}
```