User operations

User operations

Overview

Check the list of available endpoints and methods to create and modify users using the Provisioning API.

Internal and external users

Some of the actions you can perform using these endpoints apply to different groups of users (internal and external users) so its important to know the difference between them:

  • Internal users are registered into the platform with their own password. Internal users are required to validate their email, and they can be added as domain owners.

  • External users are registered into a third party platform, and have limited access to the platform. They need to be registered as external users, but do not need to have their emails validated. They cannot be domain owners.

Endpoints and methods

Description

Endpoints and methods

Description

GET/user/email/{userEmail}see below

Get user info based on email.

GET /user/domain/{domainName}see below

Get information about the users in a domain.

GET /user/email/{userEmail}/domain/{domainName}see below

Get user info based on email and domain.

GET /user/internal/{id}see below

Get user info based on internal ID

GET /user/internal/{id}/domain/{domainName}see below

Get user info based on domain and internal ID.

GET /user/external/{id}/domain/{domainName}see below

Get user info based on domain and external ID.

POST /user/internalsee below

Add an internal user to a domain.

POST /user/externalsee below

Add an external user to a domain.

POST /user/email/{userEmail}/domain/{domainName}/disablesee below

Disable a user in a domain.

POST /user/email/{userEmail}/domain/{domainName}/enablesee below

Enable a user in a domain.

PUT /user/email/{userEmail}/domain/{domainName}/rolesee below

Set the roles of a user in a domain.

PUT /user/email/{userEmail}/domain/{domainName}/role/{roleName}see below

Change the role of a user in a domain.

PUT /user/internal/{id}see below

Update user info.

DELETE /user/email/{userEmail}/domain/{domainName}see below

Delete a user from a domain.

DELETE /user/email/{userEmail}/domain/{domainName}/rolesee below

Remove roles from a user.

Endpoints and methods

GET /user/email/{userEmail}

Get basic user info based on email. The information retrieved is not related to any specific domain.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

{ "email": "user@devo.com", "userName": "John", "phone": "678345678", "id": "2456-sgfd-2344" }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

GET /user/domain/{domainName}

Get basic information about all the users in a given domain.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/domain/domainName@resellerName

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

[ { "email": "user@devo.com", "userName": "John", "role": "ADMIN", "domain": "demo@training", "owner": true, "status": "active", "roleList": [ "ADMIN" ] }, { "email": "user2@devo.com", "userName": "Rita", "role": "NO_PRIVILEGES", "domain": "demo@training", "owner": false, "status": "active", "roleList": [ "NO_PRIVILEGES" ] }, { "email": "user3@devo.com", "userName": "Lara", "role": "NO_PRIVILEGES", "domain": "demo@training", "owner": false, "status": "inactive", "roleList": [ "NO_PRIVILEGES" ] }, { "email": "user4@devo.com", "userName": "Mary", "role": "NO_PRIVILEGES", "externalId": "123-45-678", "domain": "demo@training", "owner": false, "status": "inactive", "roleList": [ "NO_PRIVILEGES" ] }, { "email": "user5@devo.com", "userName": "Alex", "role": "ADMIN", "domain": "demo@training", "owner": false, "status": "active", "roleList": [ "ADMIN" ] } ]

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

GET /user/email/{userEmail}/domain/{domainName}

Get specific user info based on their email and domain.

This endpoint may be used with both regular and multitenant domains.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

domainName required

string

Enter the name of the required domain. If it is a multitenant domain, you must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com/domain/domainName@resellerName

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

{ "email": "user@devo.com", "userName": "John", "role": "ADMIN", "domain": "demo@training", "owner": true, "status": "active", "roleList": [ "ADMIN" ] }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

GET /user/internal/{id}

Get basic user info based on internal ID. Note that this info is not related to any specific domain.

We recommend identifying users by email address instead of internal ID whenever possible.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

id required

string

Internal ID of the user.

How to get the ID of an internal user?

You can use the GET /user/email/{userEmail} endpoint to get the ID of an internal user. You will get the ID in the response, in the id parameter.

Find below a request example:

https://api-us.devo.com/probio/user/internal/2456-sgfd-2344

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

{ "email": "user@devo.com", "userName": "John", "phone": "678345678", "id": "2456-sgfd-2344" }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

GET /user/internal/{id}/domain/{domainName}

Get user info based on domain and internal ID.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

id required

string

Internal ID of the user.

How to get the ID of an internal user?

You can use the GET /user/email/{userEmail} endpoint to get the ID of an internal user. You will get the ID in the response, in the id parameter.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/internal/2456-sgfd-2344/domain/domainName@resellerName

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

{ "email": "user@devo.com", "userName": "John", "role": "ADMIN", "domain": "demo@training", "owner": true, "status": "active", "roleList": [ "ADMIN" ] }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

