Create a grant
const url = 'https://shareout.site/v1/workspaces/example/grants';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"subject_type":"sharee","subject_id":"example","resource_type":"folder","resource_id":"example","capability":"view"}'};
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/grants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "subject_type": "sharee", "subject_id": "example", "resource_type": "folder", "resource_id": "example", "capability": "view" }'Workspace admins, with the external-sharing entitlement (403 EXTERNAL_SHARING_NOT_ENTITLED otherwise).
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
Responses
Section titled “Responses”Created
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).
Example
{ "subject_type": "sharee", "resource_type": "folder", "capability": "view"}Invalid request
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" ] }}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" ] }}