> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drime.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Permissions

> Update permissions for a shared user

## Overview

Changes the permissions a user has for a shared file or folder.

## Path Parameters

<ParamField path="entryId" type="integer" required>
  ID of the shared file or folder
</ParamField>

## Request Body

<ParamField body="userId" type="integer" required>
  ID of the user whose permissions to change
</ParamField>

<ParamField body="permissions" type="array" required>
  New permissions to assign

  * `view` - Can view the file/folder
  * `edit` - Can modify the file/folder
  * `download` - Can download the file
</ParamField>

## Response

<ResponseField name="users" type="array">
  Updated list of users with access
</ResponseField>

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PUT https://app.drime.cloud/api/v1/file-entries/123456/change-permissions \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "userId": 12345,
      "permissions": ["view"]
    }'
  ```

  ```javascript JavaScript theme={null}
  // Downgrade user to view-only
  const response = await fetch('https://app.drime.cloud/api/v1/file-entries/123456/change-permissions', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      userId: 12345,
      permissions: ['view']
    })
  });

  const { users } = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.put(
      'https://app.drime.cloud/api/v1/file-entries/123456/change-permissions',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'userId': 12345,
          'permissions': ['view']
      }
  )

  users = response.json()['users']
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "users": [
      {
        "id": 12345,
        "email": "colleague@example.com",
        "display_name": "John Doe"
      }
    ]
  }
  ```
</ResponseExample>
