> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redbark.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Account and API keys

> GET /v2/me, and creating, rotating and revoking restricted keys

## Retrieve the account

`GET /v2/me` (no scope needed; tier cheap)

```json theme={null}
{
  "id": "acc_5c9bQm2vT1xWz8nR4pLk7D",
  "object": "account",
  "plan": "developer",
  "status": "active",
  "entitlements": { "api_access": true, "brokerage": false },
  "limits": { "connections": 6, "accounts": 24, "syncs": 10, "destinations": 10 },
  "timezone": "Australia/Sydney",
  "api_version": "2026-10-01.wattle",
  "key": { "id": "key_3K1nTq8cZ5yWvR2mPd7Lx9", "name": "CI", "scopes": ["syncs:read", "syncs:write"], "legacy": false },
  "livemode": true
}
```

`-1` in `limits` means unlimited.

## The api\_key object

```json theme={null}
{
  "id": "key_3K1nTq8cZ5yWvR2mPd7Lx9",
  "object": "api_key",
  "name": "CI",
  "prefix": "rbk_live_3f9a1c2b",
  "scopes": ["syncs:read", "syncs:write"],
  "legacy": false,
  "secret": null,
  "allowed_ips": null,
  "expires_at": null,
  "expiring_at": null,
  "last_used_at": "2026-08-21T09:30:00.000Z",
  "rotated_from": null,
  "status": "active",
  "metadata": null,
  "livemode": true,
  "created": "2026-08-01T00:00:00.000Z",
  "updated": "2026-08-01T00:00:00.000Z"
}
```

`status` is `active`, `expiring` (rotated, still valid until `expiring_at`), `expired` or `revoked`. `secret` is only non-null on create and rotate responses.

## Endpoints

All need the `keys:write` scope. A key can never be granted a scope its creator does not hold, and scopes are immutable after creation.

| Method and path                 | Tier     | Notes                                                                                                                 |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `GET /v2/api_keys`              | cheap    | Newest first                                                                                                          |
| `POST /v2/api_keys`             | mutating | `{ name, scopes, allowed_ips?, expires_at?, metadata? }`. Returns 201 with `secret`.                                  |
| `GET /v2/api_keys/{id}`         | cheap    |                                                                                                                       |
| `POST /v2/api_keys/{id}`        | mutating | `{ name?, metadata? }`                                                                                                |
| `DELETE /v2/api_keys/{id}`      | mutating | Revokes; returns `{ id, object, deleted: true }`                                                                      |
| `POST /v2/api_keys/{id}/rotate` | mutating | `{ grace?: "7d" }` (max 7d, default 7d). Returns 201 with the replacement's `secret`; the old key becomes `expiring`. |

### Create

```bash theme={null}
curl https://api.redbark.com/v2/api_keys \
  -H "Authorization: Bearer rbk_live_..." \
  -H "Redbark-Version: 2026-10-01.wattle" \
  -H "Idempotency-Key: create-ci-key-1" \
  -H "Content-Type: application/json" \
  -d '{ "name": "CI", "scopes": ["syncs:write", "data:read"], "allowed_ips": ["203.0.113.0/24"] }'
```

`allowed_ips` accepts IPv4 addresses or CIDRs and exact IPv6 addresses (up to 20 entries).
