‹div›RIOTS API
API
‹div›RIOTS API

/convert

POST
https://api.divriots.com/v1
/convert
Bearer
or
x-drc-api-key (header)

Converts input file into structured design data.

See Overview for what each input and output format means and which combinations are supported, and Pricing for what they cost.

Asynchronous conversions. Conversions run as background jobs, so POST /convert returns 202 Accepted with a Location header pointing at a poll endpoint (GET /convert/jobs/{jobId}). Poll that endpoint until its JSON status is done (with a short-lived resultUrl to download the result; the poll's resultUrl lists what each output format returns) or error. Because the conversion has not started when the 202 is returned, an input the server can't read (a corrupt .fig, unreadable HTML) surfaces as a job error on the poll rather than a 400 on the submit.

Note:

  • When input property is used, input.data (base64 bytes) or input.url must be set.
  • In multipart mode the uploaded file field replaces both, so input itself is omitted.
  • Requests are capped at 30 MB total (and base64 inflates data by ~33%). For larger files use POST /convert/upload to upload out of band, then convert by input.url = "upload://{id}".

/convert › Headers

Authorization
​string · required

API key as Bearer {APIKEY}. Create one in API Keys. Alternatively send the key in the x-drc-api-key header instead — see the security schemes below.

/convert › Request Body

​object
​object

/convert › Responses

Conversion result. Every input format documented here is asynchronous, so this is not the response to POST /convert itself — it is the body you GET from the resultUrl a done poll hands you. The shape depends on output.format.

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object
type = object
Properties for figma-rest (application/json):
Returned when `output.format = figma-rest`. Structurally compatible with the official Figma REST API.
model
​object

File representation, structurally compatible with the response of the official Figma REST API (GET /v1/files/:fileKey). Includes name, document, components, componentSets, styles, schemaVersion, version, lastModified, linkAccess, role, editorType.

​object[]

Bitmap fills referenced in the file. Empty when the source has no bitmaps. If a url ever returns 403, re-convert to refresh the signed URL.

​object

Optional. Mirrors meta.variables from Figma's GET /v1/files/:fileKey/variables/local response, flattened to the response root. Omitted when the file has no variables.

​object

Optional. Mirrors meta.variableCollections from Figma's variables endpoint. Omitted when the file has no collections.


/convert/upload

POST
https://api.divriots.com/v1
/convert/upload
Bearer
or
x-drc-api-key (header)

Upload a large source file out of band, for files over the 30 MB POST /convert request cap (up to 10 GB). Free — billing happens on the /convert call that consumes the upload.

Flow:

  1. POST /convert/upload with the exact byte size → { uploadUrl, ref }.
  2. PUT the raw bytes to uploadUrl with Content-Type: application/octet-stream and a Content-Length matching size exactly (the signed URL is pinned to both, and expires after 10 minutes).
  3. POST /convert with input.url set to the returned ref (upload://{id}), plus format/name/range… as usual.

Uploads are private to the API key that created them — a ref used by anyone else 404s on /convert.

/convert/upload › Headers

Authorization
​string · required

API key as Bearer {APIKEY}. Create one in API Keys. Alternatively send the key in the x-drc-api-key header instead — see the security schemes below.

/convert/upload › Request Body

size
​integer · required

Exact size of the file in bytes (max 10737418240).

/convert/upload › Responses

Signed upload target.

uploadUrl
​string · uri

Signed URL to PUT the bytes to. Valid for 10 minutes.

ref
​string

Opaque upload://{id} reference to pass as input.url on POST /convert.


/convert/jobs/{jobId}

GET
https://api.divriots.com/v1
/convert/jobs/{jobId}
Bearer
or
x-drc-api-key (header)

Poll an asynchronous /convert job — the URL from the Location header of the 202 on POST /convert. Always 200 with a status envelope; poll until status is done or error (job failure is not an HTTP error). Authenticate with the same API key (or Authorization: Bearer) that started the job. The job is pollable for 7 days.

/convert/jobs/{jobId} › path Parameters

jobId
​string · required

The opaque job id from the 202 Location header.

/convert/jobs/{jobId} › Headers

Authorization
​string · required

API key as Bearer {APIKEY}. Create one in API Keys. Alternatively send the key in the x-drc-api-key header instead — see the security schemes below.

/convert/jobs/{jobId} › Responses

Current job status.

status
​string · enum · required
  • queued / running: still processing — poll again.
  • done: finished — resultUrl is present.
  • error: failed — error describes why.
Enum values:
queued
running
done
error
resultUrl
​string · uri

Present only when status = done. Short-lived signed URL (~15 min) to GET the result — JSON for figma-rest and figma-clipboard, a PDF for pdf, a PowerPoint file for pptx, PNG bytes for image, a ZIP of layered PSDs (one per frame, even when there is one) for psd, and a ZIP for html-tailwindcss and html-inlinestyles (and for any image input); re-poll for a fresh one if it expires (jobs are pollable for 7 days).

error
​string

Present only when status = error.

rejected
​boolean

true when the input itself was refused (an unreadable or unsupported file, a wrong password, a range that matches no page): error is then written to be shown to your user. Absent when the conversion failed on our side; error is then not meant for your user (usually Conversion failed or Conversion timed out).

progress
​integer · min: 0 · max: 100

Worker-reported progress. Present only while status is queued or running, and may be absent even then.

step
​string

Short human-readable step label, e.g. Converting page 12/40. Present only while status is queued or running, and may be absent even then.