# Prop keys for autocomplete

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

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

Distinct event prop keys of the last 30 days with counts, optionally for one `event`, from human production traffic. Reads at most the newest 20,000 events, or 5,000 for one event, and sets `sampled` when it reached that cap.

Auth: none, or apiToken, or session.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `project` | path | yes | string | The project id, as listed by `GET /v2/projects`. |
| `limit` | query | no |  | Values to return, 1 to 500; default 100. |
| `event` | query | no | string | Keep one event name. |

## Responses

### 200

Response for status 200

```json
{
  "type": "object",
  "required": [
    "data",
    "event",
    "total",
    "sampled",
    "range"
  ],
  "properties": {
    "data": {
      "description": "Most used first.",
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "count"
        ],
        "properties": {
          "key": {
            "description": "The prop key, usable as `prop:<key>`.",
            "type": "string"
          },
          "count": {
            "minimum": 0,
            "description": "Events carrying this key.",
            "type": "integer"
          }
        }
      }
    },
    "event": {
      "description": "The event name the keys are limited to, or null for every event.",
      "type": [
        "string",
        "null"
      ]
    },
    "total": {
      "minimum": 0,
      "description": "Distinct values found, before `limit`.",
      "type": "integer"
    },
    "sampled": {
      "description": "True when the window held more events than one read scans (100,000 for names, 20,000 for keys, 5,000 for the keys of one event); counts then cover the newest events only.",
      "type": "boolean"
    },
    "range": {
      "description": "The time range the numbers cover, in UTC.",
      "type": "object",
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "format": "date-time",
          "description": "Start of the range, inclusive.",
          "type": "string"
        },
        "to": {
          "format": "date-time",
          "description": "End of the range, exclusive.",
          "type": "string"
        }
      }
    }
  }
}
```

### 400, 401, 403, 404, 409, 429, 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"
}
```
