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

# Custom flow domains

> Serve RaaS widget magic links on your own hostname

## What this is

Each flow has a platform host. When you create a magic link, the `url` is `{flow-host}/{linkId}`.

If you want that host to be **yours** (`https://enviar.yourbrand.com`), declare a custom domain per flow. We mint new links on that base URL. **DNS, TLS, and the reverse proxy are yours** — we do not issue certificates or verify domain ownership.

## What you must proxy

Point your hostname at the platform host shown for that flow in Partner Portal → **Settings → Flow domains**.

The proxy must:

1. Preserve the path (`/{linkId}` and any other widget routes)
2. Serve the flow's `config.js` **unmodified**

`config.js` includes `FLOW_SLUG` (which flow this is) and `API_BASE_URL` (which backend the widget calls). Rewriting either breaks the widget or fails verification.

<Note>
  Read the platform default URL from Partner Portal. Do not hardcode widget hosts from this page — they change by environment.
</Note>

## How to configure

* **Partner Portal:** Settings → Flow domains. Enter an `https` base URL (no query string). Save, then **Verify**.
* **API:** `PUT /partner/settings` with a complete `flowDomains` map (`{ "smart": "https://enviar.yourbrand.com" }`). Send `null` or `""` to clear a slug.

Host: [Partner API overview](/raas-widgets/api-reference/introduction).

## Verification

We `GET {your-domain}/config.js` and compare `FLOW_SLUG` to the catalog slug.

| Status | Meaning | What to do |
| - | - | - |
| `verified` | The host serves the expected flow | Ready for new links |
| `unknown` | `FLOW_SLUG` is missing | Redeploy / refresh the flow behind the proxy |
| `unreachable` | Timeout, TLS, or HTTP error | Finish DNS/TLS, then Verify again |
| `flow_mismatch` | A different flow is being served | Fix the proxy target — save is rejected |

Verification is an operational signal. An `unreachable` domain can still be saved (you may still be propagating DNS). **`flow_mismatch` blocks the save.**

## Existing links

Changing a domain does **not** rewrite magic links already created. Only new `POST /partner/links` (and other mint paths) use the override.

## Next steps

<CardGroup cols={2}>
  <Card title="Magic links" icon="link" href="/raas-widgets/concepts/magic-links">
    How the `url` is built.
  </Card>

  <Card title="Create links" icon="code" href="/raas-widgets/guides/create-links">
    Mint a link after the domain is set.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.