# Update access grant Update the access level of an existing access grant. Updates the access level of an existing grant. Only the `access_level` field can be modified. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). **`grant_id`** string required The unique identifier of the access grant (format: `agrant_*`). #### Request Body **`access_level`** string required The new access level. Allowed values: `read`, `write`, `admin`. ## Returns The updated access grant object. Request ```bash cURL curl -X PATCH https://api.aitronos.com/v1/organizations/org_xyz789/access/grants/agrant_abc123def456 \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "access_level": "write" }' ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.access_control.update_grant( organization_id="org_xyz789", grant_id="agrant_abc123def456", access_level="write", ) print(result) ``` ```python Python import requests org_id = "org_xyz789" grant_id = "agrant_abc123def456" url = f"https://api.aitronos.com/v1/organizations/{org_id}/access/grants/{grant_id}" headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json", } data = {"access_level": "write"} response = requests.patch(url, headers=headers, json=data) print(response.json()) ``` ```javascript JavaScript const orgId = "org_xyz789"; const grantId = "agrant_abc123def456"; const response = await fetch( `https://api.aitronos.com/v1/organizations/${orgId}/access/grants/${grantId}`, { method: "PATCH", headers: { "Authorization": `Bearer ${accessToken}`, "Content-Type": "application/json", }, body: JSON.stringify({ access_level: "write" }), } ); const data = await response.json(); console.log(data); ``` Response ```json 200 OK { "id": "agrant_abc123def456", "entity_type": "knowledge_slice", "entity_id": "kslice_abc123", "grantee_type": "user", "grantee_id": "usr_def456", "access_level": "write", "granted_by": "usr_owner1", "organization_id": "org_xyz789", "created_at": "2025-06-15T10:00:00Z", "updated_at": "2025-06-15T12:30:00Z" } ``` ```json 404 Error { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "We couldn't find the resource you're looking for.", "system_message": "Access grant not found", "type": "client_error", "status": 404, "details": { "grant_id": "agrant_abc123def456" }, "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) - [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) - [Users with Access](/docs/api-reference/access-control/users-with-access)