---
title: "Create share-link"
method: POST
path: "/2/drive/{drive_id}/files/{file_id}/link"
tags: ["Drive > Files > Share link > Manage"]
---

# Create share-link

`POST /2/drive/{drive_id}/files/{file_id}/link`

Create a share link

## Path parameters

- `drive_id` integer, required
- `file_id` integer, required

## Query parameters

- `with` string

## Request body

- object
  - `can_comment` boolean — Allow users to to comment the shared files. It takes the same value as can_edit if unset or null
  - `can_download` boolean — Allow users to download shared content
  - `can_edit` boolean — Allow users to edit the file content using the shared link
  - `can_request_access` boolean — Allow connected users to join the folder via the shared link. It is not possible to join a file via a shared link
  - `can_see_info` boolean — Allow users to see information about the shared files
  - `can_see_stats` boolean — Allow users to see statistics
  - `password` string — The password if the permission password is set
  - `right` 'inherit' | 'password' | 'public', required — Permission of the shared link: no restriction (public), access by authenticated and authorized user (inherit) or public but protected by a password (password)
  - `valid_until` integer, nullable — Maximum validity timestamp of the shared link

## Response `201`

Created

- object
  - `result` 'success' | 'error' | 'asynchronous', required — Result of the HTTP request
  - `data` 91ac10ffShareLink
    - `url` string, required — Share link url
    - `file_id` integer, required
    - `right` 'inherit' | 'password' | 'public', required — Rights required to view the share link.<note><strong>inherit</strong>: Share link is accessible only by users of the drive.</note><note><strong>password</strong>: Share link is public but protected by a password.</note><note><strong>public</strong>: Share link is public, no restriction set.</note>
    - `valid_until` integer, nullable, required — Until when the share link is valid
    - `created_by` integer, required — Unique identifier of the creator of the resource `Share Link`
    - `created_at` integer, nullable, required — Timestamp `Share Link` was created at
    - `updated_at` integer, nullable, required — Timestamp `Share Link` was updated at
    - `capabilities` object, required
      - `can_edit` boolean, required — Does share link allow editing
      - `can_see_stats` boolean, required — Does share link allow stats to be seen
      - `can_see_info` boolean, required — Does share link allow info to be seen
      - `can_download` boolean, required — Does share link allow download
      - `can_comment` boolean, required — Does share link allow adding comments
      - `can_request_access` boolean, required — Does share link allow user to request access to folder
    - `access_blocked` boolean, required — If the share link is blocked
    - `views` integer, nullable — Number of views of share link (last 180 days only)

## Other responses

- `403` — Forbidden
- `503` — Service Unavailable

---

[API](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools.md) · [All operations](https://skmtc.dev/infomaniak/apis/api-reference-developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infomaniak/api-reference-developer-tools/revisions/667aae28fec6/schema)
