Create Users
Create up to 50 users in a single request: as SSO users, by registering them directly with a password, or by sending them an invitation email.
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer <Account API Key> |
Modes
auth_type selects how the users will sign in. Within the default password type, pre_register then selects whether a password is set for them or they are emailed an invitation.
| Mode | Behavior |
|---|---|
auth_type: "sso" | Users are created as SSO users and added to the given groups. They sign in through your identity provider. No password is set and no email is sent. |
auth_type: "password" (or omitted) with pre_register: true | Users are created and activated immediately with the supplied user_password and added to the given groups. No email is sent. |
auth_type: "password" (or omitted) with pre_register: false (or omitted) | Users receive an invitation email and set their own password from the activation link. They are added to the given groups on activation. |
Pre-registering users with preset passwords should only be used where invitation emails cannot be delivered. See Adding users to your account for guidance.
Request body
| Field | Type | Description |
|---|---|---|
| auth_type (optional) | String | "sso" or "password". Default "password". Any other value returns 400. |
| pre_register (optional) | Boolean | Selects the mode described above. Default false. Ignored when auth_type is "sso". |
| invitee_user (required) | Array | 1 to 50 user objects to create (see below). |
| admin_id (invite mode) | Integer | User id of the administrator sending the invitation. |
| admin_name (invite mode) | String | Name of the administrator, shown in the invitation email. |
invitee_user object
| Field | Type | Description |
|---|---|---|
| user_name (required) | String | Full name of the user. |
| user_email (required) | String | Email address. Must not already exist in the account. In SSO mode the domain must belong to a configured identity provider. |
| user_group_name (required) | Array of String | Names of existing groups to add the user to. Pass an empty array for none. |
| user_password (pre-register mode) | String | Initial password for the user. Must not be sent when auth_type is "sso". |
SSO mode
With auth_type: "sso" each user is created as an SSO user — verified, active, with no password — and added to the groups you name. They can sign in through your identity provider straight away and already hold the right group memberships, so you can onboard everyone from your own admin application instead of using the Manage Users section of Studio.
Requirements and behavior:
- SSO must be configured for the account. If no identity provider is configured, the whole request is rejected with
400, because the users created would otherwise be unable to sign in through any path. - Each
user_emaildomain must match a domain on one of the configured identity providers — the same check the Manage Users screen applies. Users whose domain does not match are reported witherror_code8, and the rest of the batch is still processed. user_passwordis rejected rather than ignored (error_code9), so a caller never assumes a password was set when none exists.- Groups are given by name in
user_group_nameand must already exist. Create them under Users → Groups first — see Grouping users. Names that do not match an existing group are skipped. - No invitation email is sent. Nothing has to be delivered to the user for onboarding to complete.
SSO users created this way have no password at all, which is what keeps them on the identity provider for sign-in. If you need a user to sign in with a password instead, create them with auth_type: "password".
Example cURL
Create SSO users with groups pre-assigned:
curl --location --request POST '<BUILDER_URL>/api/public/users' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX' \
--data-raw '{
"auth_type": "sso",
"invitee_user": [
{
"user_name": "Jane Doe",
"user_email": "jane@example.com",
"user_group_name": ["Sales", "Support"]
},
{
"user_name": "John Smith",
"user_email": "john@example.com",
"user_group_name": ["Sales"]
}
]
}'
Pre-register a user:
curl --location --request POST '<BUILDER_URL>/api/public/users' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX' \
--data-raw '{
"pre_register": true,
"invitee_user": [
{
"user_name": "Jane Doe",
"user_email": "jane@example.com",
"user_password": "Str0ngPassw0rd!",
"user_group_name": ["Sales", "Support"]
}
]
}'
Invite users by email:
curl --location --request POST '<BUILDER_URL>/api/public/users' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXX' \
--data-raw '{
"pre_register": false,
"admin_id": 1,
"admin_name": "Admin",
"invitee_user": [
{
"user_name": "Jane Doe",
"user_email": "jane@example.com",
"user_group_name": ["Sales"]
},
{
"user_name": "John Smith",
"user_email": "john@example.com",
"user_group_name": []
}
]
}'
Responses
| Status Code | Description | Response |
|---|---|---|
| 200 | Request processed. The body lists the users that could not be created; an empty array means every user was created. | application/json |
| 400 | auth_type is not sso or password, or auth_type is sso and the account has no identity provider configured | application/json |
| 401 | Unauthorized, or invitee_user is empty | application/json |
| 500 | Internal Server Error | application/json |
Sample response
200 : All users created
[]
200 : Some users could not be created
[
{
"user_email": "jane@example.com",
"error_code": "3",
"error_detail": "User already exists in the channel"
},
{
"user_email": "john@example.com",
"error_code": "6",
"error_detail": "Licence expired"
}
]
Error codes
| error_code | Description |
|---|---|
| 2 | Not a valid email address. |
| 3 | A user with this email already exists in the account. |
| 6 | The account's user licence has expired or no seats are available. |
| 8 | SSO mode only. The email domain is not configured for SSO in this account. |
| 9 | SSO mode only. user_password was supplied, which is not allowed for an SSO user. |
| 10 | SSO mode only. The user could not be created as an SSO user — most often because the email already exists in another account, where the account-wide SSO setting cannot be changed for it. |