DomainsList Domains

List Domains

Returns every domain the calling key or user can access.

curl --request GET \
  --url https://api.aiclicks.io/api/v1/domains \
  --header 'Authorization: Bearer ak_live_xxx'
{
  "data": {
    "items": [
      {
        "id": "8f1d3c0a-2f9b-4c11-9b80-7a82e1f0c3f3",
        "name": "Acme Inc.",
        "website": "acme.com",
        "created_at": "2025-11-04T12:18:55.218Z"
      },
      {
        "id": "1be5a7d4-0c8b-4f1d-9b9c-12b9c0e5d2a4",
        "name": "Globex",
        "website": "globex.com",
        "created_at": "2026-01-22T09:02:11.503Z"
      }
    ],
    "total": 2,
    "page": 1,
    "size": 2,
    "total_pages": 1
  },
  "generated_at": "2026-06-08T14:30:11.218Z"
}

For an API-key caller, this returns domains belonging to the key's team, filtered by the per-user allowed_domains allowlist of the user who created the key. For a JWT caller, it spans every team the user is a member of. Teams without Developer Access enabled are silently omitted.

This endpoint is not paginated — domain lists are typically small (under 25 per team). The list-envelope fields (total, page, size, total_pages) are present for consistency but always trivial.

Authorizations

header
Authorizationstring
Required

Your API key formatted as Bearer ak_live_<your-key>. Create one in the dashboard under Settings → Developers.

header
X-Request-Idstring

Optional UUID for log correlation. If omitted, we generate one and echo it back in the response.

Query parameters

This endpoint takes no query parameters.

Response

dataobject
Required

The list payload.

data.itemsarray
Required

Array of domains the caller can access.

data.totalinteger
Required

Total matching rows. Always equals items.length (endpoint isn't paginated).

data.pageinteger
Required

Current page (1-indexed). Always 1.

data.sizeinteger
Required

Items in this page. Equals items.length.

data.total_pagesinteger
Required

Total pages. Always 1.

generated_atstring
Required

ISO-8601 timestamp of when the server produced (or cached) this response.

Response headers

HeaderDescription
X-CacheHIT or MISS. Indicates whether the response came from cache.
X-Request-IdUnique request id. Echoes incoming if you set one.
X-RateLimit-LimitMax requests per minute for this key.
X-RateLimit-RemainingRequests remaining in current minute.
X-RateLimit-ResetUnix epoch seconds when the window resets.

Caching

Cached for 1 hour per (user_id, key_team). Two users in the same team have separate cache entries because their allowed_domains may differ. Watch the X-Cache header to know whether you hit the cache.

Errors

401 Unauthorizederror

Missing, malformed, or revoked API key.

403 Forbiddenerror

Team's developer_access flag is off. Body matches the 403 example above.

429 Too Many Requestserror

Rate limit exceeded. Inspect the Retry-After header for how long to wait.

Empty result

If the caller has access to zero domains (allowlist excludes everything, team is empty, or all teams are filtered out), the response is a successful 200 with an empty list:

{
  "data": { "items": [], "total": 0, "page": 1, "size": 0, "total_pages": 1 },
  "generated_at": "2026-06-08T14:30:11.218Z"
}