invite_members_to_org

imerit_ango.sdk.SDK.

invite_members_to_org(organization_id, invite_data)

Send invitations to new members to join the specified organization.

Parameters

  • organization_id: string

    • The unique identifier for the organization. You can find the organization ID in the user interface.

  • 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]

      • ProjectAssignment

        • project_id: string

        • project_role: ProjectRoles

          • The role assigned to the invited members within the project. Options include:

            • ProjectRoles.Manager

            • ProjectRoles.Labeler

            • ProjectRoles.Reviewer

            • ProjectRoles.Lead

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

Example

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_assignments = [ProjectAssignment(project_id="PROJECT_ID_1", project_role=ProjectRoles.Labeler),
                       ProjectAssignment(project_id="PROJECT_ID_2", project_role=ProjectRoles.Reviewer)]

invitation = Invitation(to=["[email protected]", "[email protected]"],
                        organization_role=OrganizationRoles.Member,
                        project_assignments=project_assignments)

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

Last updated