REST API
Summary
Documentize processing is asynchronous: you submit a task, poll its status, then download the result. The web apps use exactly this REST interface (under /webapi/), and the self-host serves the same one. Important caveat: the repository has no separate public API reference or sample requests file, so treat endpoint details below as what the service does today, not a published, versioned contract (verify before building a product on it).
How an asynchronous task works
- Create. POST a multipart form with your file(s) to an operation route, for example
POST /webapi/compress(parameters such ascompressTypein the query string) orPOST /webapi/merge(filesplus options likeinputType,outputType). The response is a status object that carries the task id and a file/folder name. - Queue. The request is put on a queue and picked up by a worker for that app; you are not held on the connection.
- Poll.
POST /webapi/process_status/{id}returns the current state. Status codes in the response:203still processing (keep polling; progress fields and a step message may be present),200finished with download links,204waiting or stalled (a stall flag marks work that stopped progressing),500failed. - Download. A finished response lists the result files; file links look like
/webapi/file_url/{dir}/{file}. Results are kept temporarily, not forever. - Clean up.
POST /webapi/ImmediatelyRemove/{id}deletes a task's files at once. Signed-in users can listGET /webapi/my-files.
Other app routes follow the same shape: rotate, removepages, splitdoc, convert, searchable, ocr, extract-text, extract-image, extract-metadata, resize, booklet, flatten, deskew, abstracts-generator, chat, and more.
Continuations
On the free plan a long job may stop at a time limit with only part of its input done. The result then carries a continuation id (32 hex characters):
GET /webapi/continuations/{id}shows the files still left.POST /webapi/continuations/{id}/continuestarts a new task for them. It is free (no operation charged), may be offered only after a cooldown (HTTP 429 withavailableFromUtc), and a second call returns the same task.DELETE /webapi/continuations/{id}discards it. The id expires; a missing or finished one gives 404.
Authentication and limits
- Anonymous requests run under a small daily allowance; signed-in and subscribed accounts get more (see channels).
- Account access uses a bearer token. Long-lived keys are the
dmk_keys issued on the MCP page, which work asAuthorization: Bearer dmk_...; desktop clients accept a token copied from the web app. Whetherdmk_keys are accepted on every REST route is not documented here (verify). - A free-plan run may be capped (for example by file size or a PDF page limit), and a paid subscription lifts that.
A minimal sketch
curl -F "files=@big.pdf" "https://<host>/webapi/compress?compressType=1"
# -> JSON with the task id
curl -X POST "https://<host>/webapi/process_status/<id>"
# repeat until statusCode is 200, then fetch the listed file URLs
<host> is the service the web app talks to, or your own self-host (http://localhost/webapi/). The exact JSON field names (verify against a live response) are not fixed in this book.