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

# Create Shareable Link

> Create a shareable link for an entry

## Overview

Creates a new shareable link for a file or folder. Anyone with the link can access the file based on the permissions you set.

## Path Parameters

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

## Request Body

<ParamField body="password" type="string">
  Optional password protection
</ParamField>

<ParamField body="expires_at" type="string">
  Optional expiration date (ISO 8601 format)
</ParamField>

<ParamField body="allow_edit" type="boolean" default="false">
  Allow editing via the link
</ParamField>

<ParamField body="allow_download" type="boolean" default="false">
  Allow downloading via the link
</ParamField>

## Response

<ResponseField name="link" type="object">
  The created shareable link object
</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/shareable-link \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "password": "secret123",
      "expires_at": "2024-03-01T00:00:00.000000Z",
      "allow_download": true,
      "allow_edit": false
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.drime.cloud/api/v1/file-entries/123456/shareable-link', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      allow_download: true,
      allow_edit: false
    })
  });

  const { link } = await response.json();
  const shareUrl = `https://app.drime.cloud/drive/shares/${link.hash}`;
  console.log('Share URL:', shareUrl);
  ```

  ```python Python theme={null}
  import requests
  from datetime import datetime, timedelta

  # Create link expiring in 7 days
  expires = (datetime.now() + timedelta(days=7)).isoformat()

  response = requests.post(
      'https://app.drime.cloud/api/v1/file-entries/123456/shareable-link',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'expires_at': expires,
          'allow_download': True,
          'allow_edit': False
      }
  )

  link = response.json()['link']
  print(f"Share URL: https://app.drime.cloud/drive/shares/{link['hash']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "link": {
      "id": 789,
      "hash": "3h8N1nxZq7WtyRmXDIosFupSl9MCrD",
      "user_id": 15843,
      "entry_id": 123456,
      "password": "$2y$10$BI8kz6zFeB0CA...",
      "expires_at": "2024-03-01T00:00:00.000000Z",
      "allow_edit": false,
      "allow_download": true
    }
  }
  ```
</ResponseExample>

<Note>
  The share URL format is: `https://app.drime.cloud/drive/shares/{hash}`
</Note>
