---
title: "List API Keys for the authenticated user"
method: GET
path: "/api-keys"
tags: ["API Keys"]
---

# List API Keys for the authenticated user

`GET /api-keys`

Retrieve a list of API keys for the authenticated user.

## Response `200`

List of API keys retrieved successfully

- object
  - `keys` APIKeyPreview[], required — Array of API keys for the user
    - `id` string, required
    - `name` string, required
    - `preview` string, required
    - `scopes` string[], required
    - `projects` string[], required — Projects this API key has access to
    - `branches` string[], required — Branches this API key has access to
    - `created_at` string, date-time, required
    - `expiry` string, date-time, nullable, required — Date when the API key expires (null if no expiry)
    - `last_used` string, date-time, nullable, required — Timestamp of the last time the key was used (null if never)
    - `created_by` string, nullable — ID of the user that created this API key
    - `created_by_key` string, nullable — ID of the API key that created this API key

## Other responses

- `400` — Error returned when the request is malformed or contains invalid parameters
- `401` — Error returned when authentication or authorization fails
- `5XX` — Unexpected Error

---

[API](https://skmtc.net/xata/apis/xata-api.md) · [All operations](https://skmtc.net/xata/apis/xata-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xata/xata-api/versions/33621695d346/schema)
