GenAuth DocsDocuments
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
AgentAuth
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
Development Integration
  • API

  • SDK

    • Java

    • Node.js

    • Python

      • Installation and Usage
      • Authentication Module

      • Management Module

        • User Management

        • Organization Management

        • Role Management

        • User Group Management

        • Custom Field Management

          • Get User Built-in Field List
          • Update User Built-in Field Configuration
          • Get Custom Field List
          • Create/Update Custom Field Definition
          • Set Custom Field Value
          • Get Custom Field Values for User/Group/Role/Organization
        • Resource and Permission Management

        • 管理应用

        • 管理身份源

        • 管理安全配置

        • 管理消息服务

        • 管理 Pipeline

        • 管理 Webhook

        • 获取审计日志

        • 管理计量计费

        • 事件
  • Error Codes
  1. Development Integration
  2. /
  3. SDK
  4. /
  5. Python
  6. /
  7. Management Module

  8. /
  9. Custom Field Management

  10. /
  11. Create/Update Custom Field Definition

¶ Create/modify custom field definitions

Update time: 2025-07-23 07:34:21
Edit

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

Create/modify user, department or role custom field definitions. If the passed key does not exist, create it, and if it exists, update it.

¶ Method name

ManagementClient.set_custom_fields

¶ Request parameters

NameType
Required
Default value
Description
Sample value
listSetCustomFieldDto[]Yes-Custom field list Array length limit: 50.
tenantIdstringNo-Tenant ID642c1df417c2d8a80d744c1d

¶ Request Response

Type: CustomFieldListRespDto

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 (not returned for successful requests). For a detailed list of error codes, please see: API Code List (opens new window)
requestIdstringRequest ID. Returned when the request fails.
dataarrayResponse data

Example results:

{
  "statusCode": 200,
  "message": "Success",
  "requestId": "934108e5-9fbf-4d24-8da1-c330328abd6c",
  "data": {
    "targetType": "USER",
    "createdAt": "2022-03-17T05:23:01.567Z",
    "dataType": "ENUM",
    "key": "school",
    "label": "School",
    "description": "School",
    "visibleInAdminConsole": true,
    "visibleInUserCenter": true,
    "i18n": {
      "label": {
        "zh-CN": {
          "enabled": false,
          "value": "中文"
        },
        "en-US": {
          "enabled": false,
          "value": "English"
        },
        "zh-TW": {
          "enabled": false,
          "value": "繁體中文"
        }
      }
    },
    "options": "[{\"value\":\"pku\",\"label\":\"xxxx\"}]"
  }
}

¶ Data Structure

¶ SetCustomFieldDto

