---
title: "Grant access to a node"
method: POST
path: "/org/kb/nodes/{id}/permissions"
tags: ["Knowledge Base"]
---

# Grant access to a node

`POST /org/kb/nodes/{id}/permissions`

## Request

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

Grants a user or group `viewer` or `editor` access to a knowledge base node. Use `PATCH` to change an existing grant's role.

## Path parameters

- `id` string, uuid, required

## Request body

- GrantPermissionRequest
  - `grantee_type` 'user' | 'group', required: Whether the grantee is a user or a group.
  - `grantee_id` string, uuid, required: The user id or group id to grant access to.
  - `role` 'viewer' | 'editor', required: Access level to grant. Only viewer and editor can be granted here; owner is reserved and rejected with 400.

## Response `201`

The created access grant.

- KBNodeGrant: An access grant on a knowledge base node.
  - `id` string, uuid, required: Unique identifier of the grant.
  - `node_id` string, uuid, required: The node this grant applies to.
  - `role` 'viewer' | 'editor' | 'owner', required: The access level this grant confers.
  - `grantee` Grantee, required: The user or group an access grant is for.
    - `type` 'user' | 'group', required: Whether the grantee is a `user` or a `group`.
    - `id` string, uuid, required: The user id or group id.
    - `display_name` string, required: Human-readable name of the grantee.
    - `email` string: Email address (users only).
  - `granted_at` string, date-time, required: When the grant was created.

## 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.
- `403`: The API key is authenticated but not permitted to access this resource.
- `404`: The requested resource does not exist or is not visible to this key.
- `409`: The request conflicts with the current state (e.g. a duplicate).

---

[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)
