YAML to TSV API¶
Overview¶
Convert YAML input to TSV. Body mode processes the supplied text synchronously. URL and file modes submit an asynchronous job.
Endpoint¶
POST https://api.apidatatools.com/yaml-to-tsv-api
Authentication¶
Include your API key in the x-api-key header:
x-api-key: YOUR_API_KEY
Input modes¶
| Mode | Description | Processing |
|---|---|---|
body | Send YAML text directly in the request body. | Synchronous |
url | Send a JSON object containing a URL to a YAML file. | Asynchronous |
file | Send a JSON object containing a pre-uploaded file reference. | Asynchronous |
Headers¶
Header names are case-insensitive. The spellings below are the documented lowercase forms.
| Header | Type | Required | Default / values | Description |
|---|---|---|---|---|
x-api-key | String | Yes | No default | Your API key. |
x-source-type | String | No | Default: body; values: body, url, file | Selects the input mode. |
Accepted file extensions¶
For URL and file modes, the accepted extensions are .yml, .yaml, .txt, and .log.
Request body¶
Body mode¶
Send raw YAML text as the request body. Do not wrap the YAML in a JSON object.
URL mode¶
Send a JSON object with a url property:
{
"url": "https://example.com/input.yaml"
}
File mode¶
Send a JSON object with a file property containing the exact storage key returned by the upload workflow:
{
"file": "S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"
}
curl examples¶
Body mode¶
curl -X POST "https://api.apidatatools.com/yaml-to-tsv-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: body" \
-H "Content-Type: text/plain" \
--data @input.yaml
URL mode¶
curl -X POST "https://api.apidatatools.com/yaml-to-tsv-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: url" \
-H "Content-Type: application/json" \
--data '{"url":"https://example.com/input.yaml"}'
File mode¶
curl -X POST "https://api.apidatatools.com/yaml-to-tsv-api" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-source-type: file" \
-H "Content-Type: application/json" \
--data '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'
Success responses¶
Synchronous body mode¶
A successful file-producing response has request_id, status, file, and preview fields:
{
"request_id": "REQUEST_ID",
"status": "success",
"file": "TEMPORARY_DOWNLOAD_URL",
"preview": "..."
}
The download URL is temporary; its retention period depends on your plan.
Asynchronous URL and file modes¶
A successfully accepted job returns HTTP 202:
{
"status": "accepted",
"job_id": "JOB_ID",
"status_url": "https://api.apidatatools.com/jobs/JOB_ID",
"request_id": "REQUEST_ID"
}
Async job status¶
Poll the status URL returned when the job is accepted:
GET https://api.apidatatools.com/jobs/{job_id}
Include your x-api-key header on the GET request. A successful status lookup returns the job fields below.
Queued¶
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "queued",
"created_at": 0,
"updated_at": 0,
"message": "Your job is being processed.",
"retry_after": 2
}
Processing¶
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "processing",
"created_at": 0,
"updated_at": 0,
"message": "Your job is being processed.",
"retry_after": 2
}
Success¶
On success, result contains the job’s response body:
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "success",
"created_at": 0,
"updated_at": 0,
"result": {
"status": "success",
"file": "TEMPORARY_DOWNLOAD_URL",
"preview": "..."
}
}
The download URL is temporary; its retention period depends on your plan.
Failed¶
{
"request_id": "REQUEST_ID",
"job_id": "JOB_ID",
"status": "failed",
"created_at": 0,
"updated_at": 0,
"error": {
"code": "ERROR_CODE",
"message": "Error message",
"details": {}
}
}
The error code and message depend on the failure. The details object may contain additional information.
Error handling¶
API errors use this envelope. details may include additional fields:
{
"status": "error",
"error": "ERROR_CODE",
"request_id": "REQUEST_ID",
"details": {
"message": "Error message"
}
}
The following statuses are grounded in the request and status handlers:
| HTTP status | Error codes | Context |
|---|---|---|
400 | INVALID_SOURCE_TYPE, INVALID_BODY_ENCODING, EMPTY_BODY | Invalid source mode, body encoding, or empty request body. |
400 | INVALID_BODY, INVALID_URL, URL_UNREACHABLE, URL_NOT_OK, INVALID_FILE, FILE_UNAVAILABLE, INVALID_FILE_EXTENSION | Invalid or unavailable asynchronous input. |
400 | INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, DDB_ERROR | Job status lookup errors. Tool errors from the status endpoint are returned as HTTP 400. |
401 | UNAUTHORIZED | Authentication failed. |
404 | USER_NOT_FOUND, UNKNOWN_FUNCTION | User or endpoint was not found. |
413 | PAYLOAD_TOO_LARGE, FILE_TOO_LARGE | Request body or input file exceeds the applicable limit. |
429 | QUOTA_EXCEEDED, RATE_LIMITED | Plan quota or rate limit exceeded. |
500 | PLAN_NOT_FOUND, CONFIG_ERROR, PLAN_CONFIG_ERROR, INTERNAL_ERROR | Plan configuration, async configuration, or processing error. |
Asynchronous jobs may also end in a failed state with codes such as DOWNLOAD_FAILED, UPLOAD_FAILED, or INVALID_JOB. These appear in the job status response; they are not HTTP statuses for the status lookup.
Notes¶
- Body-size, file-size, quota, rate, and output-retention limits depend on your plan. See tool limits.
- URL and file modes require a JSON request body. URL inputs must use an accepted extension; file mode requires the exact storage key returned by the upload workflow.
- Download URLs are temporary, and retention is plan-dependent.