# Use your own domain for connect

Open the hosted connect screens on your own subdomain, such as connect.yourbrand.com, instead of zernio.com.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

The welcome screen and the result screen of the [connect flow](/guides/connecting-accounts) can open on a subdomain you own, so your users never see zernio.com in the address bar.

## Before you start

- **You need** a subdomain you control, such as `connect.yourbrand.com`, and access to its DNS records. The domain itself (`yourbrand.com`) cannot be used.
- **Permissions:** the workspace's owner or an admin adds, changes and removes it. Each workspace has one custom domain.
- **Dashboard:** the same steps are in Settings, Domains.

## Add your domain

Send the subdomain. The answer lists the two DNS records to add.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const res = await fetch('https://zernio.com/api/v1/connect/custom-domains', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.ZERNIO_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ hostname: 'connect.yourbrand.com' }),
});
const { customDomain } = await res.json();
// customDomain.records: the CNAME and the TXT record to add
```
</Tab>
<Tab value="Python">
```python
import os
import requests

res = requests.post(
    "https://zernio.com/api/v1/connect/custom-domains",
    headers={"Authorization": f"Bearer {os.environ['ZERNIO_API_KEY']}"},
    json={"hostname": "connect.yourbrand.com"},
)
custom_domain = res.json()["customDomain"]
# custom_domain["records"]: the CNAME and the TXT record to add
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/connect/custom-domains" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname": "connect.yourbrand.com"}'
```
</Tab>
</Tabs>

```json
{
  "customDomain": {
    "id": "6b00123b10b06d3a302cee8a",
    "hostname": "connect.yourbrand.com",
    "zone": "yourbrand.com",
    "status": "pending",
    "connectEnabled": false,
    "ownershipVerified": false,
    "records": [
      { "type": "CNAME", "name": "connect.yourbrand.com", "host": "connect", "value": "cname.zerniocdn.com" },
      { "type": "TXT", "name": "_zernio-verify.connect.yourbrand.com", "host": "_zernio-verify.connect", "value": "zernio-verify=43966a9e-6484-4eab-9a2d-6a71c9662dd4" }
    ],
    "activatedAt": null,
    "createdAt": "2026-11-20T09:26:19.390Z"
  }
}
```

## Add the DNS records

Add both records at your DNS provider. `host` is the name relative to `zone`, which is what most providers ask for.

- **CNAME** points the subdomain at Zernio. Keep it in place: without it, connect goes back to zernio.com.
- **TXT** proves the subdomain is yours. Nothing is set up until it is found.
- **Cloudflare:** set the CNAME's proxy status to DNS only.
- **Conflicts:** remove any other A, AAAA or CNAME record on the same name.
- **CAA:** if the domain has a CAA record, allow `letsencrypt.org`, `pki.goog` and `ssl.com`.

## Check the records

We check on our own every hour. To check right away, call [`POST /v1/connect/custom-domains/{domainId}/verify`](/connect/verify-connect-custom-domain).

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const res = await fetch(`https://zernio.com/api/v1/connect/custom-domains/${customDomain.id}/verify`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.ZERNIO_API_KEY}` },
});
const { customDomain: checked } = await res.json();
// checked.status: "pending" until the certificate is issued, then "active"
```
</Tab>
<Tab value="Python">
```python
res = requests.post(
    f"https://zernio.com/api/v1/connect/custom-domains/{custom_domain['id']}/verify",
    headers={"Authorization": f"Bearer {os.environ['ZERNIO_API_KEY']}"},
)
checked = res.json()["customDomain"]
# checked["status"]: "pending" until the certificate is issued, then "active"
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/connect/custom-domains/6b00123b10b06d3a302cee8a/verify" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```
</Tab>
</Tabs>

`ownershipVerified` turns true once the TXT record is found. `status` turns `active` once the certificate is issued, usually a few minutes later. We email the person who added it when it does.

## Turn it on for connect

An active domain carries connect links only once you turn it on with [`PATCH /v1/connect/custom-domains/{domainId}`](/connect/update-connect-custom-domain).

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
await fetch(`https://zernio.com/api/v1/connect/custom-domains/${customDomain.id}`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.ZERNIO_API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ connectEnabled: true }),
});
```
</Tab>
<Tab value="Python">
```python
requests.patch(
    f"https://zernio.com/api/v1/connect/custom-domains/{custom_domain['id']}",
    headers={"Authorization": f"Bearer {os.environ['ZERNIO_API_KEY']}"},
    json={"connectEnabled": True},
)
```
</Tab>
<Tab value="curl">
```bash
curl -X PATCH "https://zernio.com/api/v1/connect/custom-domains/6b00123b10b06d3a302cee8a" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"connectEnabled": true}'
```
</Tab>
</Tabs>

From then on, `GET /v1/connect/{platform}` with `welcome=true` returns an `authUrl` on `https://connect.yourbrand.com/connect/welcome`, and the user comes back to the result screen on the same domain. The platform's own login screen stays on the platform.

## How it behaves

- **Only the connect screens** are served on the domain. Any other path, the root included, answers 404.
- **Turning it off** sends new links to zernio.com again. Links already sent keep working.
- **A removed CNAME** takes the domain back to `pending`, and new links open on zernio.com until it is fixed. If the domain stops pointing at Zernio for good, it turns `failed` and we email the person who added it.
- **Removing it** ([`DELETE /v1/connect/custom-domains/{domainId}`](/connect/delete-connect-custom-domain)) deletes its certificate. Links already sent on the domain stop working; you can then delete both DNS records.
- **Unverified domains** are released after 7 days, and failed ones after 3 days, so the hostname can be added again.

## If it fails

| Error | Cause | Fix |
|---|---|---|
| `invalid_field_value` (400) | The hostname is the domain itself, an IP, or one of Zernio's domains | Use a subdomain such as `connect.yourbrand.com` |
| `custom_hostname_taken` (409) | Another workspace verified this hostname first | Use another subdomain |
| `invalid_resource_state` (409) | The workspace already has a custom domain | Remove it before adding another |
| `rate_limited` (429) | More than 10 domains added in a day | Try again tomorrow |
| `status` stays `pending` | The TXT record is missing or different, or the CNAME is proxied | Compare the records with `records`, and set the CNAME to DNS only |

## Related

- [List custom domains](/connect/list-connect-custom-domains)
- [Add a custom domain](/connect/create-connect-custom-domain)
- [Get a custom domain](/connect/get-connect-custom-domain)
- [Connecting accounts](/guides/connecting-accounts)