> ## 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.

# Share Entry

> Share a file or folder with other users

## Overview

Shares a file or folder with specified users by email. You can grant different permission levels to collaborators.

## Path Parameters

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

## Request Body

<ParamField body="emails" type="array" required>
  Array of email addresses to share with
</ParamField>

<ParamField body="permissions" type="array" required>
  Permissions to grant

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

## Response

<ResponseField name="users" type="array">
  Array of users the entry is now shared with
</ResponseField>

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://app.drime.cloud/api/v1/file-entries/123456/share \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "emails": ["colleague@example.com", "team@example.com"],
      "permissions": ["view", "download"]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.drime.cloud/api/v1/file-entries/123456/share', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      emails: ['colleague@example.com'],
      permissions: ['view', 'edit', 'download']
    })
  });

  const { users } = await response.json();
  console.log('Shared with:', users.map(u => u.email));
  ```

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

  response = requests.post(
      'https://app.drime.cloud/api/v1/file-entries/123456/share',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'emails': ['colleague@example.com'],
          'permissions': ['view', 'edit', 'download']
      }
  )

  users = response.json()['users']
  print(f"Shared with: {[u['email'] for u in users]}")
  ```
</RequestExample>

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

  ```json 422 - Validation Error theme={null}
  {
    "status": "error",
    "message": "The given data was invalid.",
    "errors": {
      "emails": "Invalid email address provided."
    }
  }
  ```
</ResponseExample>
