# Read workspace api-keys keyId usage

What one key has actually been doing: calls per route over a window, the failure classes, the clients and the people behind them. `route`, `client` and `class` narrow it, and the route breakdown is the paged list. A key id belonging to another workspace is a not-found. Admin and Enterprise only.

Access class: `workspace:admin`.

## Endpoint

`GET /v1/workspace/api-keys/{keyId}/usage`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| keyId | path | string | Yes |
| body | query | null | No |
| params | query | object | No |
| query | query | object | No |

## Responses

### 200

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "answer": {
      "filters": {},
      "retention": "string",
      "since": "string",
      "sink": "string",
      "total": 1.5,
      "truncated": true
    },
    "failures": [
      {
        "count": 1.5,
        "failures": 1.5,
        "lastSeen": "string",
        "value": "string"
      }
    ],
    "key": {
      "id": "",
      "lastUsedAt": "string"
    },
    "perDay": [
      {
        "count": 1.5,
        "day": "string",
        "failures": 1.5
      }
    ],
    "routes": [
      {
        "count": 1.5,
        "failures": 1.5,
        "lastSeen": "string",
        "value": "string"
      }
    ]
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
