User Roles
Manage User Roles
Get User Roles
GET
‎https://<domain>/<api prefix>/<version>/user/get/roles/
This API endpoint will give you the user roles details.
Headers
apikey*
string
apikey
Authorization*
string
Bearer access-token
Sample code
Node
PHP
Upgrade User Role
POST
‎https://<domain>/<api prefix>/<version>/upgrade/user-role/
This API endpooint will upgrade a user role from customer to preferred customer or to member.
Headers
apikey*
string
apikey
Authorization*
string
Bearer access token
Request Body
unique_id*
string
User unique id.
upgrade_to*
string
Upgrade options, possible values are: Member - Upgrade user role from customer to member. Preferred Customer - Upgrade user role from customer to preferred customer.
api_place_genealogy
string
api_place_genealogy is required when upgrading the role from customer to preferred customer. Possible values are: True - Place the user in genealogy when upgrading to preferred customer False - Do not place the user in genealogy.
Sample Code
Node
PHP
Status Code
Error Type
Field
Description
400
Validation Error
unique_id
This field is required and its may not be blank.
User not exist or invalid unique id.
Ensure this field has no more than 255 characters.
400
Validation Error
upgrade_to
This field is required and its may not be blank.
Invalid upgrade option, Choose a valid one.
400
Validation Erorr
api_place_genealogy
This field is required and its may not be blank.
Choose a valid option.
403
Request Failed
User role is already upgraded.
User already have a member role.
User already have a preferred customer role.
Free user place genealogy disabled, can't upgrade user role.
Free package for user role upgrade is not created.
User role upgrade option not found.
Created free package is not a customer privilaged package.
Created free package is not a member privilaged package.
Downgrade User Role
POST
‎https://<domain>/<api prefix>/<version>/downgrade/user-role/
This API endpoint will downgrade a user role from member to preferred customer or to customer.
Headers
apikey*
string
apikey
Authorization*
string
Bearer access token
Request Body
unique_id*
string
user unique id
downgrade_to*
string
Downgrade options, possible values are: Customer - Downgrade user role from member to customer. Preferred Customer - Downgrade user role from member to preferred customer
api_block_user*
string
Block the user with role downgrade, Possible values are: True - Block user account. False - Do not block.
Sample Code
Node
PHP
Error Responses
Status Code
Error Type
Field
Description
400
Validation Error
unique_id
This field is required and its may not be blank.
User not exist or invalid unique id.
Ensure this field has no more than 255 characters.
400
Validation Error
downgrade_to
This field is required and its may not be blank.
Invalid downgrade option, Choose a valid one.
400
Validation Erorr
api_block_user
Choose a valid option.
403
Request Failed
User already have a downgraded role.
User already have a customer role.
User already have a preferred customer role.
Somthing went wrong.
Last updated