Skip to content

Quickstart

This walks the full roundtrip with curl. You need an API key and a PDF. Export the key first:

Terminal window
export ACCESSFUL_API_KEY="ak_your_key_here"
export BASE="https://api.accessful.de/api/v1/upload-service"
  1. Upload the PDF. Send it as multipart form field files:

    Terminal window
    curl -X POST "$BASE/pdf/upload" \
    -H "X-API-Key: $ACCESSFUL_API_KEY" \
    -F "files=@document.pdf"

    The response lists one caseId per accepted file:

    {
    "successfulUploads": ["7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40"],
    "duplicateFiles": [],
    "message": "Upload completed successfully. Uploaded 1 files. 0 duplicates found.",
    "callbackUrl": null
    }
  2. Poll the job status with that caseId until it is completed:

    Terminal window
    curl "$BASE/job-status/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY"
    { "jobStatus": "completed", "stage": "finished", "score": 87 }

    score is the accessibility quality of the result (0–100). See all jobStatus values.

  3. Download the converted PDF/UA:

    Terminal window
    curl -L "$BASE/download/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY" \
    -o document-pdfua.pdf
  4. Delete the case when you no longer need it (optional, but recommended — this is a permanent purge):

    Terminal window
    curl -X DELETE "$BASE/delete/7c2f1e4a-9b0d-4a1e-8f3c-2d6b5a9e1c40" \
    -H "X-API-Key: $ACCESSFUL_API_KEY"
const BASE = 'https://api.accessful.de/api/v1/upload-service';
const headers = { 'X-API-Key': process.env.ACCESSFUL_API_KEY };
// 1. Upload
const form = new FormData();
form.append('files', new Blob([await readFile('document.pdf')], { type: 'application/pdf' }), 'document.pdf');
const up = await fetch(`${BASE}/pdf/upload`, { method: 'POST', headers, body: form });
const { successfulUploads: [caseId] } = await up.json();
// 2. Poll until terminal
const terminal = new Set(['completed', 'failed', 'analyzer_failed', 'canceled', 'quota_exceeded']);
let status;
do {
await new Promise((r) => setTimeout(r, 2000));
status = await (await fetch(`${BASE}/job-status/${caseId}`, { headers })).json();
} while (!terminal.has(status.jobStatus));
if (status.jobStatus !== 'completed') throw new Error(`Job ${status.jobStatus}`);
// 3. Download
const pdf = await (await fetch(`${BASE}/download/${caseId}`, { headers })).arrayBuffer();
await writeFile('document-pdfua.pdf', Buffer.from(pdf));
console.log(`Done — score ${status.score}`);

Prefer to click instead of type? Run the same flow in the browser on the Try it out page.