Skip to content

Create User

POST
/api/v1/users
curl --request POST \
--url https://api.spartanauth.com/api/v1/users \
--header 'Content-Type: application/json' \
--data '{ "sectorID": "example", "username": "example", "password": "example", "name": "example" }'

Creates a user as a member of the specified sector. Depending on the sector’s security settings, the user may be created with just a username and no password, in which case they would need to complete an invite flow or password setup flow before they can log in. Requires the caller to be an admin of the sector or the default sector (if the sector allows user creation by non-admins).

Media type application/json
object
sectorID
string
username
string
password
optional - depends on settings
string
name
string
Example generated
{
"sectorID": "example",
"username": "example",
"password": "example",
"name": "example"
}

A successful response.

Media type application/json
object
sub
string
username
string
sectorID
string
enrollmentTransactionId

Set when the sector has MFARequired=true and the user was just created via self-signup with a password. Must be passed to SignupMFABegin to prove ownership of the newly created account.

string
Example generated
{
"sub": "example",
"username": "example",
"sectorID": "example",
"enrollmentTransactionId": "example"
}

An unexpected error response.

Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{
"code": 1,
"message": "example",
"details": [
{
"@type": "example"
}
]
}