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
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must 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
| Parameter | Type | Description |
|---|---|---|
| name | String | Name of the tokenization function |
| description | String | Optional description of the tokenization function |
| method | String | Format-preserving encryption method to be used |
| tweak_type | String | Type of tweak used by the tokenization method |
| data_type | String | Category of data to be tokenized |
| sub_type | String | Specific data sub-type within the selected data type |
| custom_pattern | String | Regex pattern used when data_type is set to Custom |
| group_id | UUID | Identifier of the group associated with the tokenization function |
| partial | Object | Partial tokenization function |
| enabled | Boolean | Indicates whether partial tokenization is enabled |
| type | String | Partial tokenization type used when enabled is true |
| left | Integer | Number of leftmost units preserved during partial tokenization |
| right | Integer | Number of rightmost units preserved during partial tokenization |
| exportable | Boolean | Indicates 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
| Field | Type | Description |
|---|---|---|
| id | UUID | Unique identifier of the tokenization function |
| name | String | Name of the tokenization function |
| method | String | Format-preserving encryption method used by the function |
| tweak_type | String | Type of tweak used by the tokenization method |
| data_type | String | Category of data to be tokenized |
| sub_type | String | Specific data sub-type within the selected data type |
| group_id | UUID | Identifier of the associated group |
| created_by | UUID | Identifier of the user who created the function |
| updated_by | UUID | Identifier of the user who last updated the function |
| created_at | Integer | Creation timestamp in Unix format |
| updated_at | Integer | Last update timestamp in Unix format |
| lock_ring_id | String | Internal identifier associated with the tokenization function |
| exportable | Boolean | Indicates whether the tokenization key can be exported |
info
- A valid Bearer Token is required to access this endpoint.
- Supported
methodvalues are:- FF1
- FF3_1
- Supported
tweak_typevalues are:- Internal
- Generated
- Supplied
- Supported
data_typevalues and theirsub_typeoptions:- General → Name, Email, IMEI, IPv4, Date
- Identifier → NIK, Passport, NPWP, Credit Card, Driver License
- Custom → when selected,
custom_patternmust be filled with a valid regex format.
- When
partial.enabledis set totrue, thepartial.typemust be specified. Supported types are:- Percentage
- Character
- When
exportableis set totrue, the tokenization key can be exported according to the system's access control policies.