Use the base accounts
/users
endpoints to manage the users in your organization.
GET /users
Retrieve a list of users in your organization.
List Users Query Parameters
where | The CEQL search expression or the where clause, without the WHERE keyword, in a typical SQL query. For example, to search for accounts created on or after 'Jan 15, 2014’, the search expression will be where=createdDate >= ‘2014-01-15’. When this parameter is omitted, all accounts are returned in a paginated fashion. |
nextPage | The next page token. Found in the header of the previous search |
pageSize | The page size for the paginated results, defaults to 200 |
List Users Response Fields
Name | Description |
---|---|
IDid | The unique identifier for a user within an account. Use in any /users endpoint with an {id} variable. |
CreatedcreatedDate | The date when someone created the account. |
First NamefirstName | The first name of the user. |
Last NamelastName | The last name of the user. |
password | A placeholder for the user's secure password. |
Emailemail | The email address of the user. The email receives all password reset emails. |
Activeactive | Indicates if the account is active. In the JSON response, true is active and false is inactive. |
User Secretsecret | The User Secret required for API calls to Cloud Elements APIs. You can also find your User Secret in the profile menu in Cloud Elements. |
lastLoginDate | The date that the user last logged in to Cloud Elements, or the date that someone created the account . |
fullName | The first and last name of the user. |
Org Admin/Account Adminroles | The roles assigned to the user. |
List Users Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/users?where=active%3D%true%60&pageSize=100 \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Content-Type: application/json' \
List Users Example Response
[
{
"id":3805,
"createdDate":"2017-07-10",
"firstName":"Neta",
"password":"secured",
"email":"Alfaro@mycompany.com",
"active":true,
"lastName":"Alfaro",
"accountExpired":false,
"accountLocked":false,
"credentialsExpired":true,
"lastLoginDate":"2017-07-10",
"emailValid":true,
"accountNonExpired":false,
"credentialsNonExpired":false,
"accountNonLocked":true,
"enabled":false,
"fullName":"Neta Alfaro"
}
]
GET /users/{emailOrId}
Retrieve a specific user by user id or email.
Retrieve a User by Id or Email Path Parameters
emailOrId | The id or email address associated with the user. |
Retrieve a User by Id or Email Header Parameters
Elements-User-Password | Optional user password. If you include the correct password the response body includes the user secret. |
Retrieve a User by Id or Email Example Request
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/users/firstlast@cloud-elements.com
\
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ \
-H 'Content-Type:application/json' \
-H 'Elements-User-Password:password' \
Retrieve a User by Id or Email Example Response
[ { "id":160255, "createdDate":"2017-01-18", "firstName":"first", "email":"
firstlast@cloud-elements.com
", "active":true, "lastName":"last", "accountExpired":false, "accountLocked":false, "credentialsExpired":false, "secret": "wGOw+75xqzBhek=/cP8wm3SPSNggfTZp1GFLtwfYzV0r""lastLoginDate":"2018-03-07", "accountNonLocked":true, "credentialsNonExpired":true, "accountNonExpired":true, "enabled":true, "fullName":"First Last" } ]
PATCH /users/{id}
You can make the following updates to a user:
- Change the
password
,firstName
,lastName
, oremail
. - Assign roles to a user.
- Activate or deactivate a with the
active
parameter.
Update Users Path Parameters
userId | The id associated with a specific user. |
Update Users Request Body Parameters
firstName | The first name of the user. |
lastName | The last name of the user. |
email | The email address of the user. The email receives all password reset emails. |
password | The assigned password for the user. |
roles | An object containing role assignment, which can be:
|
active | Deactivate by sending "active"= false .Activate by sending "active"= true . |
Update Users Example Request
curl -X PATCH \ https://api.cloud-elements.com/elements/api-v2/users/178592 \ -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ -H 'content-type: application/json' \ -d '{ "firstName": "First", "lastName": "Last", "email": "firstlast@cloud-elements.com",
"password": "password",
"roles:[
{
"key": "admin"
}
] } '
Update Users Example Response
[ { "id":160255, "createdDate":"2017-01-18", "firstName":"first", "password":"secured", "email":"
firstlast@cloud-elements.com
", "active":true, "lastName":"last", "accountExpired":false, "accountLocked":false, "credentialsExpired":false, "roles":[ ], "secret": "wGOw+75xqzBhek=/cP8wm3SPSNggfTZp1GFLtwfYzV0r""lastLoginDate":"2018-03-07", "accountNonLocked":true, "credentialsNonExpired":true, "accountNonExpired":true, "enabled":true, "fullName":"First Last" } ]
DELETE /users/{id}
Delete a user in your organization. You cannot recover deleted users. If you think that you might need to access the user later, consider deactivating the user instead.
Delete a User Path Parameters
userId | The id associated with a specific user. |
Delete a User Example Request
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/users/161268 \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'content-type: application/json' \
Delete a User Example Response
The response is empty. You can confirm that you deleted the account with GET /users
.