---
title: "Get an API key's KB scope"
method: GET
path: "/org/api-keys/{keyId}/kb-permissions"
tags: ["API Keys"]
---

# Get an API key's KB scope

`GET /org/api-keys/{keyId}/kb-permissions`

## Request

- Base URL: `https://apiv2.senso.ai/api/v1`
- URL: `https://apiv2.senso.ai/api/v1/org/api-keys/{keyId}/kb-permissions`
- Auth: API key in header `X-API-Key`

Returns the knowledge-base folder grants that restrict a key. An empty array means the key is unscoped and can query the entire knowledge base. Note an unknown or revoked key id also returns an empty array — this endpoint does not 404.

## Path parameters

- `keyId` string, uuid, required

## Response `200`

The key's KB folder grants (empty if unscoped).

- APIKeyScopeGrant[]
  - `node_id` string, uuid, required: The KB node the key is granted access to (typically a folder).
  - `role` 'viewer' | 'editor' | 'owner' | 'admin', required: The access level granted on the node. Stored grants are `viewer`, `editor`, or `owner`; `admin` is computed for organization administrators rather than granted, so it is not returned by this endpoint.

## Other responses

- `400`: The request was malformed — a bad path/query parameter or an invalid value.
- `401`: Missing or invalid credentials — supply a valid org API key in the `X-API-Key` header.

---

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