Skip to main content

API Reference

The full interactive API is available at http://localhost:8080/swagger-ui when running locally.

Request Lifecycle​

Spec Management​

Create a Spec​

POST /api/v1/specs
Content-Type: application/json

Request body:

{
"name": "Bank Transactions CSV",
"format": "CSV",
"hasHeader": true,
"delimiter": ",",
"fields": [
{
"name": "accountNumber",
"type": "STRING",
"columnName": "account_number",
"sensitive": true
},
{
"name": "amount",
"type": "DECIMAL",
"columnName": "amount"
},
{
"name": "transactionDate",
"type": "DATE",
"columnName": "date",
"format": "yyyy-MM-dd"
},
{
"name": "description",
"type": "STRING",
"columnName": "description",
"required": false
}
],
"correctionRules": [
{
"ruleId": "trim-desc",
"field": "description",
"correctionType": "TRIM"
}
],
"validationRules": [
{
"ruleId": "amount-positive",
"field": "amount",
"ruleType": "MIN_VALUE",
"value": "0",
"message": "Amount must be positive",
"severity": "ERROR"
}
]
}

Response: 201 Created with the created spec including its id.

List Specs​

GET /api/v1/specs

Response: 200 OK β€” array of all registered specs.

Get Spec​

GET /api/v1/specs/{id}

Response: 200 OK β€” the spec, or 404 if not found.

Delete Spec​

DELETE /api/v1/specs/{id}

Response: 204 No Content


Transform Operations​

File β†’ Events (Kafka)​

Parse a file and publish each record as a Kafka message.

POST /api/v1/transform/file-to-events
Content-Type: multipart/form-data
FieldTypeDescription
fileFileThe file to transform
specIdString (UUID)ID of the registered FileSpec
kafkaTopicStringKafka topic to publish records to
skipInvalidRecordsBooleanSkip records with errors (default: false)

Response:

{
"status": "SUCCESS",
"totalRecords": 1000,
"processedRecords": 998,
"failedRecords": 2,
"skippedRecords": 0,
"durationMs": 342
}

Validate File (Dry Run)​

Parse and validate without writing to any destination.

POST /api/v1/transform/validate
Content-Type: multipart/form-data
FieldTypeDescription
fileFileThe file to validate
specIdString (UUID)ID of the registered FileSpec

Response: Same ProcessingResult shape, with errors for each invalid record included.


Field Types​

TypeDescriptionExample value
STRINGPlain text"John Doe"
INTEGERWhole number42
DECIMALDecimal number10.50
DATEDate with optional format"2024-01-15"
BOOLEANTrue/falsetrue

Correction Types​

TypeDescription
TRIMRemove leading/trailing whitespace
PAD_LEFTLeft-pad with a character to a target length
PAD_RIGHTRight-pad with a character to a target length
UPPER_CASEConvert to uppercase
LOWER_CASEConvert to lowercase
REGEX_REPLACEReplace regex match with a replacement string
COERCE_DATEParse date with a source format, reformat to target
DEFAULT_IF_NULLReplace null/blank with a default value

Validation Rule Types​

TypeDescription
REQUIREDField must be non-null and non-empty
MIN_VALUENumeric value must be β‰₯ value
MAX_VALUENumeric value must be ≀ value
REGEXField must match the regex in value
MIN_LENGTHString length must be β‰₯ value
MAX_LENGTHString length must be ≀ value
DATE_RANGEDate must be within the specified range
ALLOWED_VALUESField must be one of the comma-separated value list

Severity Levels​

LevelPipeline behaviour
WARNINGAttached to record; never causes skipping
ERRORAttached to record; causes skip if skipInvalidRecords=true
FATALRecord is always skipped; increments failedRecords