## GET /api/v2/shared-hosting

**List shared-hosting accounts**

Return shared-hosting accounts with domains, billing, resource limits, control-panel metadata, and pagination. Use account IDs from this endpoint for shared-hosting actions and detail lookups.

### Related Endpoints

- `GET /api/v2/shared-hosting/{accountId}`: Get shared-hosting account
- `PATCH /api/v2/shared-hosting/{accountId}`: Rename shared-hosting account
- `POST /api/v2/shared-hosting/wordpress/batch`: Batch list WordPress sites

### Headers

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

### Parameters

- `limit` (query, integer) [min: 1, max: 100]: Maximum shared-hosting accounts to return in this page.
- `cursor` (query, string): Opaque cursor from `nextCursor` for the next page.
- `include` (query, string): Repeatable include selector. Use `include=billingCycleOptions` to attach cycle-change options to each account. Use `include=domains` to hydrate `domains` with the full cPanel main/addon/parked/subdomain inventory; without it, `domains` contains only the primary domain from the account record. Example: `billingCycleOptions`
  Allowed values: billingCycleOptions, domains

### Request Example

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

### Response Schema

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

### Responses

#### 200 - Cursor-paginated list.
```json
{
  "data": [
    {
      "id": "acct_01hxa3b4c5d6e7f8g9h0j1k2m3",
      "name": "example.com",
      "primaryDomain": "example.com",
      "domains": [
        "example.com",
        "shop.example.com"
      ],
      "customName": "Main hosting account",
      "serviceStatus": "active",
      "billing": {
        "amount": 1188,
        "currencyCode": "SEK",
        "billingCycle": "annually"
      },
      "createdAt": "2026-04-27T12:34:56.000Z",
      "nextDueAt": "2026-05-27T12:00:00.000Z",
      "expiresAt": "2026-06-27T12:00:00.000Z",
      "pinned": false,
      "resources": {
        "storageGb": 100,
        "memoryGb": 4,
        "cpuPercent": 800,
        "diskLimitGb": 100
      },
      "controlPanel": {
        "type": "cpanel"
      },
      "billingCycleState": {
        "billingCycleOptions": [
          {
            "billingCycle": "annually",
            "amount": 1188,
            "currencyCode": "SEK",
            "isCurrent": true,
            "savingsPercent": 34
          }
        ],
        "actions": {
          "canSwitchCycle": {
            "allowed": false,
            "reason": "No alternative billing cycles are available for this account."
          }
        }
      },
      "actions": null,
      "tags": []
    }
  ],
  "hasMore": false,
  "nextCursor": null
}
```

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