---
title: "Add Permissions"
method: POST
path: "/auth/permissions/add"
tags: ["Auth"]
---

# Add Permissions

`POST /auth/permissions/add`

## Request

- Base URL: `https://api.velt.dev/v2`
- URL: `https://api.velt.dev/v2/auth/permissions/add`
- Auth: API key in header `x-velt-api-key` and API key in header `x-velt-auth-token`

Use this API to add permissions to a user for various resources like organizations, folders, documents, etc.

- Can add permissions for multiple resources in a single API call
- The `expiresAt` field is optional

**Access Control:**
Set `accessRole` to `viewer` (read-only) or `editor` (read/write) for each resource.

## Request body

- object
  - `data` object, required
    - `user` object, required
      - `userId` string, required: The ID of the user to add permissions to
    - `permissions` object, required
      - `resources` Resource[], required
        - `type` 'organization' | 'document' | 'folder', required: Type of resource
        - `id` string, required: ID of the resource
        - `organizationId` string: Organization ID (required when type is document or folder)
        - `accessRole` 'viewer' | 'editor': Access role for this resource
        - `expiresAt` integer: Unix timestamp when permission expires (optional)

## Response `200`

Permissions added successfully

- SuccessResponse
  - `result` object
    - `status` 'success'
    - `message` string
    - `data` object: Response data specific to the operation

## Other responses

- `400`: Invalid request

---

[API](https://skmtc.dev/velt-js/apis/velt-rest-api.md) - [All operations](https://skmtc.dev/velt-js/apis/velt-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/velt-js/apis/velt-rest-api/revisions/0f5af15fa267?raw)
