Skip to content

Domains (management API)

View as Markdown

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.

MethodPathWhat it doesPermission
GET/v1/manage/domainsList link domainsRead
POST/v1/manage/domainsAdd a custom domainFull
POST/v1/manage/domains/{domain}/checkCheck a link domainRead
POST/v1/manage/domains/{domain}/primaryMake a custom domain the primary oneFull
DELETE/v1/manage/domains/{domain}Remove a custom domainFull
POST/v1/manage/domains/subdomainsAdd a Tolinku subdomainFull
DELETE/v1/manage/domains/subdomains/{subdomain}Remove a Tolinku subdomainFull
GET/v1/manage/domains

Permission: 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.

FieldTypeDescription
customarray of object
custom[].hoststring
custom[].kindcustom
custom[].primaryboolean
custom[].recordsarray of object
subdomainsarray of object
subdomains[].hoststring
subdomains[].subdomainstring
subdomains[].kindsubdomain
subdomains[].primaryboolean
primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
max_subdomainsnumber
POST/v1/manage/domains

Permission: 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:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
domainstringYesThe domain, such as links.yourapp.com.

Response 201: the result in data, with warnings. With dry_run, a preview instead.

FieldTypeDescription
domainstring
dns_verifiedbooleanWhether DNS already points at Tolinku.
certificaterequested, already_there, off
recordsarray of object
records[].typeCNAME
records[].namestringThe record’s name at the DNS provider: the part before the registered domain (“links”), or @ for the domain itself.
records[].hoststringThe full name the record answers for.
records[].valuestringWhere it points: Tolinku’s edge.
records[].notestring
domainsobject
domains.customarray of object
domains.subdomainsarray of object
domains.primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
domains.max_subdomainsnumber
POST/v1/manage/domains/{domain}/check

Permission: 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:

ParameterDescription
domainThe domain, such as links.yourapp.com.

Response 200: the result in data.

FieldTypeDescription
hoststring
kindcustom, subdomain
primaryboolean
readybooleanDNS, the certificate and both association files are all fine: links on it work.
dnsobject or nullCustom domains only.
dns.points_to_tolinkuboolean
dns.cnamestring or null
dns.addressesarray of string
certificateobject
certificate.statestring
certificate.labelstring
certificate.statusstring or null
aasaobject
aasa.statestring
aasa.detailstring
assetlinksobject
assetlinks.statestring
assetlinks.detailstring
recordsarray of object or null
next_stepsarray of stringWhat to do next, in order. Empty when it’s ready.
checked_atstring
POST/v1/manage/domains/{domain}/primary

Permission: 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:

ParameterDescription
domainThe domain, such as links.yourapp.com.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
domainstring
domainsobject
domains.customarray of object
domains.subdomainsarray of object
domains.primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
domains.max_subdomainsnumber
DELETE/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:

ParameterDescription
domainThe domain, such as links.yourapp.com.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).
confirmstringNoThe domain again, to confirm.

Request body (JSON):

FieldTypeRequiredDescription
confirmstringNoThe domain again, to confirm.

Response 200: the result in data, with warnings. With dry_run, a preview instead.

FieldTypeDescription
domainstring
certificateremoved, kept_for_email, kept_for_other, not_removed, offkept_for_other: another Appspace lists the domain too, so its certificate stays.
clicks_30dnumber or null
domainsobject
domains.customarray of object
domains.subdomainsarray of object
domains.primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
domains.max_subdomainsnumber
POST/v1/manage/domains/subdomains

Permission: 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:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
subdomainstringYesThe 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.

FieldTypeDescription
subdomainstring
hoststring
domainsobject
domains.customarray of object
domains.subdomainsarray of object
domains.primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
domains.max_subdomainsnumber
DELETE/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:

ParameterDescription
subdomainThe part before the Tolinku domain.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).
confirmstringNo

Request body (JSON):

FieldTypeRequiredDescription
confirmstringNoThe subdomain again, to confirm.

Response 200: the result in data, with warnings. With dry_run, a preview instead.

FieldTypeDescription
subdomainstring
hoststring
clicks_30dnumber or null
domainsobject
domains.customarray of object
domains.subdomainsarray of object
domains.primarystring or nullThe domain links are shown on: the first custom domain, else the first subdomain.
domains.max_subdomainsnumber
Was this page helpful?