Body
Required
-
Primary phone number for the user. It should be unique across all users.
Format should match the following pattern:
/^\d+$/
. -
Primary email address for the user. It should be unique across all users.
Format should match the following pattern:
/^\S+@\S+\.\S+$/
. -
Username for the user. It should be unique across all users.
Format should match the following pattern:
/^[A-Z_a-z]\w*$/
. -
Plain text password for the user.
Minimum length is
1
. -
In case you already have the password digests and not the passwords, you can use them for the newly created user via this property. The value should be generated with one of the supported algorithms. The algorithm can be specified using the
passwordAlgorithm
property. -
The hash algorithm used for the password. It should be one of the supported algorithms: argon2, md5, sha1, sha256. Should the encryption algorithm differ from argon2, it will automatically be upgraded to argon2 upon the user's next sign-in.
Values are
Argon2i
,Argon2id
,Argon2d
,SHA1
,SHA256
,MD5
, orBcrypt
. -
arbitrary
curl \
--request POST 'https://[tenant_id].logto.app/api/users' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"primaryPhone":"string","primaryEmail":"string","username":"string","password":"string","passwordDigest":"string","passwordAlgorithm":"Argon2i","name":"string","avatar":"string","customData":{},"profile":{"familyName":"string","givenName":"string","middleName":"string","nickname":"string","preferredUsername":"string","profile":"string","website":"string","gender":"string","birthdate":"string","zoneinfo":"string","locale":"string","address":{"formatted":"string","streetAddress":"string","locality":"string","region":"string","postalCode":"string","country":"string"}}}'
{
"primaryPhone": "string",
"primaryEmail": "string",
"username": "string",
"password": "string",
"passwordDigest": "string",
"passwordAlgorithm": "Argon2i",
"name": "string",
"avatar": "string",
"customData": {},
"profile": {
"familyName": "string",
"givenName": "string",
"middleName": "string",
"nickname": "string",
"preferredUsername": "string",
"profile": "string",
"website": "string",
"gender": "string",
"birthdate": "string",
"zoneinfo": "string",
"locale": "string",
"address": {
"formatted": "string",
"streetAddress": "string",
"locality": "string",
"region": "string",
"postalCode": "string",
"country": "string"
}
}
}
{
"id": "string",
"username": "string",
"primaryEmail": "string",
"primaryPhone": "string",
"name": "string",
"avatar": "string",
"customData": {},
"identities": {
"userId": "string",
"details": {}
},
"lastSignInAt": 42.0,
"createdAt": 42.0,
"updatedAt": 42.0,
"profile": {
"familyName": "string",
"givenName": "string",
"middleName": "string",
"nickname": "string",
"preferredUsername": "string",
"profile": "string",
"website": "string",
"gender": "string",
"birthdate": "string",
"zoneinfo": "string",
"locale": "string",
"address": {
"formatted": "string",
"streetAddress": "string",
"locality": "string",
"region": "string",
"postalCode": "string",
"country": "string"
}
},
"applicationId": "string",
"isSuspended": true,
"hasPassword": true,
"ssoIdentities": [
{
"tenantId": "string",
"id": "string",
"userId": "string",
"issuer": "string",
"identityId": "string",
"detail": {},
"createdAt": 42.0,
"ssoConnectorId": "string"
}
]
}