# Remove role member Remove a user from a role within an organization. The last owner of an organization cannot be removed from the Owner role. #### Path Parameters **`organization_id`** string required Organization ID (org_ prefixed string). **`role_id`** string required Role ID (role_ prefixed string). **`user_id`** string required User ID to remove from the role (usr_ prefixed string). ## Returns No content (204) on success. Request ```bash cURL curl -X DELETE "https://api.aitronos.com/v1/organizations/org_abc123/roles/role_xyz789/members/usr_target456" \ -H "Authorization: Bearer $ACCESS_TOKEN" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") client.organizations.roles.remove_member( organization_id="org_abc123", role_id="role_xyz789", user_id="usr_target456", ) ``` ```python Python import requests response = requests.delete( "https://api.aitronos.com/v1/organizations/org_abc123/roles/role_xyz789/members/usr_target456", headers={"Authorization": "Bearer YOUR_ACCESS_TOKEN"}, ) print(response.status_code) # 204 ``` ```javascript JavaScript const response = await fetch( "https://api.aitronos.com/v1/organizations/org_abc123/roles/role_xyz789/members/usr_target456", { method: "DELETE", headers: { Authorization: "Bearer YOUR_ACCESS_TOKEN" }, } ); console.log(response.status); // 204 ``` Response ```text 204 No Content (empty response body) ``` ```json 422 Validation Error { "success": false, "error": { "code": "LAST_OWNER_CANNOT_BE_REMOVED", "message": "Cannot remove the last owner from a role. At least one owner must remain.", "system_message": "cannot remove the last owner from a role. at least one owner must remain.", "type": "validation_error", "status": 422, "details": { "user_id": "usr_target456", "role_id": "role_owner123", "organization_id": "org_abc123" }, "trace_id": "abc-123-def", "timestamp": "2026-01-15T10:30:00Z" } } ``` ```json 404 Not Found { "success": false, "error": { "code": "ROLE_ASSIGNMENT_NOT_FOUND", "message": "No role assignment was found for this user and role.", "system_message": "no role assignment was found for this user and role.", "type": "client_error", "status": 404, "details": { "user_id": "usr_nonexistent", "role_id": "role_xyz789" }, "trace_id": "abc-123-def", "timestamp": "2026-01-15T10:30:00Z" } } ``` ## Related Resources - [Retrieve role](/docs/api-reference/organizations/roles/retrieve) - [Delete custom role](/docs/api-reference/organizations/roles/delete-role) - [List role members](/docs/api-reference/organizations/roles/list-members) - [Assign role member](/docs/api-reference/organizations/roles/assign-member) - [Effective permissions](/docs/api-reference/organizations/roles/effective-permissions)