Macros

List Macros

Retrieve list of macros.

GET/workspaces/{workspaceId}/macros
Authorization
Path parameters
workspaceId*string
Query parameters
Response

OK

Body
results*array of Macro (object)
nextPageTokenstring

The token that can be passed as pageToken in URL to retrieve the next set of results. If missing, no more results to display.

Request
const response = await fetch('/workspaces/{workspaceId}/macros', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "results": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "response": {
        "type": "text",
        "text": {
          "text": "text",
          "attachments": [
            {
              "mediaUrl": "https://example.com",
              "filename": "text",
              "inline": false
            }
          ],
          "actions": [
            {
              "type": "link",
              "link": {
                "text": "text",
                "url": "text"
              }
            }
          ],
          "metadata": {
            "subject": "text",
            "whatsapp": {
              "previewUrl": false
            },
            "line": {
              "emoji": {
                "items": [
                  {
                    "productId": "text",
                    "emojiId": "text"
                  }
                ]
              }
            }
          }
        }
      },
      "language": "text",
      "tags": [
        {
          "id": "123e4567-e89b-12d3-a456-426614174000",
          "name": "text",
          "description": "text",
          "status": "draft",
          "category": {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "name": "text",
            "description": "text",
            "emoji": "text",
            "createdAt": "text",
            "updatedAt": "text"
          },
          "createdAt": "text",
          "updatedAt": "text",
          "deletedAt": "text",
          "lastUsed": {
            "addedToItemAt": "text",
            "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
            "removedFromItemAt": "text",
            "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
          }
        }
      ],
      "createdAt": "2024-10-18T03:22:20.403Z",
      "updatedAt": "2024-10-18T03:22:20.403Z",
      "actions": [
        {
          "type": "text",
          "source": {
            "macroId": "123e4567-e89b-12d3-a456-426614174000",
            "actionId": "123e4567-e89b-12d3-a456-426614174000"
          },
          "outcome": "OK",
          "cause": "text"
        }
      ]
    }
  ],
  "nextPageToken": "text"
}

Create Macro

Add a new macro to a workspace.

POST/workspaces/{workspaceId}/macros
Authorization
Path parameters
workspaceId*string
Body
name*string

The user-defined display name of the macro.

responseMessageBody
languagestring (locale-bcp47)

The optional user-defined language of the macro.

tagIdsarray of string (uuid)

The list of tag IDs to associate with the macro.

actionsMacroActions (array of MacroAction (object))

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

Response

Successfully created

Body
id*string (uuid)
name*string

The user-defined display name of the macro.

responseMessageBody
languagestring (locale-bcp47)

The optional user-defined language of the macro.

usageCountinteger
tagsarray of Tag (object)
createdAt*string (date-time)
updatedAt*string (date-time)
actionsMacroActions (array of MacroAction (object))

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

