---
title: "List API keys"
method: GET
path: "/v4/organizations/{organizationId}/apikeys"
tags: ["Api Keys"]
---

# List API keys

`GET /v4/organizations/{organizationId}/apikeys`

Lists all the API keys under an organization.

Organization Owners can list all the API keys inside the Organization.

Organization Members and Project Creators can list all the Project scoped API key for which they are Project Owner.

To learn more, see [Organization, Project, and Database Access Overview](https://docs.couchbase.com/cloud/organizations/organization-projects-overview.html).

## Query parameters

- `page` integer
- `perPage` integer
- `sortBy` string[]
- `sortDirection` 'asc' | 'desc'

## Response `200`

Successfully listed all the apikeys under an organization.

- GetAPIKeys
  - `data` GetAPIKey[], required
    - `id` string, required — The id is a unique identifier for an apiKey.
    - `name` string, required — Name of the API key.
    - `description` string, required — Description for the API key.
    - `expiry` number, float, required — Expiry of the API key in number of days. Must be at least 0.01 days. If set to -1, the token will not expire.
    - `allowedCIDRs` string[], required — List of inbound CIDRs for the API key. The system making a request must come from one of the allowed CIDRs.
    - `organizationRoles` APIKeyOrganizationRoles[], required
    - `resources` APIKeyResourcesItems[], required — Resources are the resource level permissions associated with the API key. To learn more about Organization Roles, see [Organization Roles](https://docs.couchbase.com/cloud/organizations/organization-user-roles.html).
      - `type` string — Type of the resource.
      - `id` string, uuid, required — ID of the project.
      - `roles` string[], required — Project Roles associated with the API key. To learn more about Project Roles, see [Project Roles](https://docs.couchbase.com/cloud/projects/project-roles.html).
    - `audit` CouchbaseAuditData, required
      - `createdBy` string, required — The user who created the resource; this will be a UUID4 ID for standard users and will be a string such as "internal-support" for internal Couchbase support users.
      - `createdAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was initially created.
      - `modifiedBy` string, required — The user who last modified the resource; this will be a UUID4 ID for standard users and wilmal be a string such as "internal-support" for internal Couchbase support users.
      - `modifiedAt` string, date-time, required — The RFC3339 timestamp associated with when the resource was last modified.
      - `version` integer, required — The version of the document. This value is incremented each time the resource is modified.
  - `cursor` Cursor, required
    - `pages` Pages, required
      - `page` integer, required — Current page of results, starting from page 1.
      - `next` integer — Number of the next page of results. Not set on the last page.
      - `previous` integer — Number of the previous page of results. Not set on the first page.
      - `last` integer, required — Number of the last page of results.
      - `perPage` integer, required — Number of items displayed in each page.
      - `totalItems` integer, required — Total items found by the given query.
    - `hrefs` Hrefs, required
      - `first` string, uri, required — The base URL, endpoint, and path parameters required to fetch the first page of results.
      - `last` string, uri, required — The base URL, endpoint, and path parameters required to fetch the last page of results.
      - `previous` string, uri, required — The base URL, endpoint, and path parameters required to fetch the previous page of results. Empty if there is no previous page.
      - `next` string, uri, required — The base URL, endpoint, and path parameters required to fetch the next page of results. Empty if there is no next page.

## Other responses

- `400` — Returned when we are unable to decode the recevied payload.
- `403` — The client does not have the necessary permissions to access this resource.
- `404` — The requested resource was not found.
- `422` — Request validation error.
- `429` — Returned when the client exceeds the rate limit for the given APIKey.
- `500` — An unexpected error occurred in the server while processing this request.

---

[API](https://skmtc.net/couchbase/apis/couchbase-capella-management-api.md) · [All operations](https://skmtc.net/couchbase/apis/couchbase-capella-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/couchbase/couchbase-capella-management-api/revisions/e67df5d1f74e/schema)
