Skip to content

Create a role

This document is automatically generated based on https://github.com/authing/authing-docs-factory based on https://api-explorer.genauth.ai V3 API, and is consistent with API parameters and return results. If the document description is incorrect, please refer to V3 API.

Create a role through the role code in the permission group (permission space), and you can select the permission group, role description, role name, etc.

Method name

ManagementClient.create_role

Request parameters

NameTypeRequiredDefault valueDescriptionSample value
codestringyes-Unique identifier of the role in the permission group (permission space)manager
namestringno-Name of the role in the permission group (permission space)manager
namespacestringnodefaultCode of the permission group (permission space) to which the user belongs. If the code is not passed, the default permission group will be obtained.default
descriptionstringNo-Role descriptionthis is role manager description
disableTimestringNo-Role automatic ban time, in milliseconds, if null is passed, it means permanent1669881887852

Request Response

Type: RoleSingleRespDto

NameTypeDescription
statusCodenumberBusiness status code, which can be used to determine whether the operation is successful. 200 means success.
messagestringDescription
apiCodenumberSegmented error code, which can be used to get the specific error type (successful request does not return). For a detailed list of error codes, see: API Code List
requestIdstringRequest ID. Returned when the request fails.
data<a RoleDtoResponse data

Sample result:

json
{
  "statusCode": 200,
  "message": "Success",
  "requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
  "data": {
    "id": "60b49eb83fd80adb96f26e68",
    "code": "role1",
    "name": "role1",
    "description": "this is role description",
    "namespace": "default",
    "namespaceName": "Example permission name",
    "status": "ENABLE",
    "disableTime": "1669881887852"
  }
}

Data Structure

RoleDto

NameTypeIs it required?DescriptionSample value
idstringYesRole ID60b49eb83fd80adb96f26e68
codestringYesUnique identifier of the role in the permission group (permission space) Coderole1
namestringYesRole name in the permission group (permission space)role1
descriptionstringYesRole descriptionthis is role description
namespacestringYesCode of the permission group (permission space). If not passed, the default permission group is obtained.default
namespaceNamestringyesThe name of the permission group (permission space)Sample permission name
statusstringnoRole status, ENABLE- means normal, DISABLE- means disabledENABLE
disableTimenumbernoRole automatic disable time, in milliseconds, if null is passed, it means permanent1669881887852

Agent infrastructure for identity, memory, and web action.