Updated on 2026-01-13 GMT+08:00

Creating a Masking Algorithm

Function

This API is used to add a masking algorithm.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/sdg/server/mask/algorithms

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

algorithm

No

String

Encryption and masking algorithm type. The value can be SHA256, SHA512, PRESNM, MASKNM, PRESXY, MASKXY, SYMBOL, KEYWORD, NULL, EMPTY, DATE, NUMERIC, AES, EMBED, SM4, or DECRYPT.

algorithm_id

No

String

Unique ID of the masking algorithm.

algorithm_name

No

String

Name of the masking algorithm.

algorithm_type

No

String

Type of the masking algorithm, such as hash masking and encryption masking. The value can be MASK_BY_HASH, MASK_BY_ENCRYPT, MASK_BY_OVERWRITE, MASK_BY_KEYWO RDS _EXCHANGE, MASK_BY_NULL, or MASK_BY.

category

No

String

Type of the masking algorithm. The value can be BUILT_IN, BUILT_IN_COPY (copied built-in algorithm), or BUILT_SELF (customized algorithm).

data

No

String

Data content processed by the masking algorithm.

parameter

No

String

Configuration parameters of the masking algorithm.

processed_data

No

String

Data content after masking.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

msg

String

Returned message content, which is used to describe the operation result.

status

String

Returned status code. For example, 200 indicates success, and 400 indicates an error.

Status code: 201

Resource creation.

Example Requests

POST /v1/{project_id}/sdg/server/mask/algorithms

{
  "algorithm" : "PRESNM",
  "algorithm_id" : "",
  "algorithm_name" : "alg1",
  "algorithm_type" : "MASK_BY_OVERWRITE",
  "category" : "BUILT_SELF",
  "parameter" : {
    "\\\"type\\\":\\\"CHAR\\\"" : null,
    "\\\"first\\\":\\\"2\\\"" : null,
    "\\\"second\\\":\\\"2\\\"" : null,
    "\\\"method\\\":\\\"*\\\"" : null
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

Created.

201

Resource creation.

401

Unauthorized.

403

Access denied.

404

Resource not found.

Error Codes

See Error Codes.