Core / Conversion

Convert a file

Send a source file and a target format. We pick the right pipeline, run it, and return a converted file you can stream directly or fetch from a signed URL within 15 days.

stablesync · 1.2s p50requires API key

Single endpoint. Sync up to 100 MB and 60 s; over that, we return a job_id and you poll or accept a webhook. Same shape either way.

Endpoint #

POSThttps://api.regul.io/v1/convert

Authentication #

All requests use bearer tokens. Create keys in the API console — separate ones for production and staging, rotate any time.

Authorization: Bearer $REGUL_KEY

Parameters #

NameTypeDescription
filefile requiredMultipart upload, raw bytes, or a publicly-fetchable url string. Max 100 MB sync; up to 2 GB async.
tostring requiredTarget format. Examples: docx, pdf, png, webp, avif, parquet, md.
fromstring Source format hint. Auto-detected from the file by default — set this only if detection is ambiguous.
optionsobject Format-specific knobs. e.g. {"quality": 85, "preserve_metadata": false} for images; {"engine": "ocr"} for scanned PDFs.
webhookstring POST result URL when conversion completes. Required if the job runs async.
idempotency_keystring Replay-safe key — repeating the same request within 24h returns the original result.

Returns #

Returns a Conversion object. If the job runs sync, status is completed and output_url is ready immediately. Async jobs return queued — the URL fills in when the webhook fires (or you poll GET /v1/jobs/{id}).

Compute minutes are reserved up front. We estimate the cost, lock that amount on your balance, and settle against actual usage when the job completes. On error or cancel, the reserved minutes return to your balance — you only pay for what ran.

Errors #

Standard HTTP status codes. The body is always JSON with a code, message and an optional param.

StatusCodeMeaning
400invalid_formatThe to target isn't supported, or doesn't match the source.
401auth_requiredMissing or revoked key. Rotate via the console.
413file_too_largeOver 100 MB sync or 2 GB async. Use /v1/batch for chunked uploads.
422conversion_failedPipeline ran but couldn't produce output. Inspect diagnostics.
429rate_limitedFree plan: 10/hr. Paid: 100/s burst, 10k/min sustained.

Next #

Conversions running over 60s? See Async jobs and Webhooks. Batching dozens of files in one call? Skip ahead to Batch.