update_organization_members_role
imerit_ango.sdk.SDK.
update_organization_members_role(organization_id, role_updates)
Modify the roles of specified members within the organization.
Parameters
organization_id: string
The unique identifier for the organization. You can find the organization ID in the user interface.
role_updates: List[RoleUpdate]
A list of role updates for the members. Each RoleUpdate object contains the following attributes:
RoleUpdate
email: string
The email address of the member whose role is to be updated.
Example:
"[email protected]"
organization_role: OrganizationRoles
The new role assigned to the member within the organization. Options include:
OrganizationRoles.Member
OrganizationRoles.Admin
Returns:
output: dict
A dictionary containing the result of the operation.
The email addresses provided in role_updates must belong to existing organization members.
Example
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.invite import RoleUpdate
from imerit_ango.models.enums import OrganizationRoles
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
role_update_1 = RoleUpdate(email="[email protected]", organization_role=OrganizationRoles.Admin)
role_update_2 = RoleUpdate(email="[email protected]", organization_role=OrganizationRoles.Admin)
sdk_response = ango_sdk.update_organization_members_role(organization_id=organization_id,
role_updates=[role_update_1, role_update_2])curl -X POST "https://imeritapi.ango.ai/v2/organization/$ORGANIZATION_ID/users" \
-H "Content-Type: application/json" \
-H "apikey: $ANGO_API_KEY" \
-d '{
"users": [
{
"email": "[email protected]",
"organizationRole": "admin"
},
{
"email": "[email protected]",
"organizationRole": "admin"
}
]
}'Last updated