# Get the account

> Read the account an API key belongs to: its plan, its rate limit, and the key's own name, expiry and brand access.

Source: https://ranqo.ai/docs/api/reference/get-account

```http
GET https://api.ranqo.ai/v1/account
```

The account this key reads, its plan, the key's own details and its rate limit. Carries no owner name or email.

## Response

The response body, as JSON.

| Field | Type | Description |
| --- | --- | --- |
| `account_id` | string | The account this key reads. |
| `plan` | object |  |
| `plan.id` | string | One of `starter`, `pro`, `business`, `agency`, `agency_scale`, `pilot`. |
| `plan.name` | string |  |
| `plan.is_trialing` | boolean |  |
| `plan.trial_ends_at` | string or null | RFC 3339 timestamp in UTC. When the trial ends; null outside a trial. |
| `rate_limit` | object |  |
| `rate_limit.requests_per_minute` | integer | Per key, in a fixed one-minute window. |
| `rate_limit.window_seconds` | integer |  |
| `key` | object |  |
| `key.id` | string |  |
| `key.name` | string |  |
| `key.masked` | string | The key with its middle hidden, as Settings lists it. |
| `key.created_at` | string | RFC 3339 timestamp in UTC. |
| `key.expires_at` | string or null | RFC 3339 timestamp in UTC. Null when the key never expires. |
| `key.brand_access` | object |  |
| `key.brand_access.all_brands` | boolean | True when the key reads every brand, including ones added later. |
| `key.brand_access.brand_ids` | array of strings | The brands a restricted key reads; empty when `all_brands` is true. |

## Response headers

| Header | Description |
| --- | --- |
| `X-Request-Id` | The request id; quote it to support. |
| `RateLimit` | Requests left in this window and seconds until it resets. |
| `RateLimit-Policy` | The key's limit per window. |

## Example request

```bash title="curl"
curl "https://api.ranqo.ai/v1/account" \
  -H "Authorization: Bearer $RANQO_API_KEY"
```

## Errors

Errors are problem details (`application/problem+json`) with a stable `code`. See [Errors](https://ranqo.ai/docs/api/errors) for each one.

| Status | Codes |
| --- | --- |
| 400 | [`unknown_parameter`](https://ranqo.ai/docs/api/errors#unknown_parameter), [`api_key_in_url`](https://ranqo.ai/docs/api/errors#api_key_in_url) |
| 401 | [`missing_api_key`](https://ranqo.ai/docs/api/errors#missing_api_key), [`invalid_api_key`](https://ranqo.ai/docs/api/errors#invalid_api_key), [`api_key_revoked`](https://ranqo.ai/docs/api/errors#api_key_revoked), [`api_key_expired`](https://ranqo.ai/docs/api/errors#api_key_expired), [`api_key_orphaned`](https://ranqo.ai/docs/api/errors#api_key_orphaned) |
| 403 | [`plan_upgrade_required`](https://ranqo.ai/docs/api/errors#plan_upgrade_required), [`subscription_inactive`](https://ranqo.ai/docs/api/errors#subscription_inactive) |
| 429 | [`rate_limited`](https://ranqo.ai/docs/api/errors#rate_limited) |
| 500 | [`internal_error`](https://ranqo.ai/docs/api/errors#internal_error) |
| 503 | [`service_unavailable`](https://ranqo.ai/docs/api/errors#service_unavailable) |
