Data Loading
Endpoints for loading tariff data from source files. Loading is asynchronous, the API returns immediately with a job ID and processes the file in the background.
POST /api/v1/load
Start an asynchronous data load from a file in the source-data/ directory.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
file_name | string | Name of the file in source-data/ (required) |
Response 202
{
"job_id": "abc-123-def",
"status": "accepted"
}Validation
- File name must not contain path traversal characters (
..,/,\) - File must exist in the
source-data/directory - Supported formats:
.txt,.csv,.xlsx
Rate Limit
5 requests per minute when rate limiting is enabled.
Errors
| Status | Condition |
|---|---|
400 | Invalid file name or file not found |
429 | Rate limited |
GET /api/v1/load/status/{job_id}
Check the status of an asynchronous load job.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
job_id | string | Job ID from the load response |
Response 200
In progress:
{
"job_id": "abc-123-def",
"status": "accepted",
"rows_loaded": null,
"error": null
}Completed:
{
"job_id": "abc-123-def",
"status": "completed",
"rows_loaded": 19228,
"error": null
}Failed:
{
"job_id": "abc-123-def",
"status": "failed",
"rows_loaded": null,
"error": "File format not recognized"
}Job Lifecycle
| Status | Meaning |
|---|---|
accepted | Job is queued or in progress |
completed | Successfully loaded |
failed | Error during loading |
Jobs expire after 3600 seconds (1 hour).
Errors
| Status | Condition |
|---|---|
404 | Job ID not found or expired |