Create new user
Creates a new user.
The fullName and username may be provided directly or derived from linked accounts.
Full name resolution:
- The value of the
fullNameparameter, if provided - The first valid
fullNamefrom the linked accounts (after normalization) Unnamed User, if none of the above
NOTE: the value
Unnamed Useris treated as a missing value (i.e. equivalent to unspecifiedfullName).
Username resolution:
- The value of the
usernameparameter, if provided - The first valid
usernamefrom the linked accounts (after normalization) null(no username), if none of the above
This operation requires oz_users_create admin privilege.
Example cURL requests
Create a new user
curl -u username:password -H "Content-type: application/json" \
-X POST -d '{ "username" : "new_user", "password": "lS1c6FD2mxB2ff" }' \
https://$ZONE_HOST/api/v3/onezone/users
Create a new user with a preconfigured linked account
curl -u username:password -H "Content-type: application/json" \
-X POST -d '{
"linkedAccounts": [{
"idp" : "egi",
"username" : "janedoe",
"subjectId" : "96ac30df1113de761bb42967da314dffe725d7b9@egi.eu",
"groups" : [
"urn:mace:egi.eu:group:test-group.egi.eu:role=vm_operator#aai.egi.eu",
"urn:mace:egi.eu:group:test-group.egi.eu:role=member#aai.egi.eu"
],
"fullName" : "Jane Done",
"entitlements" : [
"urn:mace:egi.eu:group:test-group.egi.eu:role=vm_operator#aai.egi.eu",
"urn:mace:egi.eu:group:test-group.egi.eu:role=member#aai.egi.eu"
],
"emails" : [
"janedoe@example.com"
],
"custom" : {
"role": "developer"
}
}]
}' \
https://$ZONE_HOST/api/v3/onezone/users
Request body
User name.
| Property | Type & Description | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fullName string User's full name (given names + surname). Defaults to | |||||||||||||||
username string User's human-readable identifier, unique across the system. Makes it easier to identify the user and can be used for signing in with password. Defaults to null (no username). | |||||||||||||||
password string User's password (in plaintext). Typically used for admin accounts and users that cannot log in using an Identity Provider. | |||||||||||||||
linkedAccounts array of objects (LinkedAccount) The list of preconfigured linked accounts. May be useful to create a user account before they log in. Requires knowledge of at least the user's subject ID in the IdP.
| |||||||||||||||
Request Examples
{
"fullName": "Rudolf Lingens",
"username": "r.lingens",
"password": "lS1c6FD2mxB2ff"
}Responses
URI of the created user in the form https://$ZONE_HOST/api/onezone/v3/users/{id} is returned in the response Location header.
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}