Developers/API/Domains

Domains API

Add and manage custom domains for your short links.

Note: Custom domains require a Teams or Enterprise plan.

GET/api/v1/domains

List all custom domains.

Scope: domains:read

Request

curl https://trimlink.co/api/v1/domains \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "data": [
    {
      "id": "dom_abc123",
      "domain": "go.example.com",
      "verified": true,
      "lastStatus": "fully_configured",
      "createdAt": "2026-01-15T10:00:00Z"
    }
  ]
}
POST/api/v1/domains

Add a custom domain for verification.

Scope: domains:write

Request

curl -X POST https://trimlink.co/api/v1/domains \
  -H "Authorization: Bearer tk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"domain": "go.example.com"}'

Response

201Response
{
  "success": true,
  "data": {
    "id": "dom_xyz789",
    "domain": "go.example.com",
    "verified": false,
    "verificationToken": "a3f5d9c7e8b2...",
    "txtRecordHost": "_trimlink-verification.go.example.com",
    "txtRecordValue": "trimlink-verify=a3f5d9c7e8b2...",
    "cnameRecordHost": "go.example.com",
    "cnameRecordValue": "cname.trimlink.co"
  }
}

DNS Setup Required

After adding a domain, configure these DNS records:

  1. TXT Record - Add the verification token
  2. CNAME Record - Point to cname.trimlink.co
GET/api/v1/domains/:id

Get domain details.

Scope: domains:read

Request

curl https://trimlink.co/api/v1/domains/dom_xyz789 \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "data": {
    "id": "dom_xyz789",
    "domain": "go.example.com",
    "verified": false,
    "lastStatus": "txt_missing",
    "lastCheckedAt": "2026-01-31T12:00:00Z",
    "createdAt": "2026-01-31T10:00:00Z"
  }
}
POST/api/v1/domains/:id/verify

Trigger domain verification check.

Scope: domains:write

Request

curl -X POST https://trimlink.co/api/v1/domains/dom_xyz789/verify \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "data": {
    "id": "dom_xyz789",
    "domain": "go.example.com",
    "verified": true,
    "lastStatus": "fully_configured"
  }
}
GET/api/v1/domains/:id/status

Check domain DNS configuration status.

Scope: domains:read

Request

curl https://trimlink.co/api/v1/domains/dom_xyz789/status \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

200Response
{
  "success": true,
  "data": {
    "txtConfigured": true,
    "cnameConfigured": true,
    "status": "fully_configured"
  }
}
DELETE/api/v1/domains/:id

Delete a custom domain.

Scope: domains:write

Request

curl -X DELETE https://trimlink.co/api/v1/domains/dom_xyz789 \
  -H "Authorization: Bearer tk_live_your_api_key"

Response

204 No Content

Domain Status Values

StatusDescription
pendingAwaiting DNS configuration
txt_missingTXT record not found
cname_missingCNAME record not found
fully_configuredDomain is ready to use