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

# Embedded forms

> Drop a native subscribe form on any website and route submissions into Senderz.

Embedded forms let any website — not just a connected store — collect subscribers into Senderz. Add a form to your page, include the Senderz script, and submissions upsert contacts and enrol welcome flows.

## Install

<Steps>
  <Step title="Copy the snippet">
    From **Settings → Embedded Forms**, copy the install snippet. It's built
    from your active API key and workspace ID.
  </Step>

  <Step title="Add the form markup">
    Add a form with the Senderz data attributes to your page:

    ```html theme={null}
    <form data-senderz-form data-tenant="YOUR_WORKSPACE_ID" data-key="YOUR_API_KEY">
      <input type="email" name="email" required />
      <input type="tel" name="phone" />
      <button type="submit">Subscribe</button>
    </form>
    <script src="https://senderz.app/forms/senderz-form.js" async></script>
    ```
  </Step>

  <Step title="Set an origin allowlist">
    In the same settings section, add the origins allowed to submit. An empty
    list accepts from anywhere; a configured list rejects other origins with
    403\.
  </Step>
</Steps>

## What happens on submit

The bundle scans the page for `data-senderz-form` elements and POSTs each submission to `POST /forms/subscribe` with your workspace ID + API key headers. Senderz:

* upserts the contact,
* subscribes email (source `embedded_form`),
* routes any extra fields to the right contact property,
* enrols `contact_created` / `list_joined` flows,
* dispatches a `senderz:subscribed` DOM event you can hook.

## Security

<Warning>
  The `data-form-id` attribute is client-supplied and forgeable, so the
  origin allowlist is workspace-level, not per-form. Requiring the
  `embedded_forms` feature and checking the `Origin` header is the real gate.
</Warning>

See the [Forms API reference](/en/api-reference/forms) for the exact request and response shapes.
