Skip to main content
POST
/
v2
/
{subjectType}
/
{subjectId}
/
permissions
Share
curl --request POST \
  --url https://api.studio.prisme.ai/v2/{subjectType}/{subjectId}/permissions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "target": {
    "id": "<string>",
    "public": true,
    "role": "<string>",
    "displayName": "<string>"
  },
  "permissions": {
    "role": "<string>",
    "policies": {
      "read": true,
      "write": true,
      "update": true,
      "create": true,
      "manage_permissions": true
    }
  }
}
'
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
target: {id: '<string>', public: true, role: '<string>', displayName: '<string>'},
permissions: {
role: '<string>',
policies: {read: true, write: true, update: true, create: true, manage_permissions: true}
}
})
};

fetch('https://api.studio.prisme.ai/v2/{subjectType}/{subjectId}/permissions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.studio.prisme.ai/v2/{subjectType}/{subjectId}/permissions"

payload = {
"target": {
"id": "<string>",
"public": True,
"role": "<string>",
"displayName": "<string>"
},
"permissions": {
"role": "<string>",
"policies": {
"read": True,
"write": True,
"update": True,
"create": True,
"manage_permissions": True
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "target": {
    "id": "<string>",
    "public": true,
    "role": "<string>",
    "displayName": "<string>"
  },
  "permissions": {
    "role": "<string>",
    "policies": {
      "read": true,
      "write": true,
      "update": true,
      "create": true,
      "manage_permissions": true
    }
  }
}
{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}
{
"error": "AuthenticationError",
"message": "Unauthenticated"
}
{
"error": "ForbiddenError",
"message": "Forbidden"
}
{
"error": "ObjectNotFound",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

subjectType
enum<string>
required

The target subject type

Available options:
pages,
workspaces
subjectId
string
required

The target subject id (i.e workspaceId if subjectType is 'workspace')

Body

application/json
target
object
required
permissions
object
required

Response

Success Response

target
object
required
permissions
object
required