Skip to main content

Create Tokenization

This API creates a new tokenization function using the specified format-preserving encryption method and settings. The tokenization can be configured with a tweak type, data type, partial tokenization, and managed within a group.


Endpoint Details

URL /v1/tokenize/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 2",
"description": "",
"method": "FF3_1",
"tweak_type": "internal",
"data_type": "General",
"sub_type": "Email",
"custom_pattern": "",
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"partial": {
"enabled": false,
"type": "",
"left": 0,
"right": 0
},
"exportable": true
}

Parameters

ParameterTypeDescription
nameStringName of the tokenization function
descriptionStringOptional description of the tokenization function
methodStringFormat-preserving encryption method to be used
tweak_typeStringType of tweak used by the tokenization method
data_typeStringCategory of data to be tokenized
sub_typeStringSpecific data sub-type within the selected data type
custom_patternStringRegex pattern used when data_type is set to Custom
group_idUUIDIdentifier of the group associated with the tokenization function
partialObjectPartial tokenization function
enabledBooleanIndicates whether partial tokenization is enabled
typeStringPartial tokenization type used when enabled is true
leftIntegerNumber of leftmost units preserved during partial tokenization
rightIntegerNumber of rightmost units preserved during partial tokenization
exportableBooleanIndicates whether the tokenization key can be exported

Response

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

Response
{
"function": {
"id": "07b2e230-7a94-4d04-9251-c3d5aac89d05",
"name": "Dummy 2",
"method": "FF3_1",
"tweak_type": "internal",
"data_type": "General",
"sub_type": "Email",
"group_id": "81ad4d05-d11a-4809-b1f2-cc000c086730",
"created_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"updated_by": "0a937c60-0ed4-4d06-870a-2e284b54287d",
"created_at": 1783569945,
"updated_at": 1783569945,
"lock_ring_id": "tokenize/07b2e230-7a94-4d04-9251-c3d5aac89d05",
"exportable": true
}
}

Field Descriptions

FieldTypeDescription
idUUIDUnique identifier of the tokenization function
nameStringName of the tokenization function
methodStringFormat-preserving encryption method used by the function
tweak_typeStringType of tweak used by the tokenization method
data_typeStringCategory of data to be tokenized
sub_typeStringSpecific data sub-type within the selected data type
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_atIntegerCreation timestamp in Unix format
updated_atIntegerLast update timestamp in Unix format
lock_ring_idStringInternal identifier associated with the tokenization function
exportableBooleanIndicates whether the tokenization key can be exported

info
  • A valid Bearer Token is required to access this endpoint.
  • Supported method values are:
    • FF1
    • FF3_1
  • Supported tweak_type values are:
    • Internal
    • Generated
    • Supplied
  • Supported data_type values and their sub_type options:
    • General → Name, Email, IMEI, IPv4, Date
    • Identifier → NIK, Passport, NPWP, Credit Card, Driver License
    • Custom → when selected, custom_pattern must be filled with a valid regex format.
  • When partial.enabled is set to true, the partial.type must be specified. Supported types are:
    • Percentage
    • Character
  • When exportable is set to true, the tokenization key can be exported according to the system's access control policies.