Find us at our new Help Center where we've combined our documentation and knowledgebase articles in one easy-to-search location.
We aren't updating the Developer Portal anymore, except for the Element Docs — all updates happen in the Help Center. We're retiring the Developer Portal as you know it in:
If you are the user who created the organization, you are the organization administrator. You can manage the accounts related to the organization with the /accounts
endpoint. You can create, retrieve, update, delete, and search accounts. To manage accounts, you must include a valid Organization Secret and the User Secret of the organization administrator in the header of any API requests to /accounts
. If any requests come from someone else, even a user that you add to the default account, they will receive a 401 Unauthorized
error code.
You can see all of the accounts in your organization with the GET /accounts
endpoint. If you have many accounts, adding a CEQL query helps to keep the response manageable.
Name | Description | Required |
---|---|---|
where | The CEQL search expression is a where clause like in a typical SQL query, but without the WHERE keyword. For example, to search for accounts created on or after ‘Jan 15, 2017′, use a search expression like . If you do not use a CEQL query, the endpoint returns all accounts in a paginated fashion. |
N |
offset | The record offset at which to begin the paginated results.Default 0 | N |
pageSize | The page size for the paginated results.Default 200 | N |
curl -X GET \
'https://api.cloud-elements.com/elements/api-v2/accounts?where=createdDate%3E'\''2017-01-15'\''&offset=1&pageSize=200' \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
[
{
"id": 1234,
"name": "Company Default Account",
"description": "Auto created default account for the entire company",
"active": true,
"companyId": 999,
"createdDate": "2017-03-23",
"externalId": "you@yourcompany.com",
"defaultAccount": true,
"type": "Default"
},
{
"id": 3780,
"name": "Customer Account",
"description": "A customer's account",
"active": true,
"companyId": 998,
"createdDate": "2017-04-25",
"externalId": "1984",
"defaultAccount": false,
"type": "CompanyAccount"
}
]
The attribute names that appear only in the JSON response appear in code
format.
Name | Description |
---|---|
ID id |
The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Namename |
The name of the account. |
Descriptiondescription |
A brief description of the account. |
Activeactive |
Indicates if the account is active. In the JSON response true is active and false is inactive. |
companyId |
The unique identifier of the organization created at initial signup. |
CreatedcreatedDate |
The date when the organization administrator created the account. |
externalID |
A unique identifier for the account, required to add an account using POST/ accounts . |
defaultAccount |
Indicates if the account is an organization level account — true — or account level — false . |
type |
Indicates the type of account, either account level — CompanyAccount — or organization level — Default . |
Add accounts with the POST /accounts
endpoint.
{
"name": "Account Name",
"description": "Short description of the account",
"externalId": "companyemail@company.com"
}
externalId
externalId
, the name
and description
will be whatever value you provide for externalId
. curl -X POST \
https://api.cloud-elements.com/elements/api-v2/accounts \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"name": "Account For Docs",
"description": "This account is used to demonstrate a POST /instances request",
"externalId": "notsorandomId"
}
'
{
"id": 4030,
"name": "Account For Docs",
"description": "This account is used to demonstrate a POST /instances request",
"active": true,
"companyId": 819,
"externalId": "notsorandomId",
"defaultAccount": false,
"type": "CompanyAccount"
}
See Account Attributes for descriptions of each attribute.
Add users to accounts with the account id
and the POST /accounts/{accountId}/users
endpoint.
After you create a user, they do not receive any notification. This is because many users do not need to access Cloud Elements directly. If the new user needs to access Cloud Elements, either provide them with the password that you entered or encourage them to reset their password.
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see Find Accounts.
{
"firstName": "User's First Name",
"lastName": "User's Last Name",
"email": "useremail@company.com",
"password": "password"
}
firstName
lastName
email
password
You can also include the following optional attributes to provide more details about the user. The attributes do not appear in Cloud Elements:
{
"city": "string",
"country": "string",
"phone": "string",
"postalCode": "string",
"stateProvince": "string",
"street1": "string",
"street2": "string",
"roles":[
{
"key": "role key either admin or org-admin"
}
]
}
curl -X POST \
https://api.cloud-elements.com/elements/api-v2/accounts/4022/users \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"firstName": "First",
"lastName": "Last",
"email": "FirstLast@company.com",
"password": "password",
"roles":[
{
"key": "admin"
}
]
}'
{
"id": 4022,
"createdDate": "2017-07-12",
"firstName": "First",
"email": "FirstLast@company.com",
"active": true,
"lastName": "Last",
"accountExpired": false,
"accountLocked": false,
"credentialsExpired": false,
"roles": [
{
"id": 3,
"name": "Administrator",
"key": "admin",
"active": true,
"description": "Cloud Elements Application Administrator.",
"features": []
},
{
"id": 2717,
"name": "Organization User",
"key": "org",
"active": true,
"description": "Organization User",
"features": []
}
],
"secret": "pgJTa2A3Lxr/7o/fN7NlRb1ATrgc4JlXVKFq7HpcF74=",
"lastLoginDate": "1970-01-01",
"emailValid": true,
"accountNonExpired": true,
"credentialsNonExpired": true,
"accountNonLocked": true,
"enabled": true,
"fullName": "First Last"
}
See User Attributes for descriptions of each attribute.
Access a specific account with the account id
and the GET /accounts/{id}
endpoint.
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see [Find Accounts.
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/4022 \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
{
"id": 4030,
"name": "Account For Docs",
"description": "This account is used to demonstrate a POST /instances request",
"active": true,
"companyId": 819,
"createdDate": "2017-07-10",
"externalId": "notsorandomId",
"defaultAccount": false,
"type": "CompanyAccount"
}
See Account Attributes for descriptions of each attribute.
Change the name
, description
, or externalId
of a specific account with the account id
and the PATCH /accounts/{id}
endpoint.
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see [Find Accounts.
curl -X PATCH \
https://api.cloud-elements.com/elements/api-v2/accounts/4022 \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"name": "Updated Account",
"description": "This account is used to demonstrate a PATCH /instances request",
"externalId": "newRandomId"
}
'
{
"id": 4022,
"name": "Updated Account",
"description": "This account is used to demonstrate a PATCH /instances request",
"active": true,
"companyId": 819,
"createdDate": "2017-07-10",
"externalId": "newRandomId",
"defaultAccount": false,
"type": "CompanyAccount"
}
See Account Attributes for descriptions of each attribute.
You can retrieve a list of users associated with an account with the account id
and the GET /accounts/{id}/users
endpoint.
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see [Find Accounts.
curl -X GET \
https://api.cloud-elements.com/elements/api-v2/accounts/4046/users \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
[
{
"id": 3805,
"createdDate": "2017-07-10",
"firstName": "Neta",
"password": "secured",
"email": "Alfaro@mycompany.com",
"active": false,
"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"
}
]
See User Attributes for descriptions of each attribute.
You can deactivate an account or activate an already deactivated account with the account id
and the PATCH /accounts/{id}
endpoint. Deactivating an account essentially performs the same action as deleting an account. After you deactivate an account, you cannot view it in Cloud Elements 2.0. You can still find the account using the Cloud Elements APIs. Use the account id
with /accounts
endpoints that use the {id}
variable.
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see [Find Accounts.
curl -X PATCH \
https://api.cloud-elements.com/elements/api-v2/accounts/4022 \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
-d '{
"active": false
}
'
To reactivate a deactivated account, set active
to true
.
{
"id": 4022,
"name": "Updated Account",
"description": "This account is used to demonstrate a PATCH /instances request",
"active": false,
"companyId": 819,
"createdDate": "2017-07-10",
"externalId": "newRandomId",
"defaultAccount": false,
"type": "CompanyAccount"
}
If you reactivate an account, active
is set to true
in the response.
See Account Attributes for descriptions of each attribute.
Delete an account from your organization with the account id
and the DELETE /accounts/{id}
endpoint. Deleting an account essentially performs the same action as deactivating an account. You can recover a deleted account by reactivating it. The account will not appear in Cloud Elements 2.0 and is not retrieved by GET /accounts
. You can still find the account using the account id
with /accounts
endpoints that use the {id}
variable.
If you delete an account that also has users associated with it, the account deletion deactivates the users. If you reactivate the account and want to keep the same users, you must reactivate them separately.
To check for any users of the account, use GET /accounts/{id}/users
. If you receive a status of 404 Not Found
with the response body below, the account has no users and you can delete it.
{
"requestId": "59664ce6e4b0bbce0a2bd24f",
"message": "No users found"
}
Name | Description | Required |
---|---|---|
id | The unique identifier for an account within an organization. Use in any /accounts endpoint with an {id} variable. |
Y |
To get a list of accounts including ids see [Find Accounts.
curl -X DELETE \
https://api.cloud-elements.com/elements/api-v2/accounts/4031 \
-H 'authorization: User <USER_SECRET>, Organization <ORGANIZATION_SECRET>' \
-H 'content-type: application/json' \
The response is empty. You can confirm that you deleted the account with GET /accounts/{id}
. In the response, active
is set to false
.