Skip to main content
PUT
Share with a user (upsert)

Authorizations

scribe_session
string
cookie
required

Browser session cookie set by the WorkOS sign-in flow.

Path Parameters

id
string
required

Id of the document to share.

userId
string
required

User id to grant the role to.

Body

application/json

The role to grant.

Role to grant to the user on this document.

role
enum<string>
required

Role level to set for the user on the document.

Available options:
viewer,
commenter,
editor
Example:

"editor"

Response

The share entry after the grant or role update.

A per-user share entry on a document.

userId
string
required

User id the document is shared with.

Example:

"usr_3fGhJkLmNpQrStUvWx5y"

email
string<email>
required

Email of that user.

name
string | null
required

Display name of that user.

Example:

"Grace Hopper"

role
enum<string>
required

Per-document share role.

Available options:
viewer,
commenter,
editor
Example:

"editor"

createdAt
integer
required

When the share was granted (epoch milliseconds).

Example:

1752624000000