HTS MCP
Skip to Content
REST APIData Loading

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

ParameterTypeDescription
file_namestringName 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

StatusCondition
400Invalid file name or file not found
429Rate limited

GET /api/v1/load/status/{job_id}

Check the status of an asynchronous load job.

Path Parameters

ParameterTypeDescription
job_idstringJob 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

StatusMeaning
acceptedJob is queued or in progress
completedSuccessfully loaded
failedError during loading

Jobs expire after 3600 seconds (1 hour).

Errors

StatusCondition
404Job ID not found or expired