Update a member's role and/or status. #### Path Parameters **`organization_id`** string required Organization ID **`user_id`** string required User ID (`usr_...`) or OrganizationUser ID (`orgusr_...`) of the member to update #### Request Body **`role_id`** string optional New role ID **`status_id`** string optional New status ID At least one of `role_id` or `status_id` must be provided. ## Returns Returns the updated member object. ## Notes - Creates an audit log entry - Cannot change organization owner's role - Cannot set owner to inactive status ## Authorization Requires Admin or Owner role. ```bash curl -X PUT https://api.aitronos.com/v1/organizations/org_abc123/users/usr_xyz789 \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "role_id": "role_abc123", "status_id": "status_xyz789" }' ``` ```python import requests import os api_key = os.environ["FREDDY_API_KEY"] org_id = "org_abc123" user_id = "usr_xyz789" response = requests.put( f"https://api.aitronos.com/v1/organizations/{org_id}/users/{user_id}", headers={ "X-API-Key": api_key, "Content-Type": "application/json" }, json={ "role_id": "role_abc123", "status_id": "status_xyz789" } ) member = response.json() ``` ```javascript const response = await fetch('https://api.aitronos.com/v1/organizations/org_abc123/users/usr_xyz789', { method: 'PUT', headers: { 'Authorization': `Bearer ${process.env.FREDDY_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ role_id: 'role_abc123', status_id: 'status_xyz789' }) }); const member = await response.json(); ``` **Response:** 200 OK ```json { "id": "orguser_abc123", "user_id": "usr_xyz789", "organization_id": "org_def456", "full_name": "John Doe", "email": "john@example.com", "username": "johndoe", "role": { "id": "role_abc123", "name": "Member" }, "status": { "id": "status_xyz789", "name": "Active", "selectable_in_ui": true }, "joined_at": "2025-01-15T10:30:00Z", "created_at": "2025-01-15T10:30:00Z", "last_modified_at": "2025-01-20T14:45:00Z" } ``` 403 Forbidden ```json { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "Cannot change organization owner's role", "status": 403 } } ```