Creating or modifying a user
This call will allow you to create or update an user. The REST call may only be executed by administrators.
URL
api/v1/users
Method
POST
URL parameters
Parameter | Type | Required | Description |
---|---|---|---|
environmentId | String | Yes | The ID of the environment. |
Header Parameters
Parameter | Type | Required | Description |
---|---|---|---|
Content-Type | String | Yes | Provide the content type of your call. Only application/json is supported. |
X-User-Id | String | Yes | The ID of the user who wants to trigger the REST action. This ID is returned by the authentication call. |
X-Auth-Token | String | Yes | The authentication token that the authentication call returned. |
Body
A JSON object with information about the user account that is created or updated. The object can contain the following fields:
Field | Type | Required | Description |
---|---|---|---|
globalEmailAddress | String | Yes | The global e-mail address of the user. |
_environmentId | String | Yes | The ID of the environment to which the user is added to which the user belongs. |
name | String | No | The name of the user in the environment. This field is only required creating a new user. |
administrator | Boolean | No | Indicates whether the user is an administrator in the environment. This field is required when creating a new user. |
active | Boolean | No | Indicates whether the user is active in the environment. This field is required when creating a new user. |
language | String | No | The language code that controls the language of the user interface in the environment. This field is required when creating a new user. |
locale | String | No | The language code that controls the locale of the user in the environment. This field is required when creating a new user. |
menuName | String | No | The name of the menu that are assigned to the user. |
menuId | String | No | The ID of the menu that will be assigned to the user. |
menuNames | String Array | No | An array with the names of the menus that are assigned to the user. When this parameter is used, the user's menu array is effectively overwritten. |
menuIds | String Array | No | An array with the IDs of the menus that are assigned to the user. When this parameter is used, the user's menu array is effectively overwritten. |
addMenuNames | String Array | No | An array with the names of the menus that are assigned to user, in addition the the menus that already have been assigned. |
addMenuIds | String Array | No | An array with the IDs of the menus that are assigned to user, in addition the the menus that already have been assigned. |
removeMenuNames | String Array | No | An array with the names of the menus that are removed from the menus that are accessible for the user. |
removeMenuIds | String Array | No | An array with the IDs of the menus that are removed from the menus that are accessible for the user. |
memberGroupNames | String Array | No | An array with the names of the groups to which the user belongs. The group name(s) will be used to assign the user to these groups and remove them from the others. |
memberGroupIds | String Array | No | An array with the IDs of the groups to which the user belongs. The group IDs will be used to assign the user to these groups and remove them from the others. |
Response
Modified or added user. Be aware that restricted content (e.g. including information from other environments and passwords) not be returned.
Example
curl /api/v1/users
-H "X-Auth-Token: 6IrqyFhbKjpyJZ_NX6dwLmRNxWk0OVffE8aBfauNKUG" \
-H "X-User-Id: a6gA9rYaGTFKPrT5P" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"globalEmailAddress": "guest@maxedy.com",
"_environmentId": "maxedy_pizza",
"name": "Guest",
"administrator": false,
"active": true,
"locale": "en",
"language": "en",
"menuName": "maxedyPizzaMenu",
"memberGroupNames": ["allusers", "guest"]
}'