Skip to content

Create Macro Request

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": { … } } ]
{ "name": "Password reset", "body": "<p>Hi <attribute key=\"first_name\" default=\"there\"/>, your order is on its way.</p>", "blocks": [ { … } ], "visible_to": "specific_teams", "visible_to_team_ids": [ "123456" ], "actions": [ { … } ] }