Skip to content

Create a macro

Request

You can create a macro in your workspace, choose who can see it, and add actions that run on the conversation when a teammate uses it.

Send the content as either body or blocks, not both. body takes the same HTML that Retrieve a macro returns, including <attribute key="..." default="..."/> placeholders, so you can copy a macro by sending its body back unchanged. If the HTML holds content that a macro can't store as written, such as a horizontal rule, the request fails with an unsupported_html error and no macro is created.

The access token must belong to a teammate who can manage and create macros. OAuth tokens must have the read_write_macros scope.

Security
bearerAuth
Headers
Intercom-Versionstring(intercom_version_preview)

Preview Intercom API version. Used for closed beta endpoints or other features under managed availability.

Default:"Preview"
Value:"Preview"
Example:Preview
Bodyapplication/jsonrequired

The macro to create. Send either body or blocks, not both.

namestring, <= 140 charactersrequired

The name of the macro.

Example:"Password reset"
bodystring

The content of the macro as HTML, in the format the macro's body field returns. Write placeholders as <attribute key="first_name" default="there"/>. Up to 20,480 bytes.

Example:"<p>Hi <attribute key=\"first_name\" default=\"there\"/>, your order is on its way.</p>"
blocksarray of objects(Macro Block)

The content of the macro as blocks. Up to 64 KB once serialized.

Example:
[ { "type": "paragraph", "text": "Hi {{first_name | fallback: \"there\"}}, you can reset your password from the sign-in page." } ]
visible_tostring

Who can view the macro.

Default:"everyone"
Enum:"everyone""specific_teams"
Example:"specific_teams"
visible_to_team_idsarray of strings

The team IDs that can view the macro. Required when visible_to is specific_teams. Each team must belong to your workspace.

Example:
[ "123456" ]
actionsarray of objects(Macro Action)

The actions applied to the conversation when a teammate uses the macro.

Example:
[ { "type": "add-tag-to-conversation", "data": { … } } ]
curl -i -X POST \
  https://api.intercom.io/macros \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Intercom-Version: Preview' \
  -d '{
    "name": "Password reset",
    "visible_to": "specific_teams",
    "visible_to_team_ids": [
      "123456"
    ],
    "blocks": [
      {
        "type": "paragraph",
        "text": "Hi {{first_name | fallback: \"there\"}}, you can reset your password from the sign-in page."
      }
    ],
    "actions": [
      {
        "type": "add-tag-to-conversation",
        "data": {
          "tag_id": "7890"
        }
      },
      {
        "type": "snooze-conversation",
        "data": {
          "snoozed_until": "hours",
          "selected_hours": 4
        }
      }
    ]
  }'

Responses

Macro created

Bodyapplication/json

A macro is a pre-defined response template (saved reply) that can be used to quickly reply to conversations.

typestring

String representing the object's type. Always has the value macro.

Value:"macro"
Example:"macro"
idstring

The unique identifier for the macro.

Example:"123"
namestring

The name of the macro.

Example:"Order Status Update"
bodystring

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_textstring

The plain text version of the macro body with original Intercom placeholder format.

Example:"Hi {{user.name|fallback:\"there\"}}, your order is ready!"
created_atstring, (date-time)

The time the macro was created in ISO 8601 format.

Example:"2025-07-17T11:18:08.000Z"
updated_atstring, (date-time)

The time the macro was last updated in ISO 8601 format.

Example:"2025-07-17T15:30:24.000Z"
visible_tostring

Who can view this macro.

Enum:"everyone""specific_teams"
Example:"everyone"
visible_to_team_idsarray of strings

The team IDs that can view this macro when visible_to is set to specific_teams.

Example:
[ "456", "789" ]
available_onarray of strings

Where the macro is available for use.

Items Enum:"inbox""messenger"
Example:
[ "inbox", "messenger" ]
actionsarray of objects(Macro Action)

The actions applied to the conversation when a teammate uses the macro.

Example:
[ { "type": "add-tag-to-conversation", "data": { … } } ]
Response
{ "type": "macro", "id": "4567", "name": "Password reset", "body": "<p>Hi <attribute key=\"first_name\" default=\"there\"/>, you can reset your password from the sign-in page.</p>", "body_text": "Hi {{first_name | fallback: \"there\"}}, you can reset your password from the sign-in page.", "created_at": "2026-11-02T10:15:00.000Z", "updated_at": "2026-11-02T10:15:00.000Z", "visible_to": "specific_teams", "visible_to_team_ids": [ "123456" ], "available_on": [ "inbox" ], "actions": [ { … }, { … } ] }