---
title: "Invite a User to the Account"
method: POST
path: "/accounts/{account}/actions/invite"
tags: ["users"]
---

# Invite a User to the Account

`POST /accounts/{account}/actions/invite`

## Request

- Base URL: `https://example.scalr.io/api/iacp/v3`
- URL: `https://example.scalr.io/api/iacp/v3/accounts/{account}/actions/invite`
- Auth: HTTP bearer

Invite the user to the account by adding it to the account teams and/or
creating access policies within the account.

If the user with a specified email does not exist - a new one will be created.
The new user will be in the 'pending' status until the first login to the account.

This is the preferred way to create users.

## Path parameters

- `account` string, required

## Query parameters

- `include` string[]

## Request body

- UserInviteDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` UserInvite: Represents an create [IAM](https://docs.scalr.io/docs/identity-and-access-management) account user request.
    - `attributes` object, required
      - `email` string, email, required
      - `send-invite` boolean: If set to `true`, email with invite to the account will be sent to the user email.
    - `id` string
    - `links` object
    - `relationships` object
      - `roles` object: Assign roles for this user on the account scope.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'roles' | '', required
      - `teams` object: Add user to the teams.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'teams' | '', required
    - `type` 'users', required
  - `included` object[]
  - `meta` object

## Response `201`

Success.

- AccountUserDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` AccountUser: Represents an account-user relation.
    - `attributes` object
      - `last-login-at` string, date-time, nullable: The UTC timestamp when the user logged in to the account.
      - `status` 'Active' | 'Inactive' | 'Pending': The relation status. Can be: `Active`, `Inactive`, `Pending`.
    - `id` string
    - `links` object
    - `relationships` object
      - `account` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'accounts' | '', required
      - `teams` object
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'teams' | '', required
      - `user` object
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
    - `type` 'account-users', required
  - `included` object[]
  - `meta` object

## Other responses

- `403`: User unauthorized to perform this action.
- `404`: User, Account, not found.
- `422`: Invalid team or role.
- `4XX`: Client error.
- `5XX`: Server error.

---

[API](https://skmtc.dev/scalr/apis/scalr-iacp-api.md) - [All operations](https://skmtc.dev/scalr/apis/scalr-iacp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scalr/apis/scalr-iacp-api/revisions/d3e1dc85657a?raw)
