# Get users with access Get all users who have access to a specific entity, along with their effective access levels. Returns all users who have access to the specified entity, including their effective access level and the grant paths that explain how access was derived (direct grants, department membership, role assignment, or composite slice membership). > **Alternate path:** This endpoint is also available at `GET /v1/organizations/{organization_id}/knowledge/users-with-access` with the same parameters and response. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). #### Query Parameters **`entity_type`** string required The type of entity. Allowed values: `knowledge_slice`, `vector_store`, `assistant`. **`entity_id`** string required The unique identifier of the entity. ## Returns A response containing `entity_type`, `entity_id`, and a `users` array. Each user entry includes `user_id`, `access_level` (the highest effective level), and `grant_paths` explaining how access was derived. Request ```bash cURL curl -s -X GET "https://api.aitronos.com/v1/organizations/org_xyz789/access/users-with-access?entity_type=knowledge_slice&entity_id=kslice_abc123" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.access_control.get_users_with_access( organization_id="org_xyz789", entity_type="knowledge_slice", entity_id="kslice_abc123", ) print(result) ``` ```python Python import requests org_id = "org_xyz789" url = f"https://api.aitronos.com/v1/organizations/{org_id}/access/users-with-access" headers = {"Authorization": "Bearer YOUR_ACCESS_TOKEN"} params = { "entity_type": "knowledge_slice", "entity_id": "kslice_abc123", } response = requests.get(url, headers=headers, params=params) print(response.json()) ``` ```javascript JavaScript const orgId = "org_xyz789"; const params = new URLSearchParams({ entity_type: "knowledge_slice", entity_id: "kslice_abc123", }); const response = await fetch( `https://api.aitronos.com/v1/organizations/${orgId}/access/users-with-access?${params}`, { headers: { "Authorization": `Bearer ${accessToken}`, }, } ); const data = await response.json(); console.log(data); ``` Response ```json 200 OK { "entity_type": "knowledge_slice", "entity_id": "kslice_abc123", "users": [ { "user_id": "usr_def456", "access_level": "write", "grant_paths": [ { "type": "direct", "access_level": "read", "department_id": null, "role_id": null, "composite_id": null }, { "type": "department", "access_level": "write", "department_id": "dept_eng01", "role_id": null, "composite_id": null } ] }, { "user_id": "usr_ghi789", "access_level": "admin", "grant_paths": [ { "type": "role", "access_level": "admin", "department_id": null, "role_id": "role_admin01", "composite_id": null } ] } ] } ``` ```json 422 Error { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The request contains invalid data.", "system_message": "Validation error", "type": "client_error", "status": 422, "details": { "field": "entity_type", "message": "This field is required" }, "trace_id": "abc-123-def", "timestamp": "2025-11-02T08:21:45Z" } } ``` ## Related Resources - [List Grants](/docs/api-reference/access-control/list-grants) - [Create Grant](/docs/api-reference/access-control/create-grant) - [Bulk Create Grants](/docs/api-reference/access-control/bulk-create-grants) - [Update Grant](/docs/api-reference/access-control/update-grant) - [Revoke Grant](/docs/api-reference/access-control/revoke-grant) - [Slice Grants](/docs/api-reference/access-control/slice-grants) - [Store Grants](/docs/api-reference/access-control/store-grants) - [Assistant Grants](/docs/api-reference/access-control/assistant-grants) - [Resolved Access](/docs/api-reference/access-control/resolved-access)