Macros

List Macros

Retrieve list of macros.

get

/workspaces/{workspaceId}/macros

Authorizations
Path parameters
workspaceIdstringrequired
Query parameters
limitinteger · min: 1 · max: 100 · default: 10

Limits the number of results to return

pageTokenstring · max: 8000

Pagination token that keeps of track of the current position in the list

reverseboolean

Order in which to retrieve the results

sortstring · enum · default: createdAt

The field by which to sort macros.

Options: createdAt, updatedAt, name, language
qstring

A full-text search parameter that searches for macros by name, response body, and/or tag name.

languagesstring · locale-bcp47[]

Filter macros by language. Multiple languages are combined with a logical OR.

tagIdsstring · uuid[]

Filter macros by tag IDs. Multiple tag IDs are combined with a logical AND.

Responses
curl -L \
  --url '/workspaces/{workspaceId}/macros' \
  --header 'Authorization: Bearer jwt'
{
  "nextPageToken": "text",
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "response": {
        "type": "text",
        "text": {
          "text": "text",
          "actions": [
            {
              "type": "link",
              "link": {
                "text": "text",
                "url": "text"
              }
            }
          ],
          "attachments": [
            {
              "mediaUrl": "https://example.com",
              "filename": "text",
              "inline": true
            }
          ],
          "metadata": {
            "subject": "text",
            "telegram": {
              "parseMode": "Markdown"
            },
            "headers": {
              "ANY_ADDITIONAL_PROPERTY": "text"
            },
            "whatsapp": {
              "previewUrl": true
            },
            "line": {
              "emoji": {
                "items": [
                  {
                    "index": 1,
                    "productId": "text",
                    "emojiId": "text",
                    "length": 1
                  }
                ]
              }
            }
          }
        }
      },
      "language": "text",
      "usageCount": 1,
      "createdAt": "2025-02-21T18:19:35.013Z",
      "updatedAt": "2025-02-21T18:19:35.013Z",
      "actions": [
        {
          "type": "text",
          "params": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "cause": "text",
          "outcome": "OK",
          "source": {
            "macroId": "123e4567-e89b-12d3-a456-426614174000",
            "actionId": "123e4567-e89b-12d3-a456-426614174000"
          }
        }
      ],
      "tags": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "text",
          "description": "text",
          "category": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "name": "text",
            "description": "text",
            "emoji": "text",
            "createdAt": "text",
            "updatedAt": "text",
            "icon": "none"
          },
          "agentCount": 1,
          "itemCount": 1,
          "macroCount": 1,
          "createdAt": "text",
          "updatedAt": "text",
          "deletedAt": "text",
          "status": "draft",
          "lastUsed": {
            "addedToItemAt": "text",
            "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
            "removedFromItemAt": "text",
            "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
          },
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      ]
    }
  ]
}

Create Macro

Add a new macro to a workspace.

post

/workspaces/{workspaceId}/macros

Authorizations
Path parameters
workspaceIdstringrequired
Body
namestring · min: 1 · max: 255required

The user-defined display name of the macro.

responseMessageBody
languagestring · locale-bcp47

The optional user-defined language of the macro.

actionsobject[]

A list of macro actions to be executed. The order of actions may be changed by the service.

tagIdsstring · uuid[]

The list of tag IDs to associate with the macro.

