Skip to content

YAML to Excel API

Overview

Convert YAML input to an Excel file. Body mode processes the input synchronously. URL and file modes create an asynchronous job.

Endpoint

Method URL
POST https://api.apidatatools.com/yaml-to-excel-api

Authentication

Include your API key in the x-api-key header on every request:

x-api-key: YOUR_API_KEY

Input modes

Select a mode with the x-source-type header:

  • body — send YAML text directly; processed synchronously. This is the default.
  • url — submit a URL to a YAML file; processed asynchronously.
  • file — submit a pre-uploaded file reference; processed asynchronously.

Headers

Header names are case-insensitive. Use the lowercase spellings shown here.

Header Type Required Default / values Description
x-api-key String Yes Your API key Authenticates the request.
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 the YAML as raw text. Do not wrap it in a JSON object.

URL mode

Send a JSON object with a url field:

{
  "url": "https://example.com/input.yaml"
}

File mode

Send a JSON object with a file field containing the exact storage key returned by the upload workflow:

{
  "file": "S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"
}

curl examples

Replace YOUR_API_KEY with your API key.

Body mode

curl -X POST 'https://api.apidatatools.com/yaml-to-excel-api' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-source-type: body' \
  --data-raw $'name: Ada\nrole: analyst'

URL mode

curl -X POST 'https://api.apidatatools.com/yaml-to-excel-api' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-source-type: url' \
  --data-raw '{"url":"https://example.com/input.yaml"}'

File mode

curl -X POST 'https://api.apidatatools.com/yaml-to-excel-api' \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'x-source-type: file' \
  --data-raw '{"file":"S3_KEY_RETURNED_BY_THE_UPLOAD_WORKFLOW"}'

Success responses

Synchronous body mode

A successful file-producing response has HTTP 200 and includes request_id, status, file, and preview:

{
  "request_id": "REQUEST_ID",
  "status": "success",
  "file": "https://downloads.apidatatools.com/OUTPUT_FILE",
  "preview": "OUTPUT_PREVIEW"
}

The download URL is temporary; retention depends on your plan.

Asynchronous URL and file modes

A successfully accepted job has HTTP 202:

{
  "status": "accepted",
  "job_id": "JOB_ID",
  "status_url": "https://api.apidatatools.com/jobs/JOB_ID",
  "request_id": "REQUEST_ID"
}

Async job status

Check a job with GET https://api.apidatatools.com/jobs/{job_id}. Include the x-api-key header. A successful status lookup returns HTTP 200 and these fields:

  • Queued or processing:
{
  "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
}

For a processing job, status is "processing"; the other fields have the same shape.

  • Success:
{
  "request_id": "REQUEST_ID",
  "job_id": "JOB_ID",
  "status": "success",
  "created_at": 0,
  "updated_at": 0,
  "result": {
    "status": "success",
    "file": "https://downloads.apidatatools.com/OUTPUT_FILE",
    "preview": "OUTPUT_PREVIEW"
  }
}
  • 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 created_at and updated_at values are timestamps. Job failure codes describe the job outcome in the status response; they are not necessarily HTTP status codes for the status request.

Error handling

Errors use this envelope; additional fields may appear in details:

{
  "status": "error",
  "error": "ERROR_CODE",
  "request_id": "REQUEST_ID",
  "details": {
    "message": "Error message"
  }
}

The following HTTP statuses and error codes are defined for this endpoint and its asynchronous job creation and status flows:

HTTP status Error codes Applies to
400 INVALID_SOURCE_TYPE, INVALID_BODY_ENCODING, EMPTY_BODY Request validation
400 INVALID_BODY, INVALID_URL, URL_UNREACHABLE, URL_NOT_OK, INVALID_FILE, FILE_UNAVAILABLE, INVALID_FILE_EXTENSION Asynchronous job creation
400 INVALID_JOB_ID, JOB_NOT_FOUND, FORBIDDEN, DDB_ERROR Job status lookup
401 UNAUTHORIZED Authentication
404 USER_NOT_FOUND, UNKNOWN_FUNCTION User lookup or unsupported endpoint
413 PAYLOAD_TOO_LARGE Body mode
413 FILE_TOO_LARGE URL/file mode or asynchronous job processing
429 QUOTA_EXCEEDED, RATE_LIMITED Usage limits
500 PLAN_NOT_FOUND, INTERNAL_ERROR Configuration or processing
500 CONFIG_ERROR, PLAN_CONFIG_ERROR Asynchronous job creation

Asynchronous jobs can also fail with INVALID_JOB, DOWNLOAD_FAILED, UPLOAD_FAILED, INTERNAL_ERROR, or FILE_TOO_LARGE. These codes describe the job failure and are returned in the failed job’s status response; the source does not assign them HTTP statuses for that status response.

Notes

  • Body-size, file-size, quota, rate, and download-retention limits depend on your plan. See Tool limits.
  • The file URL in a successful response is temporary. Its retention period depends on your plan.
  • For file mode, use the exact storage key associated with the file you uploaded.