
# 사용자 지정 도메인 나열

`GET /v1/custom-domains` · 권한 `custom-domains:read`

환경의 사용자 지정 로그인 도메인을 오래된 순으로 나열합니다. 앞으로 페이지 이동(`after`)만 지원하며 `before`와 `asc` 이외의 `order`는 `422`를 반환합니다. 제거된(`released`) 도메인은 `include_released=true`가 아니면 제외되고, `status`는 해당 상태의 도메인만 반환합니다(`released` 포함). 환경당 사용자 지정 도메인은 최대 1개입니다(Enterprise는 20개).

## 요청

| 필드 | 유형 | 필수 | 설명 |
|---|---|---|---|
| `limit` | integer | 아니요 | 페이지 크기, 1-100(기본값 20). |
| `after` | string | 아니요 | 이전 페이지의 `list_metadata.after` 커서. |
| `status` | string | 아니요 | 이 상태의 도메인만: `pending_dns`, `issuing`, `active`, `degraded`, `disabled`, `released`. |
| `include_released` | boolean | 아니요 | `true`이면 해제된 도메인도 나열합니다. `status`가 있으면 무시됩니다. |

요청 본문이 없습니다.

## 응답

`200 OK`와 도메인 페이지(목록 항목에는 `caa` 필드가 없음).

```json
{
  "data": [
    {
      "id": "cdom_01j9xk3m7q8r2s4t6v8w0y2z4a",
      "hostname": "login.example.com",
      "is_primary": true,
      "status": "active",
      "failure_reason": null,
      "dns_records": [
        {
          "type": "TXT",
          "name": "_akp-verify.login.example.com",
          "value": "idp-verify=3q2-7wEXAMPLEtokenQ9"
        },
        {
          "type": "CNAME",
          "name": "login.example.com",
          "value": "acme.eu.edge.keenauth.app"
        }
      ],
      "certificate_expires_at": "2027-01-04T09:31:12Z",
      "last_checked_at": "2026-10-05T09:31:00Z",
      "next_check_at": null,
      "activated_at": "2026-10-05T09:31:12Z",
      "degraded_since": null,
      "status_changed_at": "2026-10-05T09:31:12Z",
      "created_at": "2026-10-05T09:30:00.123456Z",
      "updated_at": "2026-10-05T09:31:12Z"
    }
  ],
  "list_metadata": {
    "before": null,
    "after": null
  }
}
```

## 오류

| HTTP | code | 조건 |
|---|---|---|
| 422 | `invalid_cursor` | 커서 형식이 잘못되었거나 다른 필터에 속합니다. |
| 422 | `validation_failed` | 쿼리 매개변수가 잘못되었습니다(`before`, `order=desc`, 알 수 없는 `status`). |
| 401 | `unauthenticated` | 자격 증명이 없거나 유효하지 않거나 취소되었습니다. |
| 403 | `insufficient_permissions` | 자격 증명에 필요한 권한이 없습니다. |
| 429 | `rate_limited` | 속도 제한을 초과했습니다. `Retry-After` 시간 후에 다시 시도하세요. |
| 503 | `service_unavailable` | 종속 서비스를 일시적으로 사용할 수 없습니다. `Retry-After` 시간 후에 다시 시도하세요. |

## 예제

```bash
curl "https://api.eu.keenauth.com/v1/custom-domains?limit=20" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
```
