Grant access
curl --request POST \
--url https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"principal_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({principal_id: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access"
payload = { "principal_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "collection.access",
"collection_id": "<string>",
"principal_type": "user",
"principal_id": "<string>",
"role": "owner",
"email": "<string>"
}{
"error": "InvalidArguments",
"message": "<string>"
}{
"error": "InvalidArguments",
"message": "<string>"
}Sharing
Grant access
Grants a role to a principal within the same organization. The principal must be a member of the caller’s org (users and groups are verified via governance). Cross-org principals are rejected.
POST
/
v1
/
collections
/
{collection_id}
/
access
Grant access
curl --request POST \
--url https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"principal_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({principal_id: '<string>'})
};
fetch('https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks/v1/collections/{collection_id}/access"
payload = { "principal_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "collection.access",
"collection_id": "<string>",
"principal_type": "user",
"principal_id": "<string>",
"role": "owner",
"email": "<string>"
}{
"error": "InvalidArguments",
"message": "<string>"
}{
"error": "InvalidArguments",
"message": "<string>"
}Authorizations
BearerAuthOrgApiKeyAuth
User session JWT. Send as Authorization: Bearer <token>.
Path Parameters
Collection identifier returned at creation.
Body
application/json
Was this page helpful?