> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/update_organization_members_role.md).

# 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>

```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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
