---
title: "Create/Update Folder User Collaborator"
method: PUT
path: "/v1/folders/{id}/shares/users/{userId}"
tags: ["Folders Collaboration"]
---

# Create/Update Folder User Collaborator

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

## Request

- Base URL: `https://api.lucid.co`
- URL: `https://api.lucid.co/v1/folders/{id}/shares/users/{userId}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://lucid.app/oauth2/authorize`
    - Token URL: `https://api.lucid.co/oauth2/token` scopes: `folder`
- TypeScript: <https://skmtc.dev/lucid/apis/lucid-rest-api/docs/v1/folders/:id/shares/users/:userId/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates or establishes a user's collaborator access to a given folder. If the user does not already have access, a new Folder User Collaborator Resource is created. Collaborators cannot be given the role "owner", and the role of the folder's owner cannot be modified.

## Path parameters

- `id` number, required
- `userId` number, required

## Request body

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

## Response `200`

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

- FolderUserCollaborator
  - `folderId` integer, required: Folder 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 Folder User Collaborator. Contains the new Folder User Collaborator Resource.
- `400`: Bad Request when trying to add or update a Folder User Collaborator to have the "owner" role.
- `403`: Forbidden if the token does not have permission to the folder, or if the folder has been deleted or does not exist.

---

[API](https://skmtc.dev/lucid/apis/lucid-rest-api.md) - [All operations](https://skmtc.dev/lucid/apis/lucid-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/lucid/apis/lucid-rest-api/revisions/9c2c917ec59c?raw)
