> 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/invite_members_to_org.md).

# 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](/sdk/sdk-documentation.md#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](/sdk/sdk-documentation.md#project-ids) or retrieve it using the [`list_projects`](/sdk/sdk-documentation/project-level-sdk-functions/list_projects.md) 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>

```python
from imerit_ango.models.invite import Invitation, ProjectAssignment
from imerit_ango.models.enums import OrganizationRoles, ProjectRoles
```

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.

<details open>

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

After successfully executing the `invite_members_to_org` 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 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](/sdk/sdk-documentation/organization-level-sdk-functions/update_organization_members_role.md), [get\_organization\_invites](/sdk/sdk-documentation/organization-level-sdk-functions/get_organization_invites.md), [add\_members\_to\_project](/sdk/sdk-documentation/project-level-sdk-functions/add_members_to_project.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/invite_members_to_org.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.
