Field Encryption Utils
API Contract
REST
/api/v1/field-encryption
7 endpoints
GET
/api/v1/field-encryption/api/v1/field-encryption
List encrypted field configurations
Public
Response Example
{
"data": [
{
"field_key": "date_of_birth",
"key_ref": "kms-key-2025-a",
"encrypted": true,
"maskable": true
},
{
"field_key": "national_id",
"key_ref": "kms-key-2025-b",
"encrypted": true,
"maskable": true
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 5
}
}
GET
/api/v1/field-encryption/api/v1/field-encryption/:fieldKey
Get encryption config for a specific field
Public
Response Example
{
"field_key": "date_of_birth",
"key_ref": "kms-key-2025-a",
"encrypted": true,
"maskable": true,
"mask_pattern": "****-**-**"
}
POST
/api/v1/field-encryption/api/v1/field-encryption/decrypt
Decrypt an encrypted field value (decryptField)
Public
Request Example
{
"encrypted_value": "AQICAHi3p9...base64encoded==",
"key_ref": "kms-key-2025-a",
"field_key": "date_of_birth"
}
Response Example
{
"field_key": "date_of_birth",
"decrypted_value": "1988-04-21",
"decrypted_at": "2026-03-26T11:15:00Z"
}
PUT
/api/v1/field-encryption/api/v1/field-encryption/:fieldKey
Update encryption config for a field
Public
Request Example
{
"key_ref": "kms-key-2026-a",
"maskable": true
}
Response Example
{
"field_key": "date_of_birth",
"key_ref": "kms-key-2026-a",
"maskable": true,
"updated_at": "2026-03-26T12:10:00Z"
}
DELETE
/api/v1/field-encryption/api/v1/field-encryption/:fieldKey
Remove encryption config for a field
Public
Response Example
{
"field_key": "national_id",
"deleted": true,
"deleted_at": "2026-03-26T12:50:00Z"
}
POST
/api/v1/field-encryption/api/v1/field-encryption/check-decryptable
Check if an encrypted value is decryptable (isDecryptable)
Public
Request Example
{
"encrypted_value": "AQICAHi3p9...base64encoded=="
}
Response Example
{
"encrypted_value": "AQICAHi3p9...base64encoded==",
"is_decryptable": true,
"checked_at": "2026-03-26T11:16:00Z"
}
GET
/api/v1/field-encryption/api/v1/field-encryption/:fieldKey/mask
Get masked display value for a field (maskFieldValue)
Public
Response Example
{
"field_key": "date_of_birth",
"masked_value": "****-**-21",
"mask_pattern": "****-**-DD"
}