# update\_organization\_members\_role

`imerit_ango.sdk.SDK.`

## update\_organization\_members\_role(organization\_id, role\_updates)

Change the roles of specified members in your organization.

### Parameters

* **organization\_id:** string
  * The unique identifier for the organization. You can find the organization ID in [the user interface](/sdk/sdk-documentation.md#organization-ids).
* **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: `"user1@example.com"`
    * **organization\_role**: OrganizationRoles
      * The new role assigned to the member within the organization. Options include:
        * <kbd>OrganizationRoles.Member</kbd>
        * <kbd>OrganizationRoles.Admin</kbd>&#x20;

```python
from imerit_ango.models.invite import RoleUpdate
from imerit_ango.models.enums import OrganizationRoles
```

Returns:

* **output:** dict
  * A dictionary containing the result of the operation.
  * Including a `status` field indicating whether the request was successful and a `data` field containing the response payload with updated resources produced by the operation.

{% hint style="warning" %}
The email addresses provided in role\_updates must belong to existing organization members.
{% endhint %}

<details open>

<summary><strong>How to verify in Ango Hub?</strong></summary>

After successfully executing the `update_organization_members_role` function, you can validate the changes directly in Ango Hub.

Navigate to: **Organization → Members**

* Confirm that the invited members appear in the list under the invitations.
* Ensure that each user has been invited with the correct role assigned

{% hint style="info" %}
Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.
{% endhint %}

</details>

### Example

{% tabs %}
{% tab title="python" %}

```python
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="user1@example.com", organization_role=OrganizationRoles.Admin)
role_update_2 = RoleUpdate(email="user2@example.com", organization_role=OrganizationRoles.Admin)

sdk_response = ango_sdk.update_organization_members_role(
    organization_id=organization_id,
    role_updates=[role_update_1, role_update_2]
)
```

{% endtab %}

{% tab title="curl" %}

```bash
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": "user1@example.com",
        "organizationRole": "admin"
      },
      {
        "email": "user2@example.com",
        "organizationRole": "admin"
      }
    ]
  }'
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**See also**

[get\_organization\_members](/sdk/sdk-documentation/organization-level-sdk-functions/get_organization_members.md), [delete\_organization\_members](/sdk/sdk-documentation/organization-level-sdk-functions/delete_organization_members.md)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/update_organization_members_role.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
