Quickstart
This walks through the whole loop once: create a key, extract a small document synchronously, then queue a larger one and read it back. Everything here runs on a free test key.
-
Sign up
Create an account at app.deskew.dev with email and password, or with GitHub or Google. Verify your email address from the message we send; the dashboard stays locked until you do (see Email verification). Signing up creates an organization with one project and a test key.
-
Create a test key
Open API keys in the dashboard. A test key named
first-test-keywas created at sign-up but its plaintext was shown only once; create a new one with Create key and mode Test. Test keys start withdeskew_test_sk_and come with the default scopesextract:write,jobs:readandwebhooks. Keep it in an environment variable:Terminal window export DESKEW_API_KEY="deskew_test_sk_..."The plaintext key is shown once. If you lose it, roll or revoke it and create a new one.
-
Make your first request
Send any PDF, Office file, image or email as multipart form data.
output=jsonreturns Markdown, text, blocks and tables together.Terminal window curl https://api.deskew.dev/v1/extract \-H "Authorization: Bearer $DESKEW_API_KEY" \-F "file=@invoice.pdf" \-F "output=json" \-F "tables=true"import os, requestsAPI = "https://api.deskew.dev"HEADERS = {"Authorization": f"Bearer {os.environ['DESKEW_API_KEY']}"}with open("invoice.pdf", "rb") as f:r = requests.post(f"{API}/v1/extract",headers=HEADERS,files={"file": f},data={"output": "json", "tables": "true"},)r.raise_for_status()result = r.json()import { readFile } from "node:fs/promises";const API = "https://api.deskew.dev";const headers = { Authorization: `Bearer ${process.env.DESKEW_API_KEY}` };const form = new FormData();form.append("file", new Blob([await readFile("invoice.pdf")]), "invoice.pdf");form.append("output", "json");form.append("tables", "true");const res = await fetch(`${API}/v1/extract`, { method: "POST", headers, body: form });if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);const result = await res.json();package mainimport ("bytes""fmt""io""mime/multipart""net/http""os")func main() {var body bytes.Bufferw := multipart.NewWriter(&body)part, _ := w.CreateFormFile("file", "invoice.pdf")f, _ := os.Open("invoice.pdf")defer f.Close()io.Copy(part, f)w.WriteField("output", "json")w.WriteField("tables", "true")w.Close()req, _ := http.NewRequest("POST", "https://api.deskew.dev/v1/extract", &body)req.Header.Set("Authorization", "Bearer "+os.Getenv("DESKEW_API_KEY"))req.Header.Set("Content-Type", w.FormDataContentType())res, err := http.DefaultClient.Do(req)if err != nil {panic(err)}defer res.Body.Close()out, _ := io.ReadAll(res.Body)fmt.Println(res.StatusCode, string(out))}You can also send a URL instead of a file, as JSON:
Terminal window curl https://api.deskew.dev/v1/extract \-H "Authorization: Bearer $DESKEW_API_KEY" \-H "Content-Type: application/json" \-d '{"url": "https://example.com/report.pdf", "output": "markdown"}' -
Read the result
A short document comes back as
200with the full result object. The fields you will use most:Field What it is markdownThe whole document as Markdown, pages separated by ---, tables as pipe tablestextPlain text, no formatting ( output=textoroutput=json)blocks[]Typed blocks ( heading,paragraph,table, …) with page number and confidence;bboxwhenbbox=truetables[]Every table as rows,csvandmarkdownpage_results[]Per page: kind,engine,confidence,quality_score,credits,low_confidenceusagePages and credits consumed, and which engines ran warnings[]Anything you should know, such as a retried page or a table joined across pages Check
page_results[].low_confidencebefore trusting a scanned page; Deskew flags doubtful pages rather than silently returning junk. -
Run a background job
Anything with more than 12 work units (a digital page counts 1, a scanned page 4) or over 20 MB is queued instead of processed inline. The response is
202with a job:{"id": "job_01JE4KB0X8Y2Z3A4B5C6D7E8F9","object": "job","status": "queued","mode": "async","pages": { "total": 48, "done": 0 },"poll_url": "https://api.deskew.dev/v1/jobs/job_01JE4KB0X8Y2Z3A4B5C6D7E8F9","created_at": "2026-12-02T09:14:07.512Z"}Force the queue with
mode=asyncon any request, and passwebhook_urlto be notified instead of polling. Poll untilstatusiscompleted, then fetch the result:Terminal window JOB=job_01JE4KB0X8Y2Z3A4B5C6D7E8F9curl -s https://api.deskew.dev/v1/jobs/$JOB -H "Authorization: Bearer $DESKEW_API_KEY"curl -s https://api.deskew.dev/v1/jobs/$JOB/result -H "Authorization: Bearer $DESKEW_API_KEY" -o result.jsonimport timejob = requests.post(f"{API}/v1/extract", headers=HEADERS,files={"file": open("annual-report.pdf", "rb")},data={"mode": "async"},).json()while True:job = requests.get(f"{API}/v1/jobs/{job['id']}", headers=HEADERS).json()if job["status"] in ("completed", "failed", "canceled"):breaktime.sleep(job.get("eta_seconds") or 2)if job["status"] == "completed":result = requests.get(f"{API}/v1/jobs/{job['id']}/result", headers=HEADERS).json()const sleep = (s) => new Promise((r) => setTimeout(r, s * 1000));let job = await (await fetch(`${API}/v1/extract`, { method: "POST", headers, body: form })).json();while (!["completed", "failed", "canceled"].includes(job.status)) {await sleep(job.eta_seconds ?? 2);job = await (await fetch(`${API}/v1/jobs/${job.id}`, { headers })).json();}if (job.status === "completed") {const result = await (await fetch(`${API}/v1/jobs/${job.id}/result`, { headers })).json();}Results are kept for 24 hours. See Background jobs for
eta_seconds, cancellation and retention. -
Verify it
Every request you have made so far is a job, including the synchronous ones. Confirm the first one exists and see what it cost:
Terminal window curl -s https://api.deskew.dev/v1/jobs?limit=5 \-H "Authorization: Bearer $DESKEW_API_KEY"Then look at one job by id and check
status,credits.usedandengines:Terminal window curl -s https://api.deskew.dev/v1/jobs/$JOB -H "Authorization: Bearer $DESKEW_API_KEY"The same jobs appear under Jobs in the dashboard, and the raw requests under Request logs.