curl --request PATCH \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"object": "knowledge_base.access_binding",
"knowledge_base_id": "<string>",
"principal_type": "user",
"principal_id": "<string>",
"role": "owner",
"created_at": 123,
"email": "<string>",
"org_slug": "<string>",
"granted_by": "<string>",
"updated_at": 123
}Change a principal's role
Requires admin+ (or owner).
curl --request PATCH \
--url https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:storage/webhooks/v1/knowledge_bases/{knowledgeBaseId}/access/{principalType}/{principalId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"object": "knowledge_base.access_binding",
"knowledge_base_id": "<string>",
"principal_type": "user",
"principal_id": "<string>",
"role": "owner",
"created_at": 123,
"email": "<string>",
"org_slug": "<string>",
"granted_by": "<string>",
"updated_at": 123
}Authorizations
User session JWT or instance API key (iak_*). Send as Authorization: Bearer <token>.
Path Parameters
Knowledge base id. Legacy physical prefix vs_ (the kb_ rename is deferred).
128^vs_[A-Za-z0-9-]+$Type of access principal. agent is a first-class owner
principal for conversation/agent-owned knowledge bases (§F-6);
principal_id is then the agent id (or its service-account id).
user, group, org, agent Identifier of the principal. For user, the user id; for
group and org, the group/org slug or id resolvable by the
platform.
128Body
admin, editor, reader Response
Updated binding.
Per-knowledge-base access binding, persisted in the
platform-managed product_bindings store (storage owns no
bindings collection). Principals: user, group, org, and
agent - agent ownership is first-class (§F-6). The owner
appears as an explicit role: owner binding; admin / editor
/ reader are grantable via the API (owner is not).
knowledge_base.access_binding ^vs_[A-Za-z0-9-]+$user, group, org, agent 128owner, admin, editor, reader Resolved at read time for user principals.
Was this page helpful?