## GET /api/v2/shared-hosting/{accountId}

**Get shared-hosting account**

Return one shared-hosting account with domains, billing, resource limits, control-panel metadata, billing-cycle options, and lifecycle action gates.

### Related Endpoints

- `PATCH /api/v2/shared-hosting/{accountId}`: Rename shared-hosting account
- `GET /api/v2/shared-hosting/{accountId}/domains`: List hosting domains
- `POST /api/v2/shared-hosting/{accountId}/domains`: Add hosting addon domain

### Headers

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

### Parameters

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

### Request Example

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

### Response Schema

- `id` (string, optional) Example: `acct_01hxa3b4c5d6e7f8g9h0j1k2m3`
- `name` (string, optional): Customer-facing account name. Defaults to the primary domain when no custom name is set. Example: `example.com`
- `primaryDomain` (string,null, optional) Example: `example.com`
- `domains` (array<string>, optional): Domains known on this account. List responses normally include the primary domain only. Example: `["example.com"]`
- `customName` (string,null, optional) Example: `null`
- `serviceStatus` (string, optional) Example: `active`
  Allowed values: active, pending, suspended, cancelled, terminated, expired, fraud, unknown
- `billing` (object, optional)
- `billing.amount` (number, required) Example: `99`
- `billing.currencyCode` (string, required) Example: `SEK`
- `billing.billingCycle` (string,null, required) Example: `annually`
  Allowed values: monthly, quarterly, semiannually, annually, biennially, triennially, free, 
- `createdAt` (string,null, optional) Example: `2026-04-27T12:34:56.000Z`
- `nextDueAt` (string,null, optional) Example: `2026-05-27T12:00:00.000Z`
- `expiresAt` (string,null, optional) Example: `null`
- `pinned` (boolean, optional) Example: `false`
- `resources` (object,null, optional)
- `controlPanel` (object, optional)
- `controlPanel.type` (string, required) Example: `cpanel`
  Allowed values: cpanel
- `controlPanel.supportsWhm` (boolean, optional): Only present when the account supports WHM access. Example: `true`
- `billingCycleState` (object | null, optional)
- `billingCycleState.billingCycleOptions` (array<object>, required)
- `billingCycleState.billingCycleOptions[].billingCycle` (string, required) Example: `annually`
  Allowed values: monthly, quarterly, semiannually, annually, biennially, triennially, free
- `billingCycleState.billingCycleOptions[].amount` (number, required) Example: `1188`
- `billingCycleState.billingCycleOptions[].initialAmount` (number, optional): Present only when the first payment differs from the recurring amount. Example: `149`
- `billingCycleState.billingCycleOptions[].currencyCode` (string, required) Example: `SEK`
- `billingCycleState.billingCycleOptions[].isCurrent` (boolean, required) Example: `true`
- `billingCycleState.billingCycleOptions[].savingsPercent` (number,null, required) Example: `null`
- `billingCycleState.actions` (object, required)
- `billingCycleState.actions.canSwitchCycle` (object, required)
- `billingCycleState.actions.canSwitchCycle.allowed` (boolean, required) Example: `true`
- `billingCycleState.actions.canSwitchCycle.reason` (string,null, required) Example: `null`
- `billingCycleState.actions.canSwitchCycle.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions` (object | null, optional): Null on list responses. Detail responses include lifecycle and control-panel action gates.
- `actions.canRenew` (object, required)
- `actions.canRenew.allowed` (boolean, required) Example: `true`
- `actions.canRenew.reason` (string,null, required) Example: `null`
- `actions.canRenew.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canChangeBillingCycle` (object, required)
- `actions.canChangeBillingCycle.allowed` (boolean, required) Example: `true`
- `actions.canChangeBillingCycle.reason` (string,null, required) Example: `null`
- `actions.canChangeBillingCycle.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canPause` (object, required)
- `actions.canPause.allowed` (boolean, required) Example: `true`
- `actions.canPause.reason` (string,null, required) Example: `null`
- `actions.canPause.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canUpgrade` (object, required)
- `actions.canUpgrade.allowed` (boolean, required) Example: `true`
- `actions.canUpgrade.reason` (string,null, required) Example: `null`
- `actions.canUpgrade.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canCancel` (object, required)
- `actions.canCancel.allowed` (boolean, required) Example: `true`
- `actions.canCancel.reason` (string,null, required) Example: `null`
- `actions.canCancel.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canAddStorage` (object, required)
- `actions.canAddStorage.allowed` (boolean, required) Example: `true`
- `actions.canAddStorage.reason` (string,null, required) Example: `null`
- `actions.canAddStorage.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `actions.canSso` (object, required)
- `actions.canSso.allowed` (boolean, required) Example: `true`
- `actions.canSso.reason` (string,null, required) Example: `null`
- `actions.canSso.code` (string,null, optional): Machine-readable reason code when an action is blocked. Example: `pending_order`
- `tags` (array<string>, optional)

### Responses

#### 200 - Shared-hosting account.
```json
{
  "id": "acct_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "name": "example.com",
  "primaryDomain": "example.com",
  "domains": [
    "example.com"
  ],
  "customName": null,
  "serviceStatus": "active",
  "billing": {
    "amount": 1188,
    "currencyCode": "SEK",
    "billingCycle": "annually"
  },
  "createdAt": null,
  "nextDueAt": "2026-05-27T12:00:00.000Z",
  "expiresAt": null,
  "pinned": false,
  "resources": null,
  "controlPanel": {
    "type": "cpanel"
  },
  "billingCycleState": {
    "billingCycleOptions": [
      {
        "billingCycle": "monthly",
        "amount": 149,
        "currencyCode": "SEK",
        "isCurrent": false,
        "savingsPercent": null
      },
      {
        "billingCycle": "annually",
        "amount": 1188,
        "currencyCode": "SEK",
        "isCurrent": true,
        "savingsPercent": null
      }
    ],
    "actions": {
      "canSwitchCycle": {
        "allowed": true,
        "reason": null
      }
    }
  },
  "actions": {
    "canRenew": {
      "allowed": true,
      "reason": null
    },
    "canChangeBillingCycle": {
      "allowed": true,
      "reason": null
    },
    "canPause": {
      "allowed": true,
      "reason": null
    },
    "canUpgrade": {
      "allowed": true,
      "reason": null
    },
    "canCancel": {
      "allowed": true,
      "reason": null
    },
    "canAddStorage": {
      "allowed": true,
      "reason": null
    },
    "canSso": {
      "allowed": true,
      "reason": null
    }
  },
  "tags": []
}
```

#### 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"
}
```
