LayerBack logoLayerBack Docs
LayerBack logoLayerBack Docs
Homepage

Getting started

Getting Started

API

Conversion API

Conversion API

Integrate LayerBack to convert diagram images into editable VSDX, PPTX, draw.io, and SVG files through the API.

Authentication

Create a key under Settings → API Keys, then send it with every request:

x-api-key: <your key>

Conversions are billed to the key owner's credit balance (10 credits per conversion, all formats included). Failed conversions are refunded automatically.

Create a conversion

Send raw image bytes (PNG, JPEG, or WebP):

curl -X POST https://layerback.com/api/v1/convert \
  -H "x-api-key: $LAYERBACK_KEY" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @diagram.png
{ "job_id": "5c048e6f-ec4d-43ad-9eee-0697414d5cef" }

Returns 402 when the balance is empty, 413 over 20 MB, 415 for unsupported bytes, and 429 when the hourly rate limit is hit.

Poll job status

curl https://layerback.com/api/v1/jobs/$JOB_ID \
  -H "x-api-key: $LAYERBACK_KEY"
{
  "job_id": "5c048e6f-…",
  "status": "succeeded",
  "total_seconds": 46.9,
  "formats": ["vsdx", "pptx", "drawio", "svg", "ir", "preview"]
}

status moves through queued → running → succeeded or failed. Poll every few seconds; conversions typically finish in 30–60 seconds.

Download artifacts

curl -L "https://layerback.com/api/v1/jobs/$JOB_ID/download?format=vsdx" \
  -H "x-api-key: $LAYERBACK_KEY" -o diagram.vsdx

format accepts vsdx, pptx, drawio, svg, ir (the structured diagram JSON), or preview (PNG). Downloads are free and repeatable.

The endpoint may respond with a 302 redirect to a short-lived download URL, so keep the -L flag (or follow redirects in your HTTP client).

Completion webhook

Skip polling: pass callback_url when starting a conversion and we POST the result to it when the job finishes (success or failure).

curl -X POST "https://layerback.com/api/v1/convert?callback_url=https://your.app/hooks/layerback" \
  -H "x-api-key: $LAYERBACK_KEY" \
  --data-binary @diagram.png

The webhook body:

{
  "job_id": "…",
  "status": "succeeded",
  "total_seconds": 31.2,
  "error": null,
  "formats": ["vsdx", "pptx", "drawio", "svg", "ir", "preview"]
}

callback_url must be a public https URL. Delivery is attempted twice; verify important results by calling the job endpoint. Polling keeps working whether or not you use webhooks.

OpenAPI

The full machine-readable spec lives at layerback.com/openapi.yaml — import it into Postman, or generate a typed client for your language.

Limits

  • Images up to 20 MB, formats PNG / JPEG / WebP
  • Rate limit: 20 conversions per hour per account — building something bigger (batch migration, automation pipelines)? Email davie@daviechen.com for higher limits and volume pricing
  • Artifacts are retained for at least 72 hours — download promptly or re-convert when needed

Table of Contents

Authentication
Create a conversion
Poll job status
Download artifacts
Completion webhook
OpenAPI
Limits