Update a user's role and department assignments within an organization.
PATCHhttps://api.aitronos.com/v1/organizations/{organization_id}/users/{user_id}/memberships
Replaces the user's current role and department assignments with the provided lists. Roles and departments not in the new lists are removed; new ones are added.
organization_id string required
The unique identifier of the organization (format: org_*).
user_id string required
The unique identifier of the user (format: usr_*).
role_ids array of strings required
The complete list of role IDs the user should have (format: role_*).
department_ids array of strings required
The complete list of department IDs the user should belong to (format: dept_*).
The updated user object with the new role and department assignments.
cURL
- Bash
- Python
- Python
- JavaScript
curl -X PATCH https://api.aitronos.com/v1/organizations/org_xyz789/users/usr_abc123/memberships \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"role_ids": ["role_admin1", "role_member1"],
"department_ids": ["dept_eng001", "dept_design001"]
}'