userAdminCreate Mutation
Description
Creates a new admin user. If SSO input is provided, the user is created with SSO authentication and automatically verified. If password is provided, the user is created with password authentication and a verification code is sent. Returns the created admin user and an authenticated session.
mutation userAdminCreate(
$firstName: String!
$lastName: String!
$email: String!
$password: String
$ssoInput: SSOInput
) {
userAdminCreate(
firstName: $firstName
lastName: $lastName
email: $email
password: $password
ssoInput: $ssoInput
) {
user {
_id
firstName
lastName
name
email
addedAt
type
hasIntercom
hasPasscode
passwordToken
lastLogin
}
session {
_id
configRef
type
jwt
expires
createdAt
origin
shopName
deviceName
deviceId
mfa
ip
}
}
}
Variables
{
"firstName": "John",
"lastName": "Doe",
"email": "email@example.com",
"password": "password",
"ssoInput": {
"type": "type",
"jwt": "jwt",
"code": "code",
"audience": "audience"
}
}
Response
{
"userAdminCreate": {
"user": {
"_id": "9ddb2b75252281d1808675b6",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"addedAt": 1734915044832,
"type": "example",
"hasIntercom": true,
"hasPasscode": true,
"passwordToken": "example",
"lastLogin": 1758774336675
},
"session": {
"_id": "ed6b3b9515fc42bff72fd2be",
"configRef": "aa25afbcd61ab414b94ac4a8",
"type": "example",
"jwt": "example",
"expires": 1703429127531,
"createdAt": 1707830873489,
"origin": "example",
"shopName": "example",
"deviceName": "example",
"deviceId": "example",
"mfa": true,
"ip": "example"
}
}
}
Arguments
| Name | Type | Description |
|---|---|---|
firstName | String! | First name of the admin user. |
lastName | String! | Last name of the admin user. |
email | String! | Email address of the admin user. Must be unique. |
password | String | Password for the admin user. Required if SSO input is not provided. |
ssoInput | SSOInput | SSO authentication input. If provided, the user is created with SSO authentication instead of password authentication. |