---
title: "List all API keys"
method: GET
path: "/api-keys"
tags: ["api-keys"]
---

# List all API keys

`GET /api-keys`

Returns all API keys. Requires admin role.

## Response `200`

List of API keys

- APIKeysListResponse — List of API keys
  - `apiKeys` APIKey[], required
    - `id` string, required — Unique identifier
    - `name` string, required — Human-readable name
    - `description` string — Purpose description
    - `role` 'admin' | 'manager' | 'developer' | 'operator' | 'viewer', required — User role determining access permissions. admin: full access including user management, manager: DAG CRUD and execution with audit log access, developer: DAG CRUD and execution, operator: DAG execution only, viewer: read-only
    - `workspaceAccess` WorkspaceAccess, required — Workspace access policy. all=true grants the top-level role in every workspace. all=false requires explicit workspace grants and a top-level viewer role.
      - `all` boolean, required — Whether this identity can access all workspaces
      - `grants` WorkspaceGrant[], required — Workspace-specific grants used when all=false — unresolved $ref
    - `allowedSurfaces` string[], required — Interfaces where this API key may be accepted
    - `attributionClass` 'user_owned' | 'service_account', required — Whether this key is owned by a user or represents a service account
    - `ownerUserId` string — Owner user ID when attributionClass is user_owned
    - `ownerUsername` string — Owner username when attributionClass is user_owned
    - `serviceAccountId` string — Service-account identifier when attributionClass is service_account
    - `serviceAccountName` string — Service-account display name when attributionClass is service_account
    - `migratedAsServiceAccount` boolean — True when a legacy key missing attributionClass was defaulted to service_account
    - `keyPrefix` string, required — First 8 characters for identification
    - `createdAt` string, date-time, required — Creation timestamp
    - `updatedAt` string, date-time, required — Last update timestamp
    - `createdBy` string, required — Creator user ID
    - `lastUsedAt` string, date-time, nullable — Last authentication timestamp

## Other responses

- `401` — Not authenticated
- `403` — Requires admin role
- `default` — Error

## Changes

- **2026-07-23** (v1) `75b8e91aaf57` — 9 warning
  - added the new `conflict` enum value to the `code` response property for the response status `401`
  - added the new `conflict` enum value to the `code` response property for the response status `403`
  - added the new `conflict` enum value to the `code` response property for the response status `default`
  - added the new `human_task_resume_failed` enum value to the `code` response property for the response status `401`
  - …5 more
- **2026-05-24** (v1) `8a2d5d3e9608` — 3 warning
  - added the new `rate_limited` enum value to the `code` response property for the response status `401`
  - added the new `rate_limited` enum value to the `code` response property for the response status `403`
  - added the new `rate_limited` enum value to the `code` response property for the response status `default`
- **2026-05-22** (v1) `4a44e3b2d12a` — 7 info
  - added the optional property `apiKeys/items/migratedAsServiceAccount` to the response with the `200` status
  - added the optional property `apiKeys/items/ownerUserId` to the response with the `200` status
  - added the optional property `apiKeys/items/ownerUsername` to the response with the `200` status
  - added the optional property `apiKeys/items/serviceAccountId` to the response with the `200` status
  - …3 more
- …earlier changes not shown

[Full history](https://skmtc.dev/dagucloud/apis/dagu/changes/api-keys/get.md)

---

[API](https://skmtc.dev/dagucloud/apis/dagu.md) · [All operations](https://skmtc.dev/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dagucloud/dagu/revisions/5dc2b1ef8770/schema)
