# 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](https://docs.imerit.net/sdk/sdk-documentation/..#organization-ids).
* **role\_updates:** List\[RoleUpdate]
  * A list of role updates for the members. Each RoleUpdate object contains the following attributes:
  * **RoleUpdate**&#x20;
    * **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>

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 %}

### 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](https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/get_organization_members), [delete\_organization\_members](https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/delete_organization_members)
{% endhint %}
