## GET /api/v2/domains/{id}/lifecycle

**Get domain lifecycle diagnostics**

Return server-composed domain lifecycle diagnostics for transfers and registrations. This is the endpoint an AI should use to decide whether to update an EPP code, retry a transfer, wait for payment, fix identity details, or tell the user the domain is already active.

### Related Endpoints

- `GET /api/v2/domains/{id}`: Get domain details
- `PATCH /api/v2/domains/{id}`: Update domain settings
- `DELETE /api/v2/domains/{id}`: Delete domain

### Headers

- `Accept`: application/json
- `Authorization`: Bearer YOUR_API_KEY
- Required API scope: `read:domains`

### Parameters

- `id` (path, string, required): Public domain ID. Get it from GET /api/v2/domains `data[].id`. Do not invent this value; use the exact ID returned by the referenced API response. Example: `dom_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/lifecycle" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Response Schema

- `whoisLookupStatus` (string | null, required) Example: `ok`
  Allowed values: ok, lookup_unavailable, tld_not_supported, rate_limited, error
- `registrationFailure` (object | null, required)
- `registrationFailure.category` (string, required) Example: `identity_invalid`
- `registrationFailure.reason` (string, required) Example: `Registration failed because the identification number is invalid.`
- `registrationFailure.detectedAt` (string | null, required) Example: `2026-04-26T09:30:00.000Z`
- `transferFailure` (object | null, required)
- `transferFailure.category` (string, required) Example: `epp_invalid`
- `transferFailure.reason` (string, required) Example: `The EPP code was invalid.`
- `transferFailure.detectedAt` (string | null, required) Example: `2026-04-26T09:30:00.000Z`
- `registryHistory` (array<object>, required)
- `registryHistory[].timestamp` (string | null, required) Example: `2026-04-27T12:00:00.000Z`
- `registryHistory[].subject` (string | null, required) Example: `Transfer status`
- `registryHistory[].contents` (string | null, required) Example: `Transfer rejected: invalid authorization code.`
- `transferErrorsCleared` (boolean, required) Example: `false`
- `domainStatusSynced` (boolean, required) Example: `false`
- `transferStatus` (object | null, required)
- `transferStatus.kind` (string, required) Example: `transfer_failed_at_registry`
  Allowed values: pending_transfer_in_progress, transfer_failed_at_registry, transfer_not_at_registry, pending_transfer_generic, awaiting_payment, registry_locked_and_epp_invalid, registry_locked, too_new_for_transfer, transfer_error_known, pending_epp_fallback, active, expired, unknown
- `transferStatus.reason` (string | null, required) Example: `The registry rejected the transfer because the EPP code was invalid.`
- `transferStatus.actions` (object, required)
- `transferStatus.actions.canUpdateEpp` (object, required)
- `transferStatus.actions.canUpdateEpp.allowed` (boolean, required) Example: `true`
- `transferStatus.actions.canUpdateEpp.reason` (string | null, required)
- `transferStatus.actions.canRetryTransfer` (object, required)
- `transferStatus.actions.canRetryTransfer.allowed` (boolean, required) Example: `true`
- `transferStatus.actions.canRetryTransfer.reason` (string | null, required)
- `transferStatus.actions.canRequestFreshEpp` (object, required)
- `transferStatus.actions.canRequestFreshEpp.allowed` (boolean, required) Example: `true`
- `transferStatus.actions.canRequestFreshEpp.reason` (string | null, required)
- `transferStatus.capability` (object, required)
- `transferStatus.capability.showProgress` (boolean, required) Example: `false`
- `transferStatus.capability.showInvoice` (boolean, required) Example: `false`
- `transferStatus.capability.showFailedRetry` (boolean, required) Example: `true`
- `transferStatus.capability.showEppUpdate` (boolean, required) Example: `true`
- `transferStatus.capability.showDualIssues` (boolean, required) Example: `false`
- `transferStatus.progress` (object | null, required)
- `transferStatus.progress.daysPassed` (integer, required) Example: `1`
- `transferStatus.progress.daysRemaining` (integer, required) Example: `2`
- `transferStatus.progress.maxDays` (integer, required) Example: `3`
- `transferStatus.progress.percent` (integer, required) Example: `33`
- `registrationStatus` (object | null, required)
- `registrationStatus.kind` (string, required) Example: `pending`
  Allowed values: pending, active, failed, submitted, queued, completed, unknown
- `registrationStatus.reason` (string | null, required) Example: `Registration is pending at the registry.`
- `registrationStatus.supported` (boolean, required) Example: `true`
- `registrationStatus.actions` (object, required)
- `registrationStatus.actions.canRetryRegistration` (object, required)
- `registrationStatus.actions.canRetryRegistration.allowed` (boolean, required) Example: `true`
- `registrationStatus.actions.canRetryRegistration.reason` (string | null, required)
- `registrationStatus.actions.canFixIdentity` (object, required)
- `registrationStatus.actions.canFixIdentity.allowed` (boolean, required) Example: `true`
- `registrationStatus.actions.canFixIdentity.reason` (string | null, required)

### Responses

#### 200 - Lifecycle diagnostics for transfer and registration flows.
```json
{
  "whoisLookupStatus": "ok",
  "registrationFailure": {
    "category": "unknown",
    "reason": "Registration failed.",
    "detectedAt": "2026-04-27T12:34:56.000Z"
  },
  "transferFailure": null,
  "registryHistory": [
    {
      "timestamp": "2026-04-27T12:00:00.000Z",
      "subject": "Registration status",
      "contents": "Registration failed at the registry."
    }
  ],
  "transferErrorsCleared": false,
  "domainStatusSynced": false,
  "transferStatus": {
    "kind": "unknown",
    "reason": null,
    "actions": {
      "canUpdateEpp": {
        "allowed": true,
        "reason": null
      },
      "canRetryTransfer": {
        "allowed": false,
        "reason": "Transfer is already in progress at the registry."
      },
      "canRequestFreshEpp": {
        "allowed": true,
        "reason": null
      }
    },
    "capability": {
      "showProgress": false,
      "showInvoice": false,
      "showFailedRetry": false,
      "showEppUpdate": false,
      "showDualIssues": false
    },
    "progress": null
  },
  "registrationStatus": {
    "kind": "failed",
    "reason": "Registration failed.",
    "supported": false,
    "actions": {
      "canRetryRegistration": {
        "allowed": false,
        "reason": "Registration retry is not supported for this TLD."
      },
      "canFixIdentity": {
        "allowed": false,
        "reason": "Identity details can only be fixed after an identity-related registration failure."
      }
    }
  }
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 401 - Unauthorized. Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required.",
  "code": "unauthorized",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 403 - Forbidden. The caller lacks a required scope or does not own the resource.
```json
{
  "type": "https://developer.hostup.se/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "The caller lacks a required scope or does not own the resource.",
  "code": "forbidden",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 404 - Not found. The resource does not exist or is not owned by the caller.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Too many requests. Retry after the limit resets.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