Responses
curl -L \
  --request POST \
  --url '/workspaces/{workspaceId}/macros' \
  --header 'Authorization: Bearer jwt' \
  --header 'Content-Type: application/json' \
  --data '{"name":"text","response":{"type":"text","text":{"text":"text","actions":[{"type":"link","link":{"text":"text","url":"text"}}],"attachments":[{"mediaUrl":"https://example.com","filename":"text","inline":true}],"metadata":{"subject":"text","telegram":{"parseMode":"Markdown"},"headers":{"ANY_ADDITIONAL_PROPERTY":"text"},"whatsapp":{"previewUrl":true},"line":{"emoji":{"items":[{"index":1,"productId":"text","emojiId":"text","length":1}]}}}}},"actions":[{"type":"text","params":{"ANY_ADDITIONAL_PROPERTY":"anything"},"cause":"text","outcome":"OK","source":{"macroId":"123e4567-e89b-12d3-a456-426614174000","actionId":"123e4567-e89b-12d3-a456-426614174000"}}],"tagIds":[null]}'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": true
        }
      ],
      "metadata": {
        "subject": "text",
        "telegram": {
          "parseMode": "Markdown"
        },
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "whatsapp": {
          "previewUrl": true
        },
        "line": {
          "emoji": {
            "items": [
              {
                "index": 1,
                "productId": "text",
                "emojiId": "text",
                "length": 1
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "usageCount": 1,
  "createdAt": "2025-02-21T18:19:35.013Z",
  "updatedAt": "2025-02-21T18:19:35.013Z",
  "actions": [
    {
      "type": "text",
      "params": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "cause": "text",
      "outcome": "OK",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text",
        "icon": "none"
      },
      "agentCount": 1,
      "itemCount": 1,
      "macroCount": 1,
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "status": "draft",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}

Get Macro

Retrieve information about a specific macro.

get

/workspaces/{workspaceId}/macros/{macroId}

Authorizations
Path parameters
workspaceIdstringrequired
macroIdstring · uuidrequired

Macro UUID

Responses
curl -L \
  --url '/workspaces/{workspaceId}/macros/{macroId}' \
  --header 'Authorization: Bearer jwt'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": true
        }
      ],
      "metadata": {
        "subject": "text",
        "telegram": {
          "parseMode": "Markdown"
        },
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "whatsapp": {
          "previewUrl": true
        },
        "line": {
          "emoji": {
            "items": [
              {
                "index": 1,
                "productId": "text",
                "emojiId": "text",
                "length": 1
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "usageCount": 1,
  "createdAt": "2025-02-21T18:19:35.013Z",
  "updatedAt": "2025-02-21T18:19:35.013Z",
  "actions": [
    {
      "type": "text",
      "params": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "cause": "text",
      "outcome": "OK",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text",
        "icon": "none"
      },
      "agentCount": 1,
      "itemCount": 1,
      "macroCount": 1,
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "status": "draft",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}

Update Macro

Modify fields of a specific macro.

patch

/workspaces/{workspaceId}/macros/{macroId}

Authorizations
Path parameters
workspaceIdstringrequired
macroIdstring · uuidrequired

Macro UUID

Body
namestring · min: 1 · max: 255 | nullable

The user-defined display name of the macro.

responseMessageBody
languagestring · locale-bcp47 | nullable

The optional user-defined language of the macro.

actionsobject[]

A list of macro actions to be executed. The order of actions may be changed by the service.

tagIdsstring · uuid[]

The list of tag IDs to associate with the macro. An empty list will remove all tags.

Responses
curl -L \
  --request PATCH \
  --url '/workspaces/{workspaceId}/macros/{macroId}' \
  --header 'Authorization: Bearer jwt' \
  --header 'Content-Type: application/json' \
  --data '{"response":{"type":"text","text":{"text":"text","actions":[{"type":"link","link":{"text":"text","url":"text"}}],"attachments":[{"mediaUrl":"https://example.com","filename":"text","inline":true}],"metadata":{"subject":"text","telegram":{"parseMode":"Markdown"},"headers":{"ANY_ADDITIONAL_PROPERTY":"text"},"whatsapp":{"previewUrl":true},"line":{"emoji":{"items":[{"index":1,"productId":"text","emojiId":"text","length":1}]}}}}},"actions":[{"type":"text","params":{"ANY_ADDITIONAL_PROPERTY":"anything"},"cause":"text","outcome":"OK","source":{"macroId":"123e4567-e89b-12d3-a456-426614174000","actionId":"123e4567-e89b-12d3-a456-426614174000"}}],"tagIds":[null]}'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": true
        }
      ],
      "metadata": {
        "subject": "text",
        "telegram": {
          "parseMode": "Markdown"
        },
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "whatsapp": {
          "previewUrl": true
        },
        "line": {
          "emoji": {
            "items": [
              {
                "index": 1,
                "productId": "text",
                "emojiId": "text",
                "length": 1
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "usageCount": 1,
  "createdAt": "2025-02-21T18:19:35.013Z",
  "updatedAt": "2025-02-21T18:19:35.013Z",
  "actions": [
    {
      "type": "text",
      "params": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "cause": "text",
      "outcome": "OK",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text",
        "icon": "none"
      },
      "agentCount": 1,
      "itemCount": 1,
      "macroCount": 1,
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "status": "draft",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ]
}

Delete Macro

Remove a specific macro.

delete

/workspaces/{workspaceId}/macros/{macroId}

Authorizations
Path parameters
workspaceIdstringrequired
macroIdstring · uuidrequired

Macro UUID

Responses
curl -L \
  --request DELETE \
  --url '/workspaces/{workspaceId}/macros/{macroId}' \
  --header 'Authorization: Bearer jwt'

No body

Get Macro with variable substitutions applied.

Retrieves the macro with variable substitutions applied to the response body.

post

/workspaces/{workspaceId}/macros/{macroId}/preview

Authorizations
Path parameters
workspaceIdstringrequired
macroIdstring · uuidrequired

Macro UUID

Body
itemIdstring · uuid

The ID of the feed item to source variables from. May be omitted where no feed item exists.

contactIdstring · uuidDeprecated

The ID of the contact to source variables from. If not provided, the macro will attempt to find a contact from the feed item.

actionsobject[]

A list of macro actions to be executed. The order of actions may be changed by the service.

contactone of
Responses
curl -L \
  --request POST \
  --url '/workspaces/{workspaceId}/macros/{macroId}/preview' \
  --header 'Authorization: Bearer jwt' \
  --header 'Content-Type: application/json' \
  --data '{"actions":[{"type":"text","params":{"ANY_ADDITIONAL_PROPERTY":"anything"},"cause":"text","outcome":"OK","source":{"macroId":"123e4567-e89b-12d3-a456-426614174000","actionId":"123e4567-e89b-12d3-a456-426614174000"}}],"contact":{"id":"123e4567-e89b-12d3-a456-426614174000"}}'
{
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": true
        }
      ],
      "metadata": {
        "subject": "text",
        "telegram": {
          "parseMode": "Markdown"
        },
        "headers": {
          "ANY_ADDITIONAL_PROPERTY": "text"
        },
        "whatsapp": {
          "previewUrl": true
        },
        "line": {
          "emoji": {
            "items": [
              {
                "index": 1,
                "productId": "text",
                "emojiId": "text",
                "length": 1
              }
            ]
          }
        }
      }
    }
  },
  "actions": [
    {
      "type": "text",
      "params": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "cause": "text",
      "outcome": "OK",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ]
}

Last updated

Was this helpful?