Domains (management API)
Custom domains and Tolinku subdomains. Changes need the Full permission. Removing a domain breaks every link on it and can’t be undone, so when links may depend on it the request must repeat the domain in confirm. For what each setting does, see the user guide.
Every path also works under /v1/manage/appspaces/{appspace}, which you need when an OAuth token reaches more than one Appspace. See the management API overview for signing in, errors, dry runs and paging.
| Method | Path | What it does | Permission |
|---|---|---|---|
GET | /v1/manage/domains | List link domains | Read |
POST | /v1/manage/domains | Add a custom domain | Full |
POST | /v1/manage/domains/{domain}/check | Check a link domain | Read |
POST | /v1/manage/domains/{domain}/primary | Make a custom domain the primary one | Full |
DELETE | /v1/manage/domains/{domain} | Remove a custom domain | Full |
POST | /v1/manage/domains/subdomains | Add a Tolinku subdomain | Full |
DELETE | /v1/manage/domains/subdomains/{subdomain} | Remove a Tolinku subdomain | Full |
List link domains
Section titled “List link domains”/v1/manage/domainsPermission: Read.
The Appspace’s custom domains, each with the DNS record it needs, and its Tolinku subdomains, with which one is primary. No live checks: POST /domains/{domain}/check runs them.
Response 200: the result in data.
| Field | Type | Description |
|---|---|---|
custom | array of object | |
custom[].host | string | |
custom[].kind | custom | |
custom[].primary | boolean | |
custom[].records | array of object | |
subdomains | array of object | |
subdomains[].host | string | |
subdomains[].subdomain | string | |
subdomains[].kind | subdomain | |
subdomains[].primary | boolean | |
primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
max_subdomains | number |
Add a custom domain
Section titled “Add a custom domain”/v1/manage/domainsPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Adds a custom domain, such as links.yourapp.com, with the dashboard’s rules: not under the Tolinku domain, not one another Appspace or an email click domain has. Tolinku asks for its certificate at once; the answer carries the DNS record to create, and links on it work once DNS points at Tolinku and the certificate is issued (POST /domains/{domain}/check). If the certificate can’t be requested, nothing is saved. With dry_run, nothing changes and Cloudflare isn’t called: the answer is { dry_run: true, before, after, changes, warnings }.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | The domain, such as links.yourapp.com. |
Response 201: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
domain | string | |
dns_verified | boolean | Whether DNS already points at Tolinku. |
certificate | requested, already_there, off | |
records | array of object | |
records[].type | CNAME | |
records[].name | string | The record’s name at the DNS provider: the part before the registered domain (“links”), or @ for the domain itself. |
records[].host | string | The full name the record answers for. |
records[].value | string | Where it points: Tolinku’s edge. |
records[].note | string | |
domains | object | |
domains.custom | array of object | |
domains.subdomains | array of object | |
domains.primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
domains.max_subdomains | number |
Check a link domain
Section titled “Check a link domain”/v1/manage/domains/{domain}/checkPermission: Read.
Checks one of the Appspace’s domains live, as a phone would: DNS points at Tolinku (custom domains), the certificate is issued, and both association files are served and name the app. Answers with each check and what to do next. Changes nothing.
Path parameters:
| Parameter | Description |
|---|---|
domain | The domain, such as links.yourapp.com. |
Response 200: the result in data.
| Field | Type | Description |
|---|---|---|
host | string | |
kind | custom, subdomain | |
primary | boolean | |
ready | boolean | DNS, the certificate and both association files are all fine: links on it work. |
dns | object or null | Custom domains only. |
dns.points_to_tolinku | boolean | |
dns.cname | string or null | |
dns.addresses | array of string | |
certificate | object | |
certificate.state | string | |
certificate.label | string | |
certificate.status | string or null | |
aasa | object | |
aasa.state | string | |
aasa.detail | string | |
assetlinks | object | |
assetlinks.state | string | |
assetlinks.detail | string | |
records | array of object or null | |
next_steps | array of string | What to do next, in order. Empty when it’s ready. |
checked_at | string |
Make a custom domain the primary one
Section titled “Make a custom domain the primary one”/v1/manage/domains/{domain}/primaryPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
New links are shown on it; links already shared on the others keep working. With dry_run, nothing changes and Cloudflare isn’t called: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
domain | The domain, such as links.yourapp.com. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
domain | string | |
domains | object | |
domains.custom | array of object | |
domains.subdomains | array of object | |
domains.primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
domains.max_subdomains | number |
Remove a custom domain
Section titled “Remove a custom domain”/v1/manage/domains/{domain}Permission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Every link on it stops working at once, and it can’t be restored: adding it again needs DNS and a new certificate. When links may depend on it (clicks on it in the last 30 days, or it’s the primary domain of an Appspace with routes), it’s refused with 409 conflict unless confirm repeats the domain (in the body, or ?confirm=). A dry run says how many clicks it had and whether confirm is needed. With dry_run, nothing changes and Cloudflare isn’t called: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
domain | The domain, such as links.yourapp.com. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
confirm | string | No | The domain again, to confirm. |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
confirm | string | No | The domain again, to confirm. |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
domain | string | |
certificate | removed, kept_for_email, kept_for_other, not_removed, off | kept_for_other: another Appspace lists the domain too, so its certificate stays. |
clicks_30d | number or null | |
domains | object | |
domains.custom | array of object | |
domains.subdomains | array of object | |
domains.primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
domains.max_subdomains | number |
Add a Tolinku subdomain
Section titled “Add a Tolinku subdomain”/v1/manage/domains/subdomainsPermission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
A name under the Tolinku domain (pantry.tolinku.com): works at once, no DNS needed. At most 2. With dry_run, nothing changes and Cloudflare isn’t called: the answer is { dry_run: true, before, after, changes, warnings }.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
subdomain | string | Yes | The name before .tolinku.com: 3 to 63 lower-case letters, digits and hyphens. |
Response 201: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
subdomain | string | |
host | string | |
domains | object | |
domains.custom | array of object | |
domains.subdomains | array of object | |
domains.primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
domains.max_subdomains | number |
Remove a Tolinku subdomain
Section titled “Remove a Tolinku subdomain”/v1/manage/domains/subdomains/{subdomain}Permission: Full. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Links on it stop working at once, and the name is free for anyone to take. At least one subdomain stays. Like removing a custom domain, it needs confirm (the subdomain again) when links may depend on it. With dry_run, nothing changes and Cloudflare isn’t called: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
subdomain | The part before the Tolinku domain. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
confirm | string | No |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
confirm | string | No | The subdomain again, to confirm. |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
subdomain | string | |
host | string | |
clicks_30d | number or null | |
domains | object | |
domains.custom | array of object | |
domains.subdomains | array of object | |
domains.primary | string or null | The domain links are shown on: the first custom domain, else the first subdomain. |
domains.max_subdomains | number |