# List all macros

`GET /macros`

> This is a subset of the full specification, limited to the `GET /macros` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.16/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.16'
  description: This is a subset of the full specification, limited to the `GET /macros` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Macros
    description: Operations related to saved replies (macros) in conversations
    x-displayName: Macros
paths:
  /macros:
    get:
      summary: List all macros
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: per_page
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 150
            default: 50
          description: The number of results per page
          example: 50
        - name: starting_after
          in: query
          schema:
            type: string
          description: Base64-encoded cursor containing [updated_at, id] for pagination
          example: WzE3MTk0OTM3NTcuMCwgIjEyMyJd
        - name: updated_since
          in: query
          schema:
            type: integer
            format: int64
          description: Unix timestamp to filter macros updated after this time
          example: 1719474966
      tags:
        - Macros
      operationId: listMacros
      description: |
        You can fetch a list of all macros (saved replies) in your workspace for use in automating responses.

        The macros are returned in descending order by updated_at.

        **Pagination**

        This endpoint uses cursor-based pagination via the `starting_after` parameter. The cursor is a Base64-encoded JSON array containing `[updated_at, id]` of the last item from the previous page.

        **Placeholder Transformation**

        The API transforms Intercom placeholders to a more standard XML-like format:
        - From: `{{user.name | fallback: 'there'}}`
        - To: `<attribute key="user.name" default="there"/>`
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              examples:
                basic_list:
                  summary: Basic list of macros
                  value:
                    type: list
                    data:
                      - type: macro
                        id: '123'
                        name: Order Status Update
                        body: '<p>Hi <attribute key="user.name" default="there"/>, your order #<attribute key="order.number"/> is ready for pickup!</p>'
                        body_text: 'Hi {{user.name|fallback:"there"}}, your order #{{order.number}} is ready for pickup!'
                        created_at: '2025-07-17T11:18:08.000Z'
                        updated_at: '2025-07-17T15:30:24.000Z'
                        visible_to: everyone
                        visible_to_team_ids: []
                        available_on:
                          - inbox
                          - messenger
                      - type: macro
                        id: '456'
                        name: Welcome Message
                        body: <p>Welcome to our support! I'm <attribute key="teammate.name"/>. How can I help you today?</p>
                        body_text: Welcome to our support! I'm {{teammate.name}}. How can I help you today?
                        created_at: '2025-07-21T14:44:35.000Z'
                        updated_at: '2025-07-21T14:44:35.000Z'
                        visible_to: specific_teams
                        visible_to_team_ids:
                          - '789'
                          - '101'
                        available_on:
                          - inbox
                    pages:
                      type: pages
                      per_page: 50
                      next:
                        starting_after: WzE3MTk0OTM3NTcuMCwgIjEyMyJd
                pagination_with_cursor:
                  summary: Paginated response using starting_after cursor
                  value:
                    type: list
                    data:
                      - type: macro
                        id: '789'
                        name: Refund Process
                        body: '<p>I understand you''d like a refund for order #<attribute key="conversation.custom_attributes.order_number"/>. The refund will be processed within 3-5 business days.</p>'
                        body_text: 'I understand you''d like a refund for order #{{conversation.custom_attributes.order_number}}. The refund will be processed within 3-5 business days.'
                        created_at: '2025-07-21T07:15:34.000Z'
                        updated_at: '2025-07-21T07:15:34.000Z'
                        visible_to: everyone
                        visible_to_team_ids: []
                        available_on:
                          - inbox
                          - messenger
                      - type: macro
                        id: '101'
                        name: Product Inquiry Response
                        body: <p>Thank you for your interest in <attribute key="product.name" default="our products"/>. I'd be happy to provide more information!</p>
                        body_text: Thank you for your interest in {{product.name|fallback:"our products"}}. I'd be happy to provide more information!
                        created_at: '2025-07-20T05:33:20.000Z'
                        updated_at: '2025-07-21T10:00:00.000Z'
                        visible_to: everyone
                        visible_to_team_ids: []
                        available_on:
                          - inbox
                          - messenger
                    pages:
                      type: pages
                      per_page: 50
                      next:
                        starting_after: WzE3MTk0MDAwMDAuMCwgIjEwMSJd
                filtered_by_timestamp:
                  summary: Macros filtered by updated_since parameter
                  value:
                    type: list
                    data:
                      - type: macro
                        id: '234'
                        name: Shipping Update Template
                        body: '<p>Your order has been shipped via <attribute key="shipping.carrier" default="our shipping partner"/>. Tracking number: <attribute key="shipping.tracking_number"/></p>'
                        body_text: 'Your order has been shipped via {{shipping.carrier|fallback:"our shipping partner"}}. Tracking number: {{shipping.tracking_number}}'
                        created_at: '2025-07-22T05:31:01.000Z'
                        updated_at: '2025-07-22T18:45:12.000Z'
                        visible_to: everyone
                        visible_to_team_ids: []
                        available_on:
                          - inbox
                    pages:
                      type: pages
                      per_page: 50
                      next: null
                complex_placeholders:
                  summary: Macros with various placeholder formats
                  value:
                    type: list
                    data:
                      - type: macro
                        id: '567'
                        name: Account Status Review
                        body: '<p>Hi <attribute key="user.first_name" default="there"/>,</p><p>Your account status: <attribute key="user.custom_attributes.account_status" default="pending review"/></p><p>Last activity: <attribute key="user.last_seen_at"/></p>'
                        body_text: |-
                          Hi {{user.first_name|fallback:"there"}},

                          Your account status: {{user.custom_attributes.account_status|fallback:"pending review"}}

                          Last activity: {{user.last_seen_at}}
                        created_at: '2025-07-21T09:00:00.000Z'
                        updated_at: '2025-07-21T09:00:00.000Z'
                        visible_to: specific_teams
                        visible_to_team_ids:
                          - security_team
                        available_on:
                          - inbox
                    pages:
                      type: pages
                      per_page: 50
                      next: null
                empty_result:
                  summary: Empty macro list (no macros or all filtered out)
                  value:
                    type: list
                    data: []
                    pages:
                      type: pages
                      per_page: 50
                      next: null
                large_list_preview:
                  summary: Large list with performance optimization
                  value:
                    type: list
                    data:
                      - type: macro
                        id: '1001'
                        name: Quick Response 1
                        body: null
                        body_text: null
                        created_at: '2025-07-22T11:08:20.000Z'
                        updated_at: '2025-07-23T11:08:20.000Z'
                        visible_to: everyone
                        visible_to_team_ids: []
                        available_on:
                          - inbox
                    pages:
                      type: pages
                      per_page: 50
                      next:
                        starting_after: WzE3MTk0OTAxMDAuMCwgIjEwMDIiXQ==
              schema:
                $ref: '#/components/schemas/macro_list'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Invalid parameter:
                  value:
                    type: error.list
                    request_id: bc300b1a-492a-405f-924e-a5881cb72e3a
                    errors:
                      - code: parameter_invalid
                        message: Invalid updated_since timestamp
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: e097e446-9ae6-44a8-8e13-2bf3008b87ef
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden - missing required OAuth scope
          content:
            application/json:
              examples:
                Missing required scope:
                  summary: OAuth token lacks read_conversations scope
                  value:
                    type: error.list
                    request_id: f097e446-9ae6-44a8-8e13-2bf3008b87ef
                    errors:
                      - code: forbidden
                        message: You do not have the required scope (read_conversations) to access this resource
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              field:
                type: string
                nullable: true
                description: Optional. Used to identify a particular field or query parameter that was in error.
                example: email
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>By default, it's equal to the version set in the app package.
      type: string
      example: '2.16'
      default: '2.16'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - '2.13'
        - '2.14'
        - '2.15'
        - '2.16'
    macro:
      title: Macro
      type: object
      x-tags:
        - Macros
      description: A macro is a pre-defined response template (saved reply) that can be used to quickly reply to conversations.
      nullable: true
      properties:
        type:
          type: string
          description: String representing the object's type. Always has the value `macro`.
          enum:
            - macro
          example: macro
        id:
          type: string
          description: The unique identifier for the macro.
          example: '123'
        name:
          type: string
          description: The name of the macro.
          example: Order Status Update
        body:
          type: string
          description: The body of the macro in HTML format with placeholders transformed to XML-like format.
          example: <p>Hi <attribute key="user.name" default="there"/>, your order is ready!</p>
        body_text:
          type: string
          description: The plain text version of the macro body with original Intercom placeholder format.
          example: Hi {{user.name|fallback:"there"}}, your order is ready!
        created_at:
          type: string
          format: date-time
          description: The time the macro was created in ISO 8601 format.
          example: '2025-07-17T11:18:08.000Z'
        updated_at:
          type: string
          format: date-time
          description: The time the macro was last updated in ISO 8601 format.
          example: '2025-07-17T15:30:24.000Z'
        visible_to:
          type: string
          description: Who can view this macro.
          enum:
            - everyone
            - specific_teams
          example: everyone
        visible_to_team_ids:
          type: array
          description: The team IDs that can view this macro when visible_to is set to specific_teams.
          items:
            type: string
          example:
            - '456'
            - '789'
        available_on:
          type: array
          description: Where the macro is available for use.
          items:
            type: string
            enum:
              - inbox
              - messenger
          example:
            - inbox
            - messenger
    macro_list:
      title: Macro List
      type: object
      x-tags:
        - Macros
      description: A paginated list of macros (saved replies) in the workspace.
      properties:
        type:
          type: string
          description: Always list
          enum:
            - list
          example: list
        data:
          type: array
          description: The list of macro objects
          items:
            $ref: '#/components/schemas/macro'
        pages:
          type: object
          description: Pagination information
          properties:
            type:
              type: string
              description: The type of pagination
              enum:
                - pages
              example: pages
            per_page:
              type: integer
              description: Number of results per page
              example: 50
            next:
              type: object
              nullable: true
              description: Cursor for the next page
              properties:
                starting_after:
                  type: string
                  description: Base64-encoded cursor containing [updated_at, id] for pagination
                  example: WzE3MTk0OTM3NTcuMCwgIjEyMyJd
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
