# List the workspace's custom domains

Source: https://straitlink.in/docs/api/list-domains/

`GET /v1/domains`

Auth: secret key as Authorization: Bearer. Server-side only.

**Coming soon:** custom domains aren't switched on yet. Until they are, this endpoint answers `enabled: false` (the list) or `503 domains_not_enabled`.

Every custom domain with its live status and the DNS records to add. Any member may read. A domain turns `verified` here, on the first read after Cloudflare reports it live and its ownership TXT record is in DNS. Limited to 20 reads, then 1 every 2 s, per workspace (429 with Retry-After).

| Parameter | In | Type | Notes |
|---|---|---|---|
| `tenantId` | query | `string` | The workspace. Required with a dashboard session; with a secret key it is the key's workspace (another id is 404). |

```bash
curl -X GET https://strait.link/v1/domains \
  -H "Authorization: Bearer $SECRET_KEY"
```

Response 200:

```json
{
  "enabled": true,
  "writes": true,
  "allowed": true,
  "cnameTarget": "fallback.strait.link",
  "max": 5,
  "domains": [
    {
      "hostname": "links.hilltop.example",
      "verified": true,
      "status": "live",
      "records": [
        {
          "type": "CNAME",
          "name": "links.hilltop.example",
          "value": "fallback.strait.link",
          "purpose": "Sends your links to Strait"
        },
        {
          "type": "TXT",
          "name": "_cf-custom-hostname.links.hilltop.example",
          "value": "5cc07c04-ea62-4a5a-95f0-419334a875a4",
          "purpose": "Proves you own the domain"
        },
        {
          "type": "TXT",
          "name": "_acme-challenge.links.hilltop.example",
          "value": "ca3-574923932a82475cb8592200f1a2a23d",
          "purpose": "Lets us issue its HTTPS certificate"
        }
      ]
    }
  ]
}
```

- `200`: The domains, and whether custom domains are switched on for this workspace
- `400`: tenantId missing (dashboard session)
- `401`: Missing or invalid secret key or session
- `404`: Not a member of this workspace
- `429`: Too many status reads
