## POST /api/v2/domains/{id}/actions/reactivate

**Reactivate an expired domain**

Create the invoice that brings an expired domain back. The invoice covers a one-time reactivation fee and one year of renewal. Check `available` and the price on [`GET /api/v2/domains/{id}/reactivation`](/endpoints/domain-services/get-v2-domains-id-reactivation/) first. Send no body. Nothing changes at the registry until the invoice is paid in full. The domain is then restored and renewed for one year without further calls. Follow `reactivation.status` on the same GET. When a reactivation is already open, the call returns it with its invoice instead of creating a second one. After `restorableUntil` the domain can no longer be restored.

### Related Endpoints

- `POST /api/v2/domains/{id}/actions/renew`: Renew a domain
- `POST /api/v2/domains/{id}/actions/update-epp`: Save an EPP code for a transfer
- `POST /api/v2/domains/{id}/actions/request-epp`: Get a domain's EPP code

### Headers

- `Authorization`: Bearer $HOSTUP_API_KEY
- Scopes: `write:domains`, `write:billing`

### Parameters

- `id` (path, string, required): The domain ID (`dom_…`). Example: `dom_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X POST "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reactivate" \
  -H "Authorization: Bearer $HOSTUP_API_KEY" \
  -H "Content-Type: application/json"
```

### Response Schema

- `domainId` (string, required)
- `domainName` (string, required, nullable)
- `reactivation` (object, required)
- `reactivation.status` (string, optional)
  Allowed values: awaiting_payment, processing, completed, failed, cancelled
- `reactivation.createdAt` (string, optional, nullable)
- `reactivation.restorableUntil` (string, optional, nullable)
- `reactivation.renewalYears` (integer, optional)
- `reactivation.paymentInvoice` (object, optional, nullable)
- `reactivation.paymentInvoice.id` (string, optional)
- `reactivation.paymentInvoice.number` (string, optional, nullable)
- `reactivation.paymentInvoice.amount` (number, optional, nullable)
- `reactivation.paymentInvoice.currencyCode` (string, optional)
- `reactivation.paymentInvoice.dueAt` (string, optional, nullable)
- `reactivation.paymentInvoice.status` (string, optional)
- `reactivation.paymentInvoice.paymentUrl` (string, optional)

### Responses

#### 200 - The new or already open reactivation with its invoice.
```json
{
  "domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "domainName": "example.com",
  "reactivation": {
    "status": "awaiting_payment",
    "createdAt": "2026-08-05T14:30:00.000Z",
    "restorableUntil": "2026-08-30",
    "renewalYears": 1,
    "paymentInvoice": {
      "id": "inv_01hxa3b4c5d6e7f8g9h0j1k2m3",
      "number": "202600001",
      "amount": 430,
      "currencyCode": "SEK",
      "dueAt": "2026-08-12T00:00:00.000Z",
      "status": "unpaid",
      "paymentUrl": "/billing?invoice=202600001"
    }
  }
}
```

#### 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 is invalid.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 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; `code` is `domain_not_found`.
```json
{
  "type": "https://developer.hostup.se/errors/domain_not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "domain_not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 409 - The domain cannot be reactivated online (`domain_not_eligible`). `detail` says why. Either the domain is not in the restore window, the window has passed or it can still be renewed normally.
```json
{
  "type": "https://developer.hostup.se/errors/domain_not_eligible",
  "title": "Domain not eligible for reactivation",
  "status": 409,
  "detail": "example.com: This domain can still be renewed normally without a reactivation fee.",
  "code": "domain_not_eligible",
  "instance": "/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reactivate",
  "domain": {
    "id": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
    "name": "example.com"
  }
}
```

#### 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": "Rate limit exceeded. Please try again later.",
  "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"
}
```

#### 502 - The reactivation price could not be confirmed right now (`renewal_pricing_unavailable`). Try again later.
```json
{
  "type": "https://developer.hostup.se/errors/renewal_pricing_unavailable",
  "title": "Reactivation pricing unavailable",
  "status": 502,
  "detail": "Reactivation pricing is unavailable right now. Try again shortly or contact support.",
  "code": "renewal_pricing_unavailable",
  "instance": "/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reactivate"
}
```
