---
title: "Create/Update Document User Collaborator"
method: PUT
path: "/v1/documents/{id}/shares/users/{userId}"
tags: ["Documents Collaboration"]
---

# Create/Update Document User Collaborator

`PUT /v1/documents/{id}/shares/users/{userId}`

Updates the collaborator role for a user on a document. If the user did not previously have access to the document, they will be granted access and a new collaborator record will be created.

## Path parameters

- `id` string, uuid, required
- `userId` number, required

## Request body

- object
  - `role` 'editandshare' | 'edit' | 'comment' | 'view' — The Collaborator Role to assign to the user for this document.

## Response `200`

OK when updating an existing Document User Collaborator. Contains the updated Document User Collaborator Resource.

- DocumentUserCollaborator
  - `documentId` string, uuid, required — Document ID
  - `userId` integer, required — User ID
  - `role` 'owner' | 'editandshare' | 'edit' | 'comment' | 'view', required — The Collaborator Role on the document or folder
  - `created` string, date-time, required — Date and time when the collaboration was created

## Other responses

- `201` — Created when creating a new Document User Collaborator. Contains the new Document User Collaborator Resource.
- `403` — Forbidden if the token does not have permission to the document, or if the document has been deleted or does not exist.

---

[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)
