---
title: "Set an owner's connection data permissions"
method: POST
path: "/internal/oauth-grants/{grantId}/data-access"
tags: ["Data"]
---

# Set an owner's connection data permissions

`POST /internal/oauth-grants/{grantId}/data-access`

## Request

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

Internal signed dashboard hop after session, same-origin and fresh password checks. OAuth/API tokens cannot authorize this route. Refused during sunset read-only mode. Atomically checks ownership, advances revision, audits and queues expansion notices.

## Path parameters

- `grantId` string, required

## Request body

- object
  - `userId` string, required
  - `access` union, required
    - object
      - `scope` 'selected', required
      - `apps` object[], required
        - `id` string, required
        - `mode` 'read' | 'readwrite', required
        - `identity` union, required
          - object
            - `kind` 'user', required
            - `collectionId` string, required
            - `recordId` string, required
          - object
            - `kind` 'visitor', required
          - object
            - `kind` 'superuser', required
    - object
      - `scope` 'all', required
      - `mode` 'read' | 'readwrite', required
      - `identities` object[], required
        - `id` 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 dataAccess and monotonic revision

## Other responses

- `400`: Invalid settings
- `401`: Invalid internal credential
- `403`: DATA_TOOLS_NOT_ENABLED
- `404`: Foreign, missing or revoked grant; foreign or missing app
- `409`: App is deleting
- `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)
