---
updatedAt: 2026-05-28T08:16:45.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Invite a User to the Account

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.


# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "AccountUser": {
        "description": "Represents an account-user relation.",
        "properties": {
          "attributes": {
            "properties": {
              "last-login-at": {
                "description": "The UTC timestamp when the user logged in to the account.",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "description": "The relation status. Can be: `Active`, `Inactive`, `Pending`.",
                "enum": [
                  "Active",
                  "Inactive",
                  "Pending"
                ],
                "type": "string"
              }
            },
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "relationships": {
            "properties": {
              "account": {
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "accounts",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "teams": {
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "teams",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "user": {
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "users",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "account-users"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "AccountUserDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/AccountUser"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      },
      "UserInvite": {
        "description": "Represents an create [IAM](https://docs.scalr.io/docs/identity-and-access-management) account user request.",
        "properties": {
          "attributes": {
            "properties": {
              "email": {
                "format": "email",
                "type": "string"
              },
              "send-invite": {
                "default": true,
                "description": "If set to `true`, email with invite to the account will be sent to the user email.",
                "type": "boolean"
              }
            },
            "required": [
              "email"
            ],
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "relationships": {
            "properties": {
              "roles": {
                "description": "Assign roles for this user on the account scope.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "roles",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "teams": {
                "description": "Add user to the teams.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "teams",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "users"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "UserInviteDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/UserInvite"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/accounts/{account}/actions/invite": {
      "post": {
        "description": "Invite the user to the account by adding it to the account teams and/or\ncreating access policies within the account.\n\nIf the user with a specified email does not exist - a new one will be created.\nThe new user will be in the 'pending' status until the first login to the account.\n\nThis is the preferred way to create users.\n",
        "operationId": "invite_user_to_account",
        "parameters": [
          {
            "in": "path",
            "name": "account",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comma-separated list of relationship paths.",
            "explode": false,
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "items": {
                "enum": [
                  "account",
                  "teams",
                  "user"
                ],
                "type": "string"
              },
              "type": "array"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "examples": {
                "default": {
                  "value": "{\n  \"data\":{\n    \"type\":\"users\",\n    \"attributes\":{\n      \"email\":\"test_user@scalr.com\",\n      \"send-invite\":false\n    },\n    \"relationships\":{\n      \"teams\":{\n        \"data\":[\n          {\n            \"type\":\"teams\",\n            \"id\":\"team-t67mjtnokncjpd8\"\n          }\n        ]\n      },\n      \"roles\":{\n        \"data\":[\n          {\n            \"type\":\"roles\",\n            \"id\":\"role-t67mjtmauajto7g\"\n          },\n          {\n            \"type\":\"roles\",\n            \"id\":\"role-t67mjtmd93j62hg\"\n          }\n        ]\n      }\n    }\n  }\n}"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/UserInviteDocument"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/vnd.api+json": {
                "examples": {
                  "default": {
                    "value": "{\n  \"data\":{\n    \"attributes\":{\n      \"status\":\"Pending\"\n    },\n    \"id\":\"24429152-fced-6c00-9ad6-374b648d166b\",\n    \"links\":{},\n    \"relationships\":{\n      \"account\":{\n        \"data\":{\n          \"id\":\"acc-svrcncgh453bi8g\",\n          \"type\":\"accounts\"\n        }\n      },\n      \"teams\":{\n        \"data\":[\n          {\n            \"id\":\"team-t67mjtnokncjpd8\",\n            \"type\":\"teams\"\n          }\n        ]\n      },\n      \"user\":{\n        \"data\":{\n          \"id\":\"user-tmh3n6qao207cdg\",\n          \"type\":\"users\"\n        }\n      }\n    },\n    \"type\":\"account-users\"\n  },\n  \"included\":null,\n  \"meta\":null\n}"
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/AccountUserDocument"
                }
              }
            },
            "description": "Success."
          },
          "403": {
            "description": "User unauthorized to perform this action."
          },
          "404": {
            "description": "User, Account, not found."
          },
          "422": {
            "description": "Invalid team or role."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Invite a User to the Account",
        "tags": [
          "users"
        ],
        "x-resource": "User",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [Remove a User from the Account](https://docs.scalr.io/scalr/reference/remove_user_from_account.md)
* [List Users](https://docs.scalr.io/scalr/reference/get_users.md)
* [Create a User](https://docs.scalr.io/scalr/reference/create_user.md)
* [Delete a User](https://docs.scalr.io/scalr/reference/delete_user.md)
* [Get a User](https://docs.scalr.io/scalr/reference/get_user.md)
* [Update a User](https://docs.scalr.io/scalr/reference/update_user.md)