Share a file or folder with one person by email
const url = 'https://shareout.site/v1/workspaces/example/share-person';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","resource_type":"file","resource_id":"example","capability":"view","expires_in_days":1,"expires_at":"example","guest":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://shareout.site/v1/workspaces/example/share-person \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "resource_type": "file", "resource_id": "example", "capability": "view", "expires_in_days": 1, "expires_at": "example", "guest": false }'Admin, or the folder’s manager for a folder. Only the role is relaxed for a manager: every share needs the external-sharing entitlement (Teams/Enterprise, or the collab.external_sharing feature on self-host; 403 EXTERNAL_SHARING_NOT_ENTITLED) and an email the workspace’s allowed domains or emails accept (403 DOMAIN_NOT_ALLOWED). Invites an external user if needed and mints an external_user grant; re-sharing is idempotent and replaces the expiry. For a folder, the invite email’s join link carries ?folder=<id> through sign-in and lands on /shared?folder=<id> (that folder’s branded portal); an already-active person’s email links there too. Returns 409 if the email is already an internal member. With guest: true (folders only) no account is created: a guest grant whose subject is the email itself, and an emailed link that opens the folder in a space-guest session. The guest can also open it from /shared?folder=<id> with an email code. They see that folder’s subtree only, up to the capability; revoking or expiring the grant ends their session on the next request.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Workspace ID or slug.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Access ends this many days from now (UI presets 7/30/90). Wins over expires_at.
ISO date-time (or YYYY-MM-DD = end of that day, UTC) when access ends. Omit both for no expiry; a re-share replaces the previous expiry.
Folders only. Share as a guest with no account (subject_type guest); the person gets an emailed link instead of an invite.
Responses
Section titled “Responses”Grant created (idempotent re-share)
object
object
Sharee id, users.id, or for a guest grant the guest’s email.
When access ends (share-with-a-person expiry); null = never. A lapsed grant is denied at read time.
The person’s email or the client’s name (list endpoint).
Present and true for a guest share.
Guest shares only — whether the link email went out.
Example
{ "grant": { "subject_type": "sharee", "resource_type": "folder", "capability": "view" }}VALIDATION_ERROR — bad email, resource, capability or expiry
Access denied
object
Human-readable message.
Machine-readable error code.
Correlation id (also the X-Request-Id header). Quote it in support tickets.
Finer cause under code. For UNAUTHORIZED: missing, invalid, revoked or expired.
What to do next, in plain words.
The request field at fault.
Doc page for this error.
Present on 5xx — how to reach a human.
object
Example
{ "success": false, "support": { "how": "POST /v1/support/tickets", "include": [ "request_id" ] }}Email is already an internal workspace member
