# Get the key status

URL: https://docs.analytics.remcostoeten.nl/docs/reference/projects/get-v2-projects-project-keys

`GET /v2/projects/{project}/keys`

When the current public and secret keys were generated and the last key check, which is null until one has run and after a key is rotated.

Auth: apiToken, or session.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | yes | string | The project id, as listed by `GET /v2/projects`. |

## Responses

### 200

When each current key was generated and the last check, which is null until one has run and after a key is rotated.

```json
{
  "description": "When each current key was generated and the last check, which is null until one has run and after a key is rotated.",
  "examples": [
    {
      "data": {
        "publicKeyCreatedAt": "2026-09-27T16:43:00.000Z",
        "secretKeyCreatedAt": "2026-09-20T09:12:00.000Z",
        "check": {
          "checkedAt": "2026-10-24T08:30:00.000Z",
          "state": "connected",
          "accepted": 412,
          "rejected": 0,
          "since": "2026-10-17T08:30:00.000Z",
          "secretKey": "matches"
        }
      }
    }
  ],
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "publicKeyCreatedAt",
        "secretKeyCreatedAt",
        "check"
      ],
      "properties": {
        "publicKeyCreatedAt": {
          "format": "date-time",
          "description": "ISO 8601 timestamp in UTC.",
          "type": "string"
        },
        "secretKeyCreatedAt": {
          "format": "date-time",
          "description": "ISO 8601 timestamp in UTC.",
          "type": "string"
        },
        "check": {
          "description": "The result of the last key check.",
          "type": [
            "object",
            "null"
          ],
          "required": [
            "checkedAt",
            "state",
            "accepted",
            "rejected",
            "since",
            "secretKey"
          ],
          "properties": {
            "checkedAt": {
              "format": "date-time",
              "description": "ISO 8601 timestamp in UTC.",
              "type": "string"
            },
            "state": {
              "type": "string",
              "enum": [
                "connected",
                "rejected",
                "waiting"
              ],
              "description": "`connected` when events were accepted with the current public key, `rejected` when events arrived but none were accepted, `waiting` when none arrived."
            },
            "accepted": {
              "minimum": 0,
              "type": "integer"
            },
            "rejected": {
              "minimum": 0,
              "type": "integer"
            },
            "since": {
              "format": "date-time",
              "description": "Where the counts start: when the public key was generated, or 7 days back when that is longer.",
              "type": "string"
            },
            "secretKey": {
              "type": "string",
              "enum": [
                "matches",
                "mismatch",
                "not-tested"
              ],
              "description": "`matches` when the secret key sent with the check hashes to the stored one, `mismatch` when it does not, `not-tested` when no secret key was sent."
            }
          }
        }
      }
    }
  }
}
```

### 400, 401, 403, 404, 409, 500, 503

The error envelope every failed request answers with.

Body: `#/components/schemas/ApiError`.

## Schemas

### ApiError

`#/components/schemas/ApiError`

```json
{
  "description": "The error envelope every failed request answers with.",
  "examples": [
    {
      "error": {
        "code": "NOT_FOUND",
        "message": "Project not found",
        "requestId": "req_01J8ZB4K2P",
        "docs": "https://api.analytics.remcostoeten.nl/v2/openapi#errors/NOT_FOUND"
      }
    }
  ],
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message",
        "requestId",
        "docs"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "VALIDATION_FAILED",
            "UNAUTHORIZED",
            "AUTH_REQUIRED",
            "FORBIDDEN_ORIGIN",
            "ORIGIN_NOT_ALLOWED",
            "FORBIDDEN",
            "WIDGET_REPORTS_DISABLED",
            "NOT_FOUND",
            "CONFLICT",
            "PAYLOAD_TOO_LARGE",
            "RATE_LIMITED",
            "INTERNAL",
            "UNAVAILABLE"
          ],
          "description": "- `VALIDATION_FAILED` (400): Body, query or path fails the schema; details lists each field.\n- `UNAUTHORIZED` (401): No or invalid session, token or key.\n- `AUTH_REQUIRED` (401): The widget bootstrap was called without a signed-in session cookie.\n- `FORBIDDEN_ORIGIN` (403): The public key was used from an origin that is not in the project's allowed origins.\n- `ORIGIN_NOT_ALLOWED` (403): The widget bootstrap's Origin is not in any project's allowed origins.\n- `FORBIDDEN` (403): The token scope or the signed-in member's role does not allow the action, or the debug console was opened while the project's debugConsole switch is off.\n- `WIDGET_REPORTS_DISABLED` (403): SDK client reports were sent to a project whose widgetReports switch is off.\n- `NOT_FOUND` (404): Unknown route, project, visitor or session, or a private project without access.\n- `CONFLICT` (409): A project with this id already exists.\n- `PAYLOAD_TOO_LARGE` (413): The ingest body is over 60 KB or has more than 50 events, or a client report body is over 16 KB.\n- `RATE_LIMITED` (429): The per-IP-hash limit was hit; wait for the Retry-After header.\n- `INTERNAL` (500): Unexpected failure; the message never includes internals.\n- `UNAVAILABLE` (503): The database is unreachable, or a feature the route needs is not configured: a job's store, alerts, CRUX_API_KEY, SMTP or Resend; ingest clients retry."
        },
        "message": {
          "minLength": 1,
          "description": "What went wrong, for people. Never includes internals.",
          "type": "string"
        },
        "details": {
          "description": "Extra context for some codes: `fields` with each failed `path` and `message` for `VALIDATION_FAILED`, `retryAfterSeconds` for `RATE_LIMITED`.",
          "type": "object",
          "patternProperties": {
            "^(.*)$": {}
          }
        },
        "requestId": {
          "minLength": 1,
          "description": "The `X-Request-Id` the request sent, or a new `req_<uuid>`; also returned as the `X-Request-Id` header.",
          "type": "string"
        },
        "docs": {
          "format": "uri",
          "description": "Link to this error code in the API reference.",
          "type": "string"
        }
      }
    }
  },
  "$id": "#/components/schemas/ApiError"
}
```
