Skip to main content

Create Data Masking

This API creates a new masking function using the specified masking type and settings. The masking function can be assigned to users and managed within a group.


Endpoint Details

URL /v1/masking/functions
Method POST
Authorization Bearer Token

Request Headers

HeaderTypeDescription
Content-TypeStringMust be application/json

Request Body

Use the following format to make a request:

JSON Request
{
"name": "dummy",
"description": "",
"masking_type": 2,
"masking_character": "*",
"partial_masking_option": 1,
"mask_percentage": 0,
"masking_start_position": 0,
"masking_end_position": 0,
"allow_special_character": false,
"allow_white_space": false,
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"assigned_user_ids": [
"0a937c60-0ed4-4d06-870a-2e284b54287d"
]
}

Parameters

ParameterTypeDescription
nameStringName of the masking function
descriptionStringOptional description of the masking function
masking_typeIntegerType of masking to be applied
masking_characterStringCharacter used to mask the data
partial_masking_optionIntegerPosition option used for partial masking
mask_percentageIntegerPercentage of data to be masked, used for random masking
masking_start_positionIntegerNumber of original characters shown at the beginning of the data
masking_end_positionIntegerNumber of original characters shown at the end of the data
allow_special_characterBooleanIndicates whether special characters are preserved from masking
allow_white_spaceBooleanIndicates whether white spaces are preserved from masking
group_idUUIDIdentifier of the group associated with the masking function
assigned_user_idsArrayList of user IDs authorized to use the masking function

Response

Here is an example response after the request has been successfully processed:

Response
{
"function": {
"id": "4155dc15-a0a7-4b89-9fda-983beec2b077",
"tenant_id": "5ebde17c-01a1-4394-977b-9e611250cf5d",
"name": "Dummy",
"masking_character": "*",
"masking_type": 2,
"partial_masking_option": 1,
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": "2026-07-13T14:46:08+07:00",
"updated_at": "2026-07-13T14:46:08+07:00",
"assigned_user_ids": [
"0a937c60-0ed4-4d06-870a-2e284b54287d"
]
}
}

Field Descriptions

FieldTypeDescription
idUUIDUnique identifier of the masking function
tenant_idUUIDIdentifier of the tenant that owns the masking function
nameStringName of the masking function
masking_characterStringCharacter used to mask the data
masking_typeIntegerType of masking applied by the function
partial_masking_optionIntegerPosition option used for partial masking
group_idUUIDIdentifier of the associated group
created_byUUIDIdentifier of the user who created the function
updated_byUUIDIdentifier of the user who last updated the function
created_atStringCreation timestamp in RFC 3339 date-time format
updated_atStringLast update timestamp in RFC 3339 date-time format
assigned_user_idsArrayList of user IDs assigned to the masking function

info
  • A valid Bearer Token is required to access this endpoint.
  • Supported masking_type values are:
    • 1 = Full Masking
    • 2 = Partial Masking
    • 3 = Random Masking
    • 4 = Custom Masking
  • Supported partial_masking_option values (used when masking_type is 2):
    • 1 = Prefix
    • 2 = Suffix
  • mask_percentage accepts a value between 1 and 100 and is used for random masking.
  • masking_start_position defines how many original characters are shown at the beginning of the data and is used for custom masking.
  • masking_end_position defines how many original characters are shown at the end of the data and is used for custom masking.