# List connected cloud accounts for the current tenant

Source: https://docs.levelfour.ai/api-reference/accounts/get-accounts


## GET /api/v1/accounts

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `page` (query, integer, default `1`): Page number (1-indexed)
- `page_size` (query, integer, default `50`): Items per page (max 200)

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required)
  - `items` (array of object, required)
    - `provider` (one of `aws`, `gcp`, default `aws`): Cloud provider that owns this account row (aws or gcp)
    - `account_id` (string, required): AWS 12-digit account id, or a GCP project / billing-account id
    - `account_name` (string, nullable)
    - `region_name` (string, default `us-east-1`)
    - `status` (one of `pending_role`, `connected`, `error`, `revoked`, required)
    - `is_management_account` (boolean, default `false`)
    - `organization_id` (string, nullable)
    - `connected_at` (date-time string, nullable)
    - `cur_status` (one of `not_enabled`, `provisioning`, `active`, `action_needed`, `error`, default `not_enabled`): Detailed cost data (CUR 2.0) ingestion state for this account
    - `cur_region` (string, nullable): Region the CUR 2.0 export delivers in, once detected
    - `cur_last_ingested_at` (date-time string, nullable): When LevelFour last ingested CUR data for this account
    - `cur_last_checked_at` (date-time string, nullable): When a sweep last looked for this account's CUR export, whether or not it found one. Null means no sweep has ever reached it, which is not the same as the customer not having set one up
    - `cur_last_error` (string, nullable): Last CUR ingestion error for this account, when cur_status is 'error'
    - `cur_data_through` (date string, nullable): Last usage day the Google Cloud billing export delivered
    - `cur_last_delivery_at` (date-time string, nullable): When the Google Cloud billing export table last changed
    - `cud_status` (one of `not_enabled`, `provisioning`, `active`, `action_needed`, `error`, default `not_enabled`): Committed Use Discount (CUD) metadata export ingestion state for this account (GCP)
    - `cud_last_ingested_at` (date-time string, nullable): When LevelFour last ingested CUD metadata for this account
    - `cud_last_error` (string, nullable): Last CUD ingestion error for this account, when cud_status is 'error'
    - `pricing_status` (one of `not_enabled`, `provisioning`, `active`, `action_needed`, `error`, default `not_enabled`): Pricing export ingestion state for this account (GCP)
    - `pricing_last_ingested_at` (date-time string, nullable): When LevelFour last ingested pricing data for this account
    - `pricing_last_error` (string, nullable): Last pricing ingestion error for this account, when pricing_status is 'error'
    - `cur_delivery_state` (one of `current`, `stalled`, `unknown`, required): Whether the Google Cloud billing export is still delivering: stalled once its last usage day is more than GCP_BQ_STALE_AFTER_DAYS old, unknown when nothing has been ingested
  - `pagination` (object, required): Pagination metadata
    - `total_items` (integer, required): Total number of items across all pages
    - `total_pages` (integer, required): Total number of pages
    - `current_page` (integer, required): Current page number (1-indexed)
    - `page_size` (integer, required): Number of items per page
    - `has_next` (boolean, required): Whether there is a next page
    - `has_previous` (boolean, required): Whether there is a previous page

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
