Document Conversion
Turn PDFs, Word docs, and emails into clean text —ready for extraction or any downstream processing.
How It Works
Send a document via URL, base64, or file upload and get back its content as Markdown, plain text, JSON, or HTML. Backbone handles format detection, parsing, and text extraction automatically. All you need is an API key.
14 input formats supported
PDF, DOCX, XLSX, PPTX, CSV, TXT, HTML, Markdown, AsciiDoc, MSG (Outlook), EML, Images, DXF (AutoCAD), and GEO (TRUMPF). Output as Markdown, Plain Text, JSON, or HTML.
Pipelines
Backbone offers three processing pipelines. Choose the one that fits your document type:
| Pipeline | Description | Best for |
|---|---|---|
fast (default) | Fast text extraction | Text-heavy PDFs, DOCX, emails, spreadsheets |
ocr | OCR-based extraction with layout analysis | Scanned documents, image-heavy PDFs |
vlm | Vision Language Model processing | Complex layouts, mixed text+images, plain images |
The fast pipeline is the default and works for most documents. Use ocr or vlm when you need to process scanned or image-heavy content. Not every format supports every pipeline — see the supported formats table for the full matrix.
Convert from URL
POST /api/v1/convert/source
The primary endpoint. Pass one or more document URLs and get back converted text.
Request
curl -X POST https://backbone.manfred-kunze.dev/api/v1/convert/source \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_api_key" \
-d '{
"sources": [
{
"kind": "http",
"url": "https://example.com/document.pdf"
}
]
}'
Response
{
"documents": [
{
"filename": "document.pdf",
"mdContent": "# Document Title\n\nExtracted content..."
}
],
"status": "SUCCESS",
"errors": [],
"processingTime": 1.234
}
Source Types
Each source in the sources array needs a kind field:
HTTP source —fetch a document from a URL:
{
"kind": "http",
"url": "https://example.com/document.pdf",
"headers": {
"Authorization": "Bearer external-token"
}
}
The optional headers field lets you pass authentication or custom headers to the source server.
Base64 source —send the document content directly:
{
"kind": "base64",
"content": "JVBERi0xLjQK...",
"filename": "document.pdf",
"mimeType": "application/pdf"
}
Batch Conversion
Convert multiple documents in a single request:
{
"sources": [
{ "kind": "http", "url": "https://example.com/report.pdf" },
{ "kind": "http", "url": "https://example.com/notes.docx" }
],
"options": {
"abortOnError": false
}
}
When abortOnError is false (the default), the API processes all documents even if some fail. Failed documents appear in the errors array, and the status will be PARTIAL_SUCCESS (HTTP 207).
Convert Uploaded Files
POST /api/v1/convert/file
Upload files directly using multipart/form-data:
Request
curl -X POST https://backbone.manfred-kunze.dev/api/v1/convert/file \
-H "Authorization: Bearer sk_your_api_key" \
-F "[email protected]" \
-F "[email protected]"
File Upload Parameters
| Field | Type | Required | Description |
|---|---|---|---|
files | file(s) | Yes | One or more files to convert |
pipeline | string | No | Processing pipeline: fast (default), ocr, or vlm |
options | JSON part | No | Pipeline options for ocr/vlm (see below) |
OCR and VLM Pipelines
For scanned documents, image-heavy PDFs, or complex layouts where the default fast pipeline falls short, use the ocr or vlm pipeline.
Pipeline examples
curl -X POST https://backbone.manfred-kunze.dev/api/v1/convert/source \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_your_api_key" \
-d '{
"sources": [
{
"kind": "http",
"url": "https://example.com/scanned-document.pdf"
}
],
"options": {
"pipeline": "ocr",
"options": {
"ocrLanguages": ["en", "de"],
"tableStructure": true
}
}
}'
When to Use Each Pipeline
| Scenario | Pipeline | Why |
|---|---|---|
| Text-based PDFs, Word docs, spreadsheets | fast | Fast, reliable text extraction |
| Scanned documents, image-heavy PDFs | ocr | Layout analysis with OCR for accurate text recovery |
| Complex layouts (multi-column, forms, mixed tables) | vlm | Understands spatial layout visually |
| Plain images with text (PNG, JPG) | vlm | Reads the image as a vision model would |
Pipeline speed vs accuracy
The fast pipeline is the fastest and best for most text-heavy documents. The ocr and vlm pipelines are slower but produce better results for documents where layout matters or text is embedded in images.
Conversion Options
When using the /source endpoint, you can pass an options object:
Top-level options:
| Field | Type | Default | Description |
|---|---|---|---|
pipeline | string | "fast" | Processing pipeline: fast, ocr, or vlm |
timeout | number | 120 | Timeout per document in seconds |
abortOnError | boolean | false | Stop batch on first error |
extractMetadata | boolean | true | Include document metadata in response |
Async Conversion
For large documents or batch jobs, use the async endpoints to avoid timeouts.
Start an Async Job
POST /api/v1/convert/source/async
Same request body as the sync endpoint. Returns 202 Accepted immediately with a task ID:
{
"taskId": "task-uuid",
"taskType": "CONVERSION",
"taskStatus": "PENDING",
"taskPosition": 1
}
Poll Task Status
GET /api/v1/convert/tasks/{taskId}
Check whether the task is still running:
curl https://backbone.manfred-kunze.dev/api/v1/convert/tasks/{taskId} \
-H "Authorization: Bearer sk_your_api_key"
Add ?wait=30 for long polling.
Get the Result
GET /api/v1/convert/tasks/{taskId}/result
Once taskStatus is COMPLETED, fetch the full result:
curl https://backbone.manfred-kunze.dev/api/v1/convert/tasks/{taskId}/result \
-H "Authorization: Bearer sk_your_api_key"
File uploads can be async too
Use /api/v1/convert/file/async with the same multipart format. You'll get back a task ID to poll.
Supported Formats
Input
| Format | MIME Type | fast | ocr | vlm |
|---|---|---|---|---|
application/pdf | yes | yes | yes | |
| DOCX | application/vnd.openxmlformats-officedocument.wordprocessingml.document | yes | yes | yes |
| XLSX | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | yes | yes | yes |
| PPTX | application/vnd.openxmlformats-officedocument.presentationml.presentation | yes | yes | yes |
| HTML | text/html | yes | yes | yes |
| Markdown | text/markdown | yes | yes | yes |
| CSV | text/csv | yes | yes | yes |
| TXT | text/plain | yes | — | — |
| MSG (Outlook) | application/vnd.ms-outlook | yes | — | — |
| EML | message/rfc822 | yes | — | — |
| Images | image/* | — | yes | yes |
| AsciiDoc | text/asciidoc | — | yes | yes |
| DXF (AutoCAD) | image/vnd.dxf | yes | — | — |
| GEO (TRUMPF) | application/vnd.trumpf.geo | yes | — | — |
Output
| Format | Key in Response | Description |
|---|---|---|
MD | mdContent | Markdown with headings and structure preserved |
TEXT | textContent | Plain text, no formatting |
JSON | jsonContent | Structured JSON representation |
HTML | htmlContent | HTML markup |
Status Codes
| Status | HTTP Code | Meaning |
|---|---|---|
SUCCESS | 200 | All documents converted |
PARTIAL_SUCCESS | 207 | Some documents failed |
FAILURE | 422 | All documents failed |
PENDING | 202 | Async task queued |
PROCESSING | 202 | Async task in progress |