---
title: "Update Document Share Link"
method: PATCH
path: "/v1/documents/{id}/shares/shareLinks/{shareLinkId}"
tags: ["Documents Sharing"]
---

# Update Document Share Link

`PATCH /v1/documents/{id}/shares/shareLinks/{shareLinkId}`

Updates an existing share link's configuration settings on a document. Share links will only be updatable by the OAuth2.0 client that created them. All fields are optional; omitted settings retain their existing values.

## Path parameters

- `id` string, uuid, required
- `shareLinkId` string, required

## Request body

- object
  - `role` 'editandshare' | 'edit' | 'comment' | 'view' — Roles determine what actions an invitation will grant on a document. Invitations to a document only grant the specified level of access to just that one document. If a link's role is changed, the new role applies immediately to all users who accessed via that link. - `editandshare`: View, comment on, edit, and control which users can access the document. - `edit`: View, comment on, and edit the document. - `comment`: View the document. Leave comments on the document. - `view`: View the document.
  - `linkSecurity` DocumentLinkSecurity
    - `restrictToAccount` boolean, required — Whether or not users outside the document's account can accept the share link. Changing this value to true will immediately revoke access for any external users who previously gained access through this link.
    - `expires` string, date-time — If defined, the date and time the share link expires.
    - `passcode` string — If defined, the required passcode to accept the share link. The passcode length must be between 1 – 80 characters.
    - `allowAnonymous` boolean, required — Whether or not the share link allows for anonymous guests.

## Response `200`

OK with a Document Share Link resource containing information about the updated share link.

- DocumentShareLink
  - `shareLinkId` string, required — Id of the share link.
  - `documentId` string, uuid, required — Id of the document the share link belongs to.
  - `role` 'editandshare' | 'edit' | 'comment' | 'view', required — Roles determine what actions an invitation will grant on a document. Invitations to a document only grant the specified level of access to just that one document. If a link's role is changed, the new role applies immediately to all users who accessed via that link. - `editandshare`: View, comment on, edit, and control which users can access the document. - `edit`: View, comment on, and edit the document. - `comment`: View the document. Leave comments on the document. - `view`: View the document.
  - `linkSecurity` DocumentLinkSecurity, required
    - `restrictToAccount` boolean, required — Whether or not users outside the document's account can accept the share link. Changing this value to true will immediately revoke access for any external users who previously gained access through this link.
    - `expires` string, date-time — If defined, the date and time the share link expires.
    - `passcode` string — If defined, the required passcode to accept the share link. The passcode length must be between 1 – 80 characters.
    - `allowAnonymous` boolean, required — Whether or not the share link allows for anonymous guests.
  - `created` string, date-time, required — The date and time the share link was created.
  - `createdBy` number, required — User Id of the user that created the share link.
  - `lastModified` string, date-time, required — The date and time the share link was last modified.
  - `acceptUrl` string, uri, required — Link to accept the share link invitation.

## Other responses

- `400` — Bad Request if the the document does not belong to an enterprise account and the restrictToAccount is set to true, defines a passcode, or defines an expiration or the allowAnonymous field is set to true on non-Lucidspark/Lucidchart documents.
- `403` — Forbidden if the app making the request does not have permission to the document, or if the document has been deleted, or does not exist.
- `404` — Not Found if the share link id with the specified document id does not belong to the document, does not exist, or the requesting app did not create the share link.

---

[API](https://skmtc.net/lucid/apis/lucid-rest-api.md) · [All operations](https://skmtc.net/lucid/apis/lucid-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lucid/lucid-rest-api/revisions/6a32cb9e1aa7/schema)
