Skip to main content
POST
Share with a user by email

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 by email.

Body

application/json

Email of the user and the role to grant.

Share the document with a user addressed by email.

email
string<email>
required

Email address to share with. Unknown addresses receive a sign-up invitation.

role
enum<string>
required

Role to grant to the user matched by email.

Available options:
viewer,
commenter,
editor
Example:

"editor"

Response

The share entry created for the user matched by email.

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