Request
const response = await fetch('/workspaces/{workspaceId}/macros', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "text"
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": false
        }
      ],
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "metadata": {
        "subject": "text",
        "whatsapp": {
          "previewUrl": false
        },
        "line": {
          "emoji": {
            "items": [
              {
                "productId": "text",
                "emojiId": "text"
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "status": "draft",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text"
      },
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "createdAt": "2024-10-18T03:22:20.403Z",
  "updatedAt": "2024-10-18T03:22:20.403Z",
  "actions": [
    {
      "type": "text",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "outcome": "OK",
      "cause": "text"
    }
  ]
}

Get Macro

Retrieve information about a specific macro.

GET/workspaces/{workspaceId}/macros/{macroId}
Authorization
Path parameters
workspaceId*string
macroId*string (uuid)

Macro UUID

Response

ok

Body
id*string (uuid)
name*string

The user-defined display name of the macro.

responseMessageBody
languagestring (locale-bcp47)

The optional user-defined language of the macro.

usageCountinteger
tagsarray of Tag (object)
createdAt*string (date-time)
updatedAt*string (date-time)
actionsMacroActions (array of MacroAction (object))

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

Request
const response = await fetch('/workspaces/{workspaceId}/macros/{macroId}', {
    method: 'GET',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": false
        }
      ],
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "metadata": {
        "subject": "text",
        "whatsapp": {
          "previewUrl": false
        },
        "line": {
          "emoji": {
            "items": [
              {
                "productId": "text",
                "emojiId": "text"
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "status": "draft",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text"
      },
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "createdAt": "2024-10-18T03:22:20.403Z",
  "updatedAt": "2024-10-18T03:22:20.403Z",
  "actions": [
    {
      "type": "text",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "outcome": "OK",
      "cause": "text"
    }
  ]
}

Update Macro

Modify fields of a specific macro.

PATCH/workspaces/{workspaceId}/macros/{macroId}
Authorization
Path parameters
workspaceId*string
macroId*string (uuid)

Macro UUID

Body
namenullable string

The user-defined display name of the macro.

responseMessageBody
languagenullable string (locale-bcp47)

The optional user-defined language of the macro.

tagIdsarray of string (uuid)

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

actionsMacroActions (array of MacroAction (object))

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

Response

Successfully updated

Body
id*string (uuid)
name*string

The user-defined display name of the macro.

responseMessageBody
languagestring (locale-bcp47)

The optional user-defined language of the macro.

usageCountinteger
tagsarray of Tag (object)
createdAt*string (date-time)
updatedAt*string (date-time)
actionsMacroActions (array of MacroAction (object))

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

Request
const response = await fetch('/workspaces/{workspaceId}/macros/{macroId}', {
    method: 'PATCH',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": false
        }
      ],
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "metadata": {
        "subject": "text",
        "whatsapp": {
          "previewUrl": false
        },
        "line": {
          "emoji": {
            "items": [
              {
                "productId": "text",
                "emojiId": "text"
              }
            ]
          }
        }
      }
    }
  },
  "language": "text",
  "tags": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "status": "draft",
      "category": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "text",
        "description": "text",
        "emoji": "text",
        "createdAt": "text",
        "updatedAt": "text"
      },
      "createdAt": "text",
      "updatedAt": "text",
      "deletedAt": "text",
      "lastUsed": {
        "addedToItemAt": "text",
        "addedToItemId": "123e4567-e89b-12d3-a456-426614174000",
        "removedFromItemAt": "text",
        "removedFromItemId": "123e4567-e89b-12d3-a456-426614174000"
      }
    }
  ],
  "createdAt": "2024-10-18T03:22:20.403Z",
  "updatedAt": "2024-10-18T03:22:20.403Z",
  "actions": [
    {
      "type": "text",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "outcome": "OK",
      "cause": "text"
    }
  ]
}

Delete Macro

Remove a specific macro.

DELETE/workspaces/{workspaceId}/macros/{macroId}
Authorization
Path parameters
workspaceId*string
macroId*string (uuid)

Macro UUID

Response

Successfully deleted

Request
const response = await fetch('/workspaces/{workspaceId}/macros/{macroId}', {
    method: 'DELETE',
    headers: {
      "Authorization": "Bearer jwt"
    },
});
const data = await response.json();
Response
{
  "code": "text",
  "message": "text"
}

Get Macro with variable substitutions applied.

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

POST/workspaces/{workspaceId}/macros/{macroId}/preview
Authorization
Path parameters
workspaceId*string
macroId*string (uuid)

Macro UUID

Body
itemIdstring (uuid)

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

contactone of
actionsMacroActions (array of MacroAction (object))

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

Response

ok

Body
responseMessageBody
actionsMacroActions (array of MacroAction (object))

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

Request
const response = await fetch('/workspaces/{workspaceId}/macros/{macroId}/preview', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer jwt",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "response": {
    "type": "text",
    "text": {
      "text": "text",
      "attachments": [
        {
          "mediaUrl": "https://example.com",
          "filename": "text",
          "inline": false
        }
      ],
      "actions": [
        {
          "type": "link",
          "link": {
            "text": "text",
            "url": "text"
          }
        }
      ],
      "metadata": {
        "subject": "text",
        "whatsapp": {
          "previewUrl": false
        },
        "line": {
          "emoji": {
            "items": [
              {
                "productId": "text",
                "emojiId": "text"
              }
            ]
          }
        }
      }
    }
  },
  "actions": [
    {
      "type": "text",
      "source": {
        "macroId": "123e4567-e89b-12d3-a456-426614174000",
        "actionId": "123e4567-e89b-12d3-a456-426614174000"
      },
      "outcome": "OK",
      "cause": "text"
    }
  ]
}

Last updated