> ## Documentation Index
> Fetch the complete documentation index at: https://developer.sendoso.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Invite New User

> Create a new user invitation for a specific team group.

### Body

<ParamField body="user" type="object" required>
  <Expandable title="user" defaultOpen="true">
    <ParamField body="first_name" type="string" required>
      The new user's first name
    </ParamField>

    <ParamField body="last_name" type="string" required>
      The new user's last name
    </ParamField>

    <ParamField body="email" type="string" required>
      The new user's email address
    </ParamField>

    <ParamField body="role" type="string" required>
      The new user's role. Valid options are `regular` and `manager`.
    </ParamField>

    <ParamField body="team_group_id" type="integer" required>
      The ID of the team you'd like to invite the user to. To obtain the ID of the current team's in Sendoso, use [Retrieve All Teams](https://developer.sendoso.com/rest-api/reference/teams/get-teams).
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="boolean" required>
  Wheter or not the invitation was successfully created
</ResponseField>

<ResponseField name="message" type="string" required>
  The response message
</ResponseField>

<ResponseField name="receiver_email" type="string" required>
  The email address that the invitation was addressed to
</ResponseField>

<ResponseField name="team_group_id" type="integer" required>
  The team group id that the user was invited to
</ResponseField>

<ResponseField name="user_role" type="string" required>
  The role that the new user was invited with
</ResponseField>

<ResponseField name="invitation_status" type="string" required>
  The invitation's status. Valid values are `pending`, `accepted`, or `expired`.
</ResponseField>

<ResponseField name="expires_at" type="string" required>
  The date & time when the invitation will expire (in `ISO 8601` format).
</ResponseField>

<ResponseExample>
  ```json 201 - Created theme={null}
  {
      "success": true,
      "message": "Invitation sent successfully",
      "receiver_email": "devleopers@sendoso.com",
      "team_group_id": 1234,
      "user_role": "manager",
      "invitation_status": "pending",
      "expires_at": "2023-11-11T12:18:55.000-08:00"
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
      "success": false,
      "message": "Please enter a valid team group"
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
      "success": false,
      "message": "Role can be one of these: manager,regular"
  }
  ```
</ResponseExample>
