# List API keys

`GET /v1/projects/{project_id}/keys`

Requires role member or higher.

## Authentication

A session token: `Authorization: Bearer <session token>`, or the session cookie in the browser. Requires role `member` or higher.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `cursor` | query | string | no |  |
| `limit` | query | integer | no |  |
| `project_id` | path | string | yes |  |

## Responses

### 200

API keys, revoked ones included, oldest first.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "API keys, revoked ones included, oldest first.",
  "properties": {
    "data": {
      "items": {
        "additionalProperties": false,
        "description": "A project API key. The secret is never returned after creation.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "anyOf": [
              {
                "pattern": "^usr_[0-7][0-9a-hjkmnp-tv-z]{25}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "pattern": "^key_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "pattern": "^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scopes": {
            "items": {
              "anyOf": [
                {
                  "enum": [
                    "ingest:write"
                  ],
                  "type": "string"
                }
              ]
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "project_id",
          "name",
          "scopes",
          "created_by",
          "created_at",
          "last_used_at",
          "revoked_at"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "type": "object"
}
```

### 401

unauthorized: no valid session, or the email is not verified.

Problem type: [unauthorized](https://docs.dlogify.com/errors/unauthorized.md).

### 404

not-found: the resource does not exist, or the caller is not a member of its organization.

Problem type: [not-found](https://docs.dlogify.com/errors/not-found.md).

### 422

validation-failed: the request does not match the schema.

Problem type: [validation-failed](https://docs.dlogify.com/errors/validation-failed.md).

### 429

rate-limited: per-user management request limit.

Problem type: [rate-limited](https://docs.dlogify.com/errors/rate-limited.md).

## Example

```bash
curl -X GET "https://api.dlogify.com/v1/projects/{project_id}/keys" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/api-keys/listApiKeys
