# List keys

Lists your workspace's API keys, never the keys themselves.

`GET /v1/keys` on `https://api.eu.vatis.tech`

> **Admin key only.** A Member key gets `403` `admin_only`. Roles: [Authentication and API keys](https://platform.vatis.tech/docs/authentication).

## Headers

| header | values | default | meaning |
|---|---|---|---|
| `Authorization` | `Bearer <api key>` | required | An Admin key ([Roles](https://platform.vatis.tech/docs/authentication#roles)). A Member key gets `403` `admin_only`. |

## Query parameters

| parameter | values | default | meaning |
|---|---|---|---|
| `include_revoked` | `true`, `false` | `false` | Also list the revoked keys. |

## Response fields

| field | when | meaning |
|---|---|---|
| `keys` |  | The keys, oldest first. Each has the fields below. |
| `keys[].id` |  | `key_` and 12 hex digits. |
| `keys[].name` |  | The key's name. |
| `keys[].prefix` |  | The key's first characters, to tell it apart. |
| `keys[].role` |  | `admin` or `member` ([Roles](https://platform.vatis.tech/docs/authentication#roles)). |
| `keys[].state` |  | `active`, `expired` or `revoked`. |
| `keys[].created_at` |  | When it was made: ISO 8601, UTC. |
| `keys[].last_used_at` |  | When it last made a request, or `null`: never used. |
| `keys[].expires_at` |  | When it stops: the start of the day after its last day, in UTC. `null`: no end. |
| `keys[].revoked_at` |  | When it was revoked, or `null`. |

## Responses

`200`: The list.

```json
{
  "keys": [
    {
      "id": "key_3f9c1a2b7d4e",
      "name": "crm-backend",
      "prefix": "vatis_sk_AbCdEf",
      "role": "member",
      "state": "active",
      "created_at": "2026-11-12T09:14:03Z",
      "last_used_at": "2026-11-12T10:01:44Z",
      "expires_at": null,
      "revoked_at": null
    }
  ]
}
```

`400` `invalid_parameter`: Another query parameter, or an `include_revoked` that is not `true` or `false`. The `param` names it.

`401` `unauthorized`: No key, or a wrong, revoked or expired one.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid, revoked or expired key.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`403` `admin_only`: A Member key.

```json
{
  "error": {
    "code": "admin_only",
    "message": "This takes an Admin key: ask your administrator.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`503` `unavailable`: The service is busy for a moment. Send the request again after the seconds of the `Retry-After` header.

## Notes

- These are the same keys as on the console's [API keys](https://platform.vatis.tech/keys) page: a key made in one place shows in the other.
