# invite\_members\_to\_org

`imerit_ango.sdk.SDK.`

## invite\_members\_to\_org(organization\_id, invite\_data)

Send invitations to new members to join 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).
* **invite\_data:** Invitation
  * An Invitation object containing the invitation details, with the following attributes:
  * **to:** List\[str]
    * List of email addresses of the invited members
  * **organization\_role:** OrganizationRoles
    * The role assigned to the invited members within the organization. Options include:
      * OrganizationRoles.Admin
      * OrganizationRoles.Member
  * **project\_assignments:** List\[ProjectAssignment], *Optional, default None*
    * **ProjectAssignment**
      * **project\_id:** string
        * The unique identifier for the project. You can find the project ID in [the user interface](https://docs.imerit.net/sdk/sdk-documentation/..#project-ids) or retrieve it using the [`list_projects`](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/list_projects) function.
      * **project\_role:** ProjectRoles
        * The role assigned to the invited members within the project. Options include:
          * <kbd>ProjectRoles.Manager</kbd>
          * <kbd>ProjectRoles.Labeler</kbd>
          * <kbd>ProjectRoles.Reviewer</kbd>
          * <kbd>ProjectRoles.Lead</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.

### 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 Invitation, ProjectAssignment
from imerit_ango.models.enums import OrganizationRoles, ProjectRoles

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')

ango_sdk = SDK(api_key)

project_assignment_1 = ProjectAssignment(project_id="PROJECT_ID_1", project_role=ProjectRoles.Labeler),
project_assignment_2 = ProjectAssignment(project_id="PROJECT_ID_2", project_role=ProjectRoles.Reviewer)

project_assignments = [project_assignment_1, project_assignment_2]

invitation = Invitation(
    to=["user_1@imerit.net", "user_2@imerit.net"],
    organization_role=OrganizationRoles.Member,
    project_assignments=project_assignments
)

response = ango_sdk.invite_members_to_org(
    organization_id=organization_id,
    invite_data=invitation
)
```

{% endtab %}

{% tab title="curl" %}

```bash
curl -X POST "https://imeritapi.ango.ai/v2/organization/$ORGANIZATION_ID/invites" \
  -H "Content-Type: application/json" \
  -H "apikey: $ANGO_API_KEY" \
  -d '{
    "organizationRole": "member",
    "projectAssignments": [
      {
        "projectId": "PROJECT_ID_1",
        "projectRole": "Labeler"
      },
      {
        "projectId": "PROJECT_ID_2",
        "projectRole": "Reviewer"
      }
    ],
    "to": [
      "user_1@imerit.net",
      "user_2@imerit.net"
    ]
  }'
```

{% endtab %}
{% endtabs %}

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

[update\_organization\_members\_role](https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/update_organization_members_role), [get\_organization\_invites](https://docs.imerit.net/sdk/sdk-documentation/organization-level-sdk-functions/get_organization_invites), [add\_members\_to\_project](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/add_members_to_project)
{% endhint %}
