---
title: "Set the owner's per-app API-token identity"
method: POST
path: "/internal/apps/{appId}/data-token-access"
tags: ["Data"]
---

# Set the owner's per-app API-token identity

`POST /internal/apps/{appId}/data-token-access`

## Request

- Base URL: `https://api.percher.run`
- URL: `https://api.percher.run/internal/apps/{appId}/data-token-access`
- Auth: API key in header `X-Internal-Secret`

Internal dashboard hop after session, same-origin and fresh password checks. Owner, gate, sunset and changed-identity running checks apply. Saves user_id as the checked owner, advances revision, audits and queues an immutable expansion notice.

## Path parameters

- `appId` string, required

## Request body

- object
  - `userId` string, required
  - `identity` union, required
    - object
      - `kind` 'user', required
      - `collectionId` string, required
      - `recordId` string, required
    - object
      - `kind` 'visitor', required
    - object
      - `kind` 'superuser', required

## Response `200`

Stored identity and revision

## Other responses

- `400`: Invalid settings
- `401`: Invalid internal credential
- `403`: DATA_TOOLS_NOT_ENABLED
- `404`: App not owned
- `409`: APP_DELETING or access changed concurrently
- `503`: PB_NOT_RUNNING or PLATFORM_READ_ONLY

---

[API](https://skmtc.dev/percher/apis/percher-api.md) · [All operations](https://skmtc.dev/percher/apis/percher-api/llms.txt) · [OpenAPI document](https://skmtc.dev/percher/apis/percher-api/revisions/d9e7089c21e5?raw)
