# Usage per API key this month

`GET /v1/orgs/{org_id}/usage/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 |
| --- | --- | --- | --- | --- |
| `org_id` | path | string | yes |  |

## Responses

### 200

Events per API key in the current UTC month.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "Events per API key in the current UTC month.",
  "properties": {
    "keys": {
      "description": "Keys with events this month, revoked ones included, most accepted first.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "description": "Events accepted for processing.",
            "minimum": 0,
            "type": "integer"
          },
          "daily": {
            "description": "Accepted events per UTC day from the 1st of the month to today.",
            "items": {
              "minimum": 0,
              "type": "integer"
            },
            "type": "array"
          },
          "key_id": {
            "pattern": "^key_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "pattern": "^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$",
            "type": "string"
          },
          "project_name": {
            "type": "string"
          },
          "rejected_quota": {
            "description": "Events rejected because the monthly quota was used up.",
            "minimum": 0,
            "type": "integer"
          },
          "rejected_rate": {
            "description": "Events rejected by the per-minute rate limit.",
            "minimum": 0,
            "type": "integer"
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "required": [
          "key_id",
          "name",
          "project_id",
          "project_name",
          "revoked",
          "accepted",
          "rejected_quota",
          "rejected_rate",
          "daily"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "period": {
      "description": "UTC month, YYYY-MM.",
      "pattern": "^\\d{4}-\\d{2}$",
      "type": "string"
    }
  },
  "required": [
    "period",
    "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/orgs/{org_id}/usage/keys" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

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