# Link domain

> The domain your unsubscribe and tracking links use. 6 REST endpoints with parameters, permissions and curl examples. Each is also an MCP tool.

Canonical: https://ballast.to/docs/api/link-domain

[API reference](https://ballast.to/docs/api)

The domain your unsubscribe and tracking links use. 6 endpoints, each also a tool for your AI through [MCP](https://ballast.to/docs/mcp). Authentication and errors are on the [overview](https://ballast.to/docs/api#authentication).

## List link domains

GET

/api/v1/link-domains

The hostnames that carry unsubscribe, click and open links in this workspace's emails, one per sending domain: a mailbox on acme.com uses links.acme.com. Each comes with the CNAME record to add and whether DNS and the certificate are ready. Mailboxes on a domain without one use the first active one.

MCP tool

list\_link\_domains

Read-only

Returns

- **`domains` required object\[\]**: Oldest first. The first active one also carries the links of mailboxes whose domain has none (free mail included)
- **`suggestions` required string\[\]**: links.\<domain\> for the workspace's sending domains that have no link domain yet
- **`missing` required string\[\]**: Domains of connected mailboxes with no active link domain of their own
- **`required` required boolean**: Campaigns can't launch without an active link domain on this server
- **`pendingLimit` required integer**: How many can wait for DNS at once. Active ones have no limit

cURL

```
curl https://ballast.to/api/v1/link-domains \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Set a link domain

PUT

/api/v1/link-domains

Sets the subdomain (e.g. links.acme.com) that carries the links in emails from mailboxes on acme.com, or on another domain you control when a sending domain's DNS is vendor-managed. Add the returned CNAME record at your DNS provider (plus verificationRecord when no mailbox on that domain is connected); we issue the certificate and switch it on once ready. Replacing an active one breaks the unsubscribe links in emails already sent through it, so it needs replace: true.

MCP tool

set\_link\_domain

Owners and admins

Parameters

- **`hostname` required string**: A subdomain of a domain you send from, e.g. links.acme.com
- **`replace` boolean**: Confirm replacing the active link domain on the same domain

Returns

- **`hostname` required string**: e.g. links.acme.com
- **`domain` required string**: The sending domain it carries links for (acme.com): mailboxes on it use it
- **`status` required "pending\_dns" | "pending\_tls" | "active" | "failed"**: active = links in emails use it
- **`dns` required "ok" | "missing" | "wrong" | "unknown"**: What our resolver sees at the hostname
- **`tls` required "active" | "pending" | "failed" | "none"**: Certificate on Cloudflare
- **`message` required string | null**: What to do next, null when active
- **`record` required object | null**: The DNS record to add
- **`verificationRecord` required object | null**: TXT ownership record shown only before activation when no working mailbox on this domain is connected
- **`dnsVendor` required "zapmail" | "inboxkit" | "primeforge" | null**: Inbox vendor that can add the CNAME for you (add\_link\_domain\_cname\_at\_vendor): its mailboxes on this domain came from it and its key is connected. Null when the record has to be added by hand
- **`mailboxes` required integer**: Mailboxes on its domain
- **`verifiedAt` required string | null**
- **`checkedAt` required string | null**

cURL

```
curl -X PUT https://ballast.to/api/v1/link-domains \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"<hostname>"}'
```

## Check a link domain now

POST

/api/v1/link-domains/check

Looks up the CNAME and asks Cloudflare for the certificate again. The worker also checks every minute for the first hour.

MCP tool

check\_link\_domain

Parameters

- **`hostname` required string**: The link domain, e.g. links.acme.com

Returns the same fields as Set a link domain.

cURL

```
curl -X POST https://ballast.to/api/v1/link-domains/check \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"<hostname>"}'
```

## Add the link domain CNAME at the inbox vendor

POST

/api/v1/link-domains/vendor-dns

Adds the link domain's CNAME record in the DNS that Zapmail, InboxKit or Primeforge hosts for the domain, with the workspace's connected key for that vendor, then checks DNS. Reads the domain's records first and only adds one: an existing record on that host is never changed (answers 409 instead). The vendor is the one its mailboxes on that domain came from unless \`vendor\` is given. Mailforge and Infraforge aren't supported: their API can only replace every record of a domain.

MCP tool

add\_link\_domain\_cname\_at\_vendor

Owners and admins

Parameters

- **`hostname` required string**: The link domain, e.g. links.acme.com
- **`vendor` "zapmail" | "inboxkit" | "primeforge"**: Left out = the vendor the mailboxes on that domain came from

Returns

- **`domain` required object**
- **`vendor` required "zapmail" | "inboxkit" | "primeforge"**
- **`status` required "added" | "already\_set"**

cURL

```
curl -X POST https://ballast.to/api/v1/link-domains/vendor-dns \
  -H "Authorization: Bearer $BALLAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hostname":"<hostname>"}'
```

## Remove a link domain

DELETE

/api/v1/link-domains

Unsubscribe and tracked links in emails already sent through it stop working. Its mailboxes move to another active link domain; with none left, campaigns can't send until a new one is active.

MCP tool

remove\_link\_domain

Owners and admins

MCP asks to confirm

Parameters

- **`hostname` required query · string**: The link domain, e.g. links.acme.com

Returns

- **`ok` required true**

cURL

```
curl -X DELETE https://ballast.to/api/v1/link-domains?hostname=<hostname> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```

## Check a link domain CNAME

GET

/api/v1/check/link

Whether links.\<domain\> has the CNAME to our link target. DNS only.

MCP tool

check\_link\_cname

Read-only

Parameters

- **`domain` required query · string**

Returns

- **`hostname` required string**
- **`target` required string | null**
- **`dns` required "ok" | "missing" | "wrong" | "unknown"**

cURL

```
curl https://ballast.to/api/v1/check/link?domain=<domain> \
  -H "Authorization: Bearer $BALLAST_API_KEY"
```
