Skip to main content
Version: 2.3.0

Get list of roles

Updated date: 18/08/2026
Updated by: VNPT eContract's team


Purpose​

Function to retrieve the list of roles of a user in the current company

  • Request URL: /api/roles
  • HTTP method: GET
  • Authorize: Bearer token
  • Parameter: Not required, but additional options can be added below to filter or search the list of user roles.
KeyTypeDescription
searchstringSearch information by role code or role name
pageintPage number (default is 1)
pagesizeintPage size (default is 10 records)

Sample request​

Query param:
page: 1
pageSize: 10
search: Default
Request: /api/roles?page=1&pageSize=10&search=Default

Sample response body​

{
"data": {
"items": [
{
"id": "2b999cd0-32ec-4e4a-16b8-08da6df5fc5a",
"code": "Default",
"name": "Default role",
"description": "Default role with permissions to create, duplicate, and process documents."
}
],
"totalCount": 1,
"pageCount": 1,
"page": 1,
"pageSize": 10,
"hasNextPage": false,
"hasPreviousPage": false
},
"success": true,
"code": 0,
"messages": []
}

Response Body Description​

KeyTypeDescription
successbooleanResponse status (true: Success, false: Failure)
codeintResponse code from the system
messagesarrayList of messages returned by the system
dataobjectObject containing the list of roles and pagination data (see details below)

Details of data:​

KeyTypeDescription
itemsarrayList of detailed role information (see details below)
totalCountintTotal number of roles matching the filter criteria
pageCountintTotal number of pages
pageintCurrent page
pageSizeintNumber of records per page
hasNextPagebooleanWhether there is a next page (true: Yes, false: No)
hasPreviousPagebooleanWhether there is a previous page (true: Yes, false: No)

Details of objects in the items array:​

KeyTypeDescription
idstringRole ID (GUID format)
codestringRole code (e.g., Default)
namestringRole name (e.g., Default)
descriptionstringDetailed description of the role's permissions or scope