> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manalens.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Player Consent

> Read the tracking consent that you recorded for one player: none, anonymous or full. A player with no record is not_set. Manalens does not enforce it.

Reads the tracking consent that you recorded for one player with [Set Player Consent](https://docs.manalens.dev/api/players/set-consent.md). Use it to check a player's choice before your game or backend sends events.

Manalens stores the record. It does not enforce it: your SDK setup and your servers decide what they send. See [GDPR and privacy requests](https://docs.manalens.dev/data/privacy-requests.md#record-and-read-consent).

## Authentication

Use an API key (`mana_api_...`) with the **`consent:write`** scope. The same scope reads and writes. See [Authentication](https://docs.manalens.dev/api/authentication.md#api-keys).

* The key works on its own project only. Another project's key gets `404`.
* The key's creator must be an owner, admin or editor.
* It works on every plan. The workspace needs an active subscription or trial.
* Call it from a server. A request with a browser `Origin` header gets `403`.

## Path parameters

| Parameter | Rule |
| - | - |
| `projectId` | The project ID |
| `playerKey` | `user:<user_id>`, where `user_id` is the ID that you send with `identify`, or `anon:<anonymous_id>` for a player that never identified. URL-encode the whole key, for example `user%3Aplayer_42`. |

The record belongs to the key that you use. A record under `anon:<id>` is not shared with the identified player of that install: read the key that you wrote.

## Response

`200`:

```json theme={null}
{
  "player_key": "user:player_42",
  "status": "anonymous",
  "source": "cookie-banner-v1",
  "updated_at": "2026-12-03T10:00:00.000Z"
}
```

| Field | Notes |
| - | - |
| `status` | `none`: the player declined tracking. `anonymous`: tracking without identity or personal data. `full`: all tracking. `not_set`: no record exists. Treat `not_set` like `none`. |
| `source` | Where the player chose, as you sent it. `null` for `not_set`. |
| `updated_at` | When the record was last written. `null` for `not_set`. |

## Example

```bash theme={null}
curl -sS \
  -H "Authorization: Bearer $MANALENS_CONSENT_KEY" \
  "https://api.manalens.dev/v0/projects/$PROJECT_ID/players/user%3Aplayer_42/consent"
```

## Errors

| Status | Code | Meaning |
| - | - | - |
| `400` | `INVALID_PLAYER_KEY` | The player key is not `user:<user_id>` or `anon:<anonymous_id>` |
| `401` | `UNAUTHORIZED` | The key is missing, malformed, unknown or revoked |
| `402` | `SUBSCRIPTION_REQUIRED` | The workspace has no active subscription or trial |
| `403` | `FORBIDDEN` | The key has no `consent:write` scope, its creator is not an owner, admin or editor, or the request came from a browser |
| `403` | `WORKSPACE_SUSPENDED` | The workspace is suspended |
| `404` | `NOT_FOUND` | The key belongs to another project |
| `429` | `RATE_LIMITED` | The project sent more than 600 consent requests this minute. Wait for `Retry-After` seconds. |

See [Errors](https://docs.manalens.dev/api/errors.md) for the error format.


## OpenAPI

````yaml GET /v0/projects/{projectId}/players/{playerKey}/consent
openapi: 3.1.0
info:
  title: Manalens API
  version: 0.1.0
  description: >-
    The public API of Manalens: event ingestion, Steam account links, player
    traits, player deletes and the Query API. Success bodies are the resource,
    with no envelope. Errors use the `Error` format. See
    https://docs.manalens.dev/api/overview.
servers:
  - url: https://api.manalens.dev
    description: API
  - url: https://events.manalens.dev
    description: Event ingestion
security: []
tags:
  - name: Events
    description: Send website, game and server events
  - name: Accounts
    description: Link the Steam account of a player to the game install
  - name: Players
    description: Set and delete the traits of identified players
  - name: Query
    description: Read analytics reports with an API key
paths:
  /v0/projects/{projectId}/players/{playerKey}/consent:
    get:
      tags:
        - Players
      summary: Get player consent
      description: >-
        Read the tracking consent that you recorded for one player: none,
        anonymous or full. A player with no record is not_set; treat it as none.
        Manalens stores the record and does not enforce it.
      operationId: getPlayerConsent
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project ID
          schema:
            type: string
            format: uuid
        - name: playerKey
          in: path
          required: true
          description: >-
            The player key: `user:` and the user ID that you send with identify
            (1 to 255 characters), or `anon:` and an anonymous ID (a UUID) for a
            player that never identified. URL-encode it, for example
            `user%3Aplayer-42`.
          schema:
            type: string
            minLength: 6
            maxLength: 260
            pattern: '^(user|anon):'
      responses:
        '200':
          description: The record, or `not_set`
          content:
            application/json:
              schema:
                type: object
                properties:
                  player_key:
                    type: string
                    description: The player key, with an anonymous ID in lowercase
                  status:
                    type: string
                    enum:
                      - not_set
                      - none
                      - anonymous
                      - full
                    description: >-
                      `none`: the player declined tracking. `anonymous`: the
                      player allows tracking without identity. `full`: the
                      player allows full tracking. `not_set`: no record exists,
                      so treat it as `none`.
                  source:
                    description: >-
                      Where the consent was given, as you sent it, for example
                      `cookie-banner-v1`. `null` for `not_set`.
                    type:
                      - string
                      - 'null'
                  updated_at:
                    description: >-
                      When the record was last written (ISO 8601). `null` for
                      `not_set`.
                    type:
                      - string
                      - 'null'
                required:
                  - player_key
                  - status
                  - source
                  - updated_at
              example:
                player_key: user:player_42
                status: anonymous
                source: cookie-banner-v1
                updated_at: '2026-12-03T10:00:00.000Z'
        '400':
          description: >-
            `INVALID_PLAYER_KEY`: the player key is not `user:<user_id>` or
            `anon:<anonymous_id>`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `UNAUTHORIZED`: the API key is missing, malformed, unknown or
            revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            `SUBSCRIPTION_REQUIRED`: the workspace has no active subscription or
            trial. Consent records work on every plan.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `FORBIDDEN`: the key has no `consent:write` scope, its creator is
            not an owner, admin or editor, the request came from a browser, or
            (PUT) the project is the demo project. `WORKSPACE_SUSPENDED`: the
            workspace is suspended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            `NOT_FOUND`: the key belongs to another project, or the resource
            does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            `TOO_MANY_REQUESTS`: the key or workspace budget is used up.
            `RATE_LIMITED`: the project sent more than 600 consent requests this
            minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              description: Seconds to wait before a retry
              schema:
                type: integer
            RateLimit-Limit:
              description: The limit of the window, when it is known
              schema:
                type: integer
            RateLimit-Policy:
              description: '`<limit>;w=<window seconds>`, when the limit is known'
              schema:
                type: string
            RateLimit-Remaining:
              description: Always 0 on a 429
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets (the same as Retry-After)
              schema:
                type: integer
        '500':
          description: '`INTERNAL`: an unexpected error. The body has a `request_id`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable code. Branch on it.
            message:
              type: string
              description: A human-readable text. The wording can change.
            request_id:
              description: 'INTERNAL only: quote it when you contact support'
              type: string
            issues:
              description: 'INVALID_EVENT only: up to five validation issues'
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                    description: Where the problem is, such as `events.0.properties`
                  message:
                    type: string
                    description: What is wrong, such as `at most 50 keys`
                required:
                  - path
                  - message
            refused:
              description: >-
                INVALID_EVENT when no event of the batch is accepted: each
                refused event (the same list as `errors`, kept for SDKs that
                read it here)
              type: array
              items:
                type: object
                properties:
                  index:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: The position of the event in the batch
                  message_id:
                    description: The message_id of the event, or null when it has none
                    type:
                      - string
                      - 'null'
                  code:
                    type: string
                    description: >-
                      The reason code, such as `INVALID_EVENT`,
                      `SESSION_ID_REQUIRED` or `FORBIDDEN`
                  message:
                    type: string
                    description: 'What is wrong, such as `properties: at most 50 keys`'
                required:
                  - index
                  - message_id
                  - code
                  - message
            results:
              description: 'INVALID_TRAITS of a batch trait update: the result of each item'
              type: array
              items:
                type: object
                properties:
                  index:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  user_id:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - index
            feature:
              description: >-
                PLAN_UPGRADE_REQUIRED only: the plan feature that the request
                needs
              type: string
            billing_url:
              description: 'PLAN_UPGRADE_REQUIRED only: the billing page of the workspace'
              type: string
          required:
            - code
            - message
      required:
        - error
      description: >-
        The error format of every endpoint. See
        https://docs.manalens.dev/api/errors.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key (`mana_api_...`) with scopes. It reads reports and writes
        player traits.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.