# Usage of a project's API keys

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

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 |
| --- | --- | --- | --- | --- |
| `project_id` | path | string | yes |  |

## Responses

### 200

Accepted events of every API key of a project, revoked ones included.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "Accepted events of every API key of a project, revoked ones included.",
  "properties": {
    "keys": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "hourly": {
            "description": "Accepted events per UTC hour, oldest first.",
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "maxItems": 24,
            "minItems": 24,
            "type": "array"
          },
          "key_id": {
            "pattern": "^key_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "type": "string"
          },
          "last_24h": {
            "description": "Accepted events in the 24 UTC hours ending with the current one.",
            "minimum": 0,
            "type": "integer"
          },
          "this_month": {
            "description": "Accepted events in the current UTC month.",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "key_id",
          "last_24h",
          "this_month",
          "hourly"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "keys"
  ],
  "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).

### 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/usage" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/usage/getProjectKeyUsage
