> ## Documentation Index
> Fetch the complete documentation index at: https://docs.curator.interworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending Data to Webhooks

> Configure Data Manager to automatically send collected data to external systems via webhook integrations.

When using mark commenting, you have the option to send the metadata to a webhook. This features allows you to send
mark commenting data to any webhook endpoint, instead of Data Manager.

To enable this feature,

1. Login to the backend of your Curator instance (e.g. `http://curatorexample.com/backend`).
2. Navigate to the **Settings** > **Portal Settings** > **Features** section from the left-hand menu.
3. Enable "Integration Automation" in the Functionality Section.
4. Save and refresh the page.
5. Navigate to **Integrations** > **Automation** > **API Relay** section from the left-hand menu.
6. Create a new API Relay. Use the webhook endpoint as the URL field.
7. "Outgoing Request Content" and "Incoming Request Validation" can be edited as needed for more complex webhook usage.
8. Once an API Relay is created, it needs to be selected for the necessary Data Group. For more information on Data
   Manager, take a look [here](/embedding_using_analytics/data_manager/data_manager_basics).
9. Visit **Data Manager** > **Data Groups** and select the necessary Data Group. Enable "Send to Webhook" and select
   the appropriate API Relay from the dropdown.
10. (Optional) Configure the **Allow Multiple Marks** toggle on the Data Group — see the section below for
    behavior details.
11. Visit **Tableau** > **Dashboards** and select the Dashboard you wish to enable. In the
    "Mark Commenting" tab, now select the Data Manager Group you wish to use (from step 9).
12. Data from the Data Manager Group form will now be sent to the webhook provided.

## Allow Multiple Marks

Each Data Group has an **Allow Multiple Marks** toggle (Data Manager > Data Groups > \[your group]) that
controls how the mark commenting form behaves when a viewer selects more than one mark on a Dashboard.

* **Default for all Data Groups: OFF.** Newly-created groups start with multiple-mark capture disabled, and
  Data Groups that existed before this feature was added are also OFF, so existing webhook integrations keep
  their original payload shape until an admin opts in.

When the toggle is **OFF**, only the most recently selected mark is captured — selecting additional marks
replaces the form contents rather than queuing them.

When the toggle is **ON** and a viewer selects multiple marks, the mark commenting modal becomes paginated: one
form per mark, with **Previous** / **Next** arrows and a `N of M` counter in the header. Each mark's form
fields are independent, so the viewer can enter different values per mark before submitting. Submitting
sends all marks in a single request.

## Webhook Payload Shape

The body sent to the webhook is the raw form submission (`Input::all()` from the request). Two fields drive
the integrator-facing shape: `metadata` and the per-attribute `attribute-{group_id}-{attribute_id}…` fields.

**Single mark** (or multi-mark toggle OFF):

* `metadata` is a JSON-encoded **object** — the captured Tableau field/value pairs for that one mark, plus
  `page_url`, `username`, `timestamp`.
* Each attribute is sent as `attribute-{group_id}-{attribute_id}` (no mark suffix).

**Multi-mark** (toggle ON, viewer selected more than one mark):

* `metadata` is a JSON-encoded **array** — one entry per selected mark, each entry shaped the same as the
  single-mark `metadata` object above (with an added `mark_index`).
* Each attribute is sent as `attribute-{group_id}-{attribute_id}-mark-N` where `N` is the zero-based mark
  index. Integrators consuming the webhook need to iterate the array (and/or the suffixed fields) rather
  than expecting a single object.

If you have an existing webhook endpoint and you enable **Allow Multiple Marks** on its Data Group, update
the endpoint to accept both shapes (or branch on whether `metadata` parses as an array vs. an object) before
turning the toggle on.