NameType
Is it required?
Description
Sample value
targetTypestringYesSubject type, currently supports users, roles, groups and departmentsUSER
keystringYesField key, cannot conflict with the key of built-in fields, cannot be modified after setting.school
dataTypestringNoData type, cannot be modified after setting.
- STRING: string type
- NUMBER: number type
- DATETIME: date type
- BOOLEAN: Boolean type
- ENUM: enumeration value type
STRING
labelstringnodisplay nameschool
descriptionstringnodetailed descriptionschool
encryptedbooleannoencrypted storage. When enabled, the newly added data of this field will be encrypted. Once this parameter is set, it cannot be changed.
isUniquebooleannoIs it a unique field? When enabled, the value reported by the current field will be uniquely verified. This parameter is only for
userEditablebooleannoWhether the user can edit
visibleInAdminConsolebooleannoWhether it needs to be displayed in the GenAuth console:
- If it is a user-defined field, control whether it is displayed in the user details;
- If it is a department-defined field, control whether it is displayed in the department details;
- If it is a role extension field, control whether it is displayed in the role details.
true
visibleInUserCenterbooleannoWhether to display in the user's personal center (this parameter does not control whether the API interface is returned).true
validateRulesobjectNoValidation rules[{"type":"UNIQUE","content":"","error":"Already exists"}]
appIdsarrayNoApp Id list["appid1"]
desensitizationbooleanNoDesensitizationtrue
optionsarrayNoEnumeration value type selection Nested type: CustomFieldSelectOption.[{"value":"pku","label":"xxxxx"}]
i18nNoMulti-language display name Nested type: CustomFieldI18n.{"label":{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"},"zh-TW":{"enabled":false,"value":"繁體中文"}}}

¶ CustomFieldSelectOption

NameType
Is it required?
Description
Sample value
valuestringYesEnumeration value valuehust
labelstringYesEnumeration value labelHuazhong University of Science and Technology

¶ CustomFieldI18n

NameType
Is it required?
Description
Sample value
labelYesMulti-language support fields Nested type: LangObject.{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"},"zh-TW":{"enabled":false,"value":"繁體中文"},"ja-JP":{"enabled":false,"value":"日本語"}}

¶ LangObject

NameType
Is it required?
Description
Sample value
zh-CNYesMulti-language Chinese content Nested type: LangUnit.{"enabled":false,"value":"中文"}
en-USYesMultilingual English content Nesting type: LangUnit.{"enabled":false,"value":"English"}
zh-TWYesMultilingual Traditional Chinese content Nesting type: LangUnit.{"enabled":false,"value":"繁體中文"}
ja-JPYesMultilingual Japanese content Nesting type: LangUnit.{"enabled":false,"value":"日本語"}

¶ LangUnit

NameType
Is it required?
Description
Sample value
enabledbooleanyesWhether it is enabled. If enabled, and the console selects this language, the content will be displayed. (Default is off)
valuestringyesMultilingual content

¶ CustomFieldDto

NameType
Is it required?
Description
Sample value
targetTypestringYesTarget object type:
- USER: User
- ROLE: Role
- GROUP: Group
- DEPARTMENT: Department
USER
createdAtstringNoCreation time, only valid for custom fields, built-in fields do not have creation time.2022-03-17T05:23:01.567Z
dataTypestringYesData type, cannot be modified after setting.
- STRING: string type
- NUMBER: number type
- DATETIME: date type
- BOOLEAN: Boolean type
- ENUM: enumeration value type
STRING
keystringyesfield key, cannot conflict with the key of built-in fields, cannot be modified after setting.school
labelstringyesdisplay nameschool
descriptionstringnodetailed description informationschool
encryptedbooleannowhether to store encrypted. After enabling, newly added data of this field will be encrypted, and this parameter cannot be changed once set.
isUniquebooleanyeswhether it is a unique field. After enabling, the value reported by the current field will be uniquely verified. This parameter is only valid for fields with data types of strings and numbers.
userEditablebooleannoWhether the user can edit. If it is a special field such as mobile phone number or email address, the user cannot modify it directly and needs to verify it first through verification code or other methods.
visibleInAdminConsolebooleanyesWhether to display in the GenAuth console:
- If it is a user-defined field, control whether to display in user details;
- If it is a department-defined field, control whether to display in department details;
- If it is a role extension field, control whether to display in role details.
true
visibleInUserCenterbooleannoWhether to display in the user's personal center (this parameter does not control whether the API interface is returned).true
i18nnoMulti-language display name Nested type: CustomFieldI18n.{"label":{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"},"zh-TW":{"enabled":false,"value":"繁體中文"}}}
optionsarraynoEnumeration value type selection Nested type: CustomFieldSelectOption.[{"value":"pku","label":"xxxxx"}]

¶ CustomFieldI18n

NameType
Is this field required?
Description
Sample value
labelyesField that supports multiple languages ​​Nested type: LangObject.{"zh-CN":{"enabled":false,"value":"中文"},"en-US":{"enabled":false,"value":"English"},"zh-TW":{"enabled":false,"value":"繁體中文"},"ja-JP":{"enabled":false,"value":"日本語"}}

¶ LangObject

NameType
Required
Description
Sample value
zh-CNYesMultilingual Chinese content Nested type: LangUnit.{"enabled":false,"value":"中文"}
en-USYesMultilingual English content Nesting type: LangUnit.{"enabled":false,"value":"English"}
zh-TWYesMultilingual Traditional Chinese content Nesting type: LangUnit.{"enabled":false,"value":"繁體中文"}
ja-JPYesMultilingual Japanese content Nesting type: LangUnit.{"enabled":false,"value":"日本語"}

¶ LangUnit

NameType
Is it required?
Description
Sample value
enabledbooleanyesIs it enabled? If enabled, and the console selects this language, the content will be displayed. (Closed by default)
valuestringYesMultilingual content

¶ CustomFieldSelectOption

NameType
Is it required?
Description
Sample value
valuestringYesEnumeration value valuehust
labelstringYesEnumeration value labelHuazhong University of Science and Technology
Previous article: Get Custom Field List Next article: Set Custom Field Value
  • Method name
  • Request parameters
  • Request Response
  • Data Structure

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.