Create a grant
POST
/v1/workspaces/{workspaceId}/grants
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" }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” workspaceId
required
string
Workspace ID or slug.
Request Body required
Section titled “Request Body required ” Media type application/json
object
subject_type
required
string
subject_id
required
string
resource_type
required
string
resource_id
required
string
capability
required
string
Responses
Section titled “ Responses ”Created
Media type application/json
object
id
string
subject_type
string
subject_id
string
resource_type
string
resource_id
string
capability
string
Example
{ "subject_type": "sharee", "resource_type": "folder", "capability": "view"}Invalid request
Media type application/json
object
success
required
boolean
error
required
Human-readable message.
string
code
required
Machine-readable error code.
string
Example
{ "success": false}Access denied
Media type application/json
object
success
required
boolean
error
required
Human-readable message.
string
code
required
Machine-readable error code.
string
Example
{ "success": false}