GET /user/external/{id}/domain/{domainName}

Get user info based on domain and external ID.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

id required

string

External ID of the user.

How to get the ID of an external user?

You can use the GET /user/domain/{domainName} endpoint to get the IDs of all the users in a domain.

If theres any external users, you will get their IDs in the response, in the externalId parameter.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/external/2456-sgfd-2344/domain/domainName@resellerName

 

Response

Code

Description

Code

Description

200

Successful response. User info retrieved.

{ "email": "user@devo.com, "userName": "Rita", "role": "ADMIN", "externalId": "2456-sgfd-2344", "domain": "domainName@resellerName", "owner": false, "status": "active", "roleList": [ "ADMIN" ] }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

POST /user/internal

Add an internal user to a multitenant domain.

Every user in a domain needs to have at least one role assigned to them, either one of the default roles in the application or a custom role. While creating users in a domain, keep in mind the following restrictions:

  • Internal users cannot be used immediately after creation - they must first be activated through a link sent to the email address provided. The activation process also requires the user to create a password.

  • The first user added to a new domain must be internal and must be the domain owner. Owners cannot be deleted, and a domain can only have one owner.

Youll need the multitenant API keys to create the first user in the domain, and its role must be OWNER. Check an example of this below.

  • To assign a user (new or existing) as a domain owner, use the roleOWNERwhen creating the user. This will create the user with the roleADMINbut with OWNER privileges. The ADMIN role is exclusive and cannot be combined with other roles.

Notice that even though the role OWNER is used to assign a user the ownership of a domain, this is interpreted as ADMIN role, flagged as OWNER, so the actual role (for policies, permissions) is actually ADMIN, and that value will be returned in the responses (along with a boolean OWNER flag).

  • This method can be also used to add an existing user to a different domain. In this case, the user will keep their original user name and phone number, ignoring any new value provided for them. The field externalId is ignored too since it only has meaning for external users (who might not have a password in the platform).

 

Request

 

Query string parameters

 

Query string parameters are added after the path parameters, preceded by a question mark (?) and separated by an ampersand ()

Parameter

Type

Description

Parameter

Type

Description

skipMailValidation required

boolean

Set this to true to skip the email address validation step when creating a user for the domain. In this case, the user must already exist in the platform and therefore already have a password. Default value is false.

Note that in order to use this parameter, you must use multitenant domain credentials to authorize your request.

Request body

The request JSON body must include the userInfo object with the following key-value pairs:

Parameter

Type

Description

Parameter

Type

Description

domain required

string

Domain name. Must match the expression ^[A-Za-z]A-Za-z0-9_-?$.

userName required

string

Name of the new user. Must match the expression ^(([a-zA-Z0-9-])+([ _'.@-]))([a-zA-Z0-9-])$.

This field will be ignored if you are adding an already existing user to a different domain, and the current value will be kept.

email required

string

Enter the email address of the new user.

role required

string

Role of the new user. Basic roles in Devo are:

  • OWNER

  • ADMIN

  • NO_PRIVILEGES

Custom roles must match the expression ^(([a-zA-Z0-9])+([ _-]))([a-zA-Z0-9])$.

Check more info about roles at the top of this endpoint section.

phone

string

Phone number of the new user. Must match the expression ^+(?:[0-9] ?){6,14}[0-9]$.

This field will be ignored if you are adding an already existing user to a different domain, and the current value will be kept.

Find below a request example:

https://api-us.devo.com/probio/user/internal?skipValidation=false

And this is an example of a request body, including the required JSON object. In this example, we are adding the first user (owner) of a domain:

{ "domain": "domainName@resellerName", "userName": "Frank", "email": "user@devo.com", "role": "OWNER" }

 

Response

Code

Description

Code

Description

200

Successful response. User added to the given domain.

{ "email": "user@devo.com", "userName": "Frank", "role": "ADMIN", "domain": "domainName@resellerName", "owner": true, "status": "pending", "roleList": [ "ADMIN" ] }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

POST /user/external

Add an external user to a multitenant domain.

Every user in a domain needs to have at least one role assigned to them, either one of the default roles in the application or a custom role. When you create external users in a domain, keep in mind the following restrictions:

  • An external ID must be provided for the user - normally a valid identifier at the client platform. This method only works for clients belonging to a multitenant structure.

  • External users cannot be domain owners. They also do not require a username and password if the reseller configuration allows for it through federated authentication.

 

Request

 

Request body

 

The request JSON body must include the userInfo object with the following key-value pairs:

Parameter

Type

Description

Parameter

Type

Description

domain required

string

Domain name. Must match the expression ^[A-Za-z]A-Za-z0-9_-?$.

userName required

string

Name of the new user. Must match the expression ^(([a-zA-Z0-9-])+([ _'.@-]))([a-zA-Z0-9-])$.

email required

string

Enter the email address of the new user.

externalId required

string

User identifier in the external system. The maximum number of characters is 256.

role required

string

Role of the new user. Must match the expression ^(([a-zA-Z0-9])+([ _-]))([a-zA-Z0-9])$.

phone

string

Phone number of the new user. Must match the expression ^+(?:[0-9] ?){6,14}[0-9]$.

owner

boolean

Set this parameter to true if the user is the owner of the current domain.

Find below a request example:

https://api-us.devo.com/probio/user/external

And this is an example of a request body, including the required JSON object:

{ "domain": "domainName@resellerName "userName": "Lara", "email": "user@devo.com", "externalId": "12345", "role": "ADMIN" }

 

Response

Code

Description

Code

Description

200

Successful response. User added.

{ "email": "user@devo.com", "userName": "Lara", "role": "ADMIN", "externalId": "12345", "domain": "domainName@resellerName", "owner": false, "status": "active", "roleList": [ "ADMIN" ] }

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

POST /user/email/{userEmail}/domain/{domainName}/disable

Disable a user in a given domain. Note that this action does not remove the user from the domain. Users can be re-enabled anytime.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com/domain/domainName@resellerName/disable

 

Response

Code

Description

Code

Description

200

Successful response. User disabled.

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

POST /user/email/{userEmail}/domain/{domainName}/enable

Enable a user in a given domain.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com/domain/domainName@resellerName/enable

 

Response

Code

Description

Code

Description

200

Successful response. User enabled.

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

PUT /user/email/{userEmail}/domain/{domainName}/role

Set the roles of a user in a given domain.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

Query string parameters

Query string parameters are added after the path parameters, preceded by a question mark (?) and separated by an ampersand (&).

Parameter

Type

Description

Parameter

Type

Description

keepExisting

boolean

Set this to true to keep the current roles of the user, plus the new ones added through this request. The default value is false.

Request body

The request JSON body must include the following key-value pairs:

Parameter

Type

Description

Parameter

Type

Description

roles required

object

Enter the list of role names separated by commas. Basic roles in Devo are:

  • OWNER

  • ADMIN

  • NO_PRIVILEGES

Custom roles must match the expression ^(([a-zA-Z0-9])+([ _-]))([a-zA-Z0-9])$.

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com/domain/domainName@resellerName/role?keepExisting=true

And this is an example of a request body, including the required JSON object:

[ "role1", "role2", "role3" ]

 

Response

Code

Description

Code

Description

200

Successful response. Roles updated.

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

PUT /user/email/{userEmail}/domain/{domainName}/role/{roleName}

Change the role of a user in a given domain. Note that this action does not add a role to the users current ones, but replace them by the selected one.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

userEmail required

string

Enter the email of the required user.

domainName required

string

Enter the name of the required domain. You must enter the full domain name using the format {domainName}@{resellerName}

roleName required

string

Name of the new role for the user.

Find below a request example:

https://api-us.devo.com/probio/user/email/user@devo.com/domain/domainName@resellerName/role/role1

 

Response

Code

Description

Code

Description

200

Successful response. Role changed.

4xx

Bad request.

{ "error": { "code": 4xx, "message": "string" } }

PUT /user/internal/{id}

Update the information of a user that is independent of any specific domain.

 

Request

 

Path parameters

 

Add the following path parameters as part of the endpoint:

Parameter

Type

Description

Parameter

Type

Description

id required

string

ID of the user to be updated.

You can use either the query string parameters or request body indicated below to provide the updated values. If a request body is sent, the query string parameters will be ignored.

To delete an existing user value (like the phone number), set the field value to an empty string. To keep the existing value and not change it, either don't include the field in the request or set the field value to null.

Query string parameters

Query string parameters are added after the path parameters, preceded by a question mark (?) and separated by an ampersand (&).

Parameter

Type

Description

Parameter

Type

Description

email

string

New email address of the user.

phone

string

New phone number of the user. Must match the expression ^+(?:[0-9] ?){6,14}[0-9]$.

userName

string

New name of the user. Must match the expression ^(([a-zA-Z0-9-])+([ _'.@-]))([a-zA-Z0-9-])$.

Request body

The request JSON body must include the following key-value pairs:

Parameter

Type

Description

Parameter

Type

Description

email

string

New email address of the user.

phone

string

New phone number of the user. Must match the expression ^+(?:[0-9] ?){6,14}[0-9]$.

userName

string

New name of the user. Must match the expression ^(([a-zA-Z0-9-])+([ _'.@-]))([a-zA-Z0-9-])$.

Find below a request example:

https://api-us.devo.com/probio/user/internal/123-456-789