Create multiple access grants for the same entity in a single request.
POSThttps://api.aitronos.com/v1/organizations/{organization_id}/access/grants/bulk
Creates multiple access grants at once for the same entity. Each grant in the grants array specifies a different grantee and access level. This is more efficient than creating grants one at a time.
organization_id string required
The unique identifier of the organization (format: org_*).
entity_type string required
The type of entity to grant access to. Allowed values: knowledge_slice, vector_store, assistant.
entity_id string required
The unique identifier of the entity.
grants array required
An array of grant entries (at least one). Each entry contains:
grantee_type(string, required) — The type of grantee. Allowed values:user,department,role.grantee_id(string, required) — The unique identifier of the grantee.access_level(string, required) — The level of access. Allowed values:read,write,admin.
An array of the newly created access grant objects (HTTP 201).
cURL
- Bash
- Python
- Python
- JavaScript
curl -X POST https://api.aitronos.com/v1/organizations/org_xyz789/access/grants/bulk \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"entity_type": "knowledge_slice",
"entity_id": "kslice_abc123",
"grants": [
{
"grantee_type": "user",
"grantee_id": "usr_def456",
"access_level": "read"
},
{
"grantee_type": "department",
"grantee_id": "dept_ghi789",
"access_level": "write"
}
]
}'