Body Required
-
primaryPhone string(regex)
Primary phone number for the user. It should be unique across all users.
Format should match the following pattern:
/^\d+$/
. -
primaryEmail string(regex)
Primary email address for the user. It should be unique across all users.
Format should match the following pattern:
/^\S+@\S+\.\S+$/
. -
username string(regex)
Username for the user. It should be unique across all users.
Format should match the following pattern:
/^[A-Z_a-z]\w*$/
. -
password string
Plain text password for the user.
Minimum length is
1
. -
passwordDigest string
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. -
passwordAlgorithm string
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
. -
name string
avatar string(url) | null | string(empty)
-
customData object
arbitrary
-
profile object
curl \
-X POST https://[tenant_id].logto.app/api/users \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"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"
}
]
}