Onboarding

Getting Started

The public DocuShell API is a queued job system: submit work, keep the returned job_id, poll status, then stream the finished file or artifact.

Overview
View as Markdown

Base URL

https://api.docushell.com/api

Append /v1/... paths to call public API routes.

Auth

Bearer API key

Send Authorization: Bearer YOUR_API_KEY on submit, status, and download routes.

Job flow

submit, poll, download

Most routes return 202 with a job_id; completed files are streamed through the gateway.

Section

Quickstart Checklist

Start with Markdown to PDF: a small JSON request that still exercises the full queued job lifecycle.

  • Create an API key in the dashboard Developer tab. The raw key is shown once.
  • Send bearer auth with Authorization: Bearer YOUR_API_KEY on every public API route.
  • Add Idempotency-Key on submit requests when callers may retry after a timeout.
  • Store job_id and request_id from the queued response. Use request_id when debugging with support.
  • Poll before download. The download link is valid after the job reaches done.
Keep API keys in server-side code, workers, CI, or trusted automation. Do not ship them in browser bundles.

Section

First Request

Submit a tiny Markdown document and save the returned job_id.

First request

bash

curl -X POST "https://api.docushell.com/api/v1/markdown-to-pdf" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quickstart-001" \
  -d '{
    "markdown": "# DocuShell\n\nRendered through the public API.",
    "file_name": "quickstart.md",
    "page_size": "A4"
  }'

Section

Queued Job Lifecycle

A successful submit returns 202 immediately. The worker finishes the file asynchronously.

Queued response

json

{
  "job_id": "job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT",
  "status": "queued",
  "cost": 5,
  "service": "markdown-to-pdf",
  "request_id": "req_01JX8Y62XCDNZ2BM7TBM2M9Q8E",
  "links": {
    "status": "/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT",
    "download": "/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT/download"
  }
}
Do not assume the file is ready when this response arrives. Poll the status link first.

Poll status

bash

curl "https://api.docushell.com/api/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT" \
  -H "Authorization: Bearer YOUR_API_KEY"

Done response

json

{
  "job_id": "job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT",
  "status": "done",
  "service": "markdown-to-pdf",
  "request_id": "req_01JX8Y62XCDNZ2BM7TBM2M9Q8E",
  "result": {
    "filename": "quickstart.pdf",
    "sizeBytes": 184322,
    "download": "/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT/download"
  },
  "links": {
    "status": "/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT",
    "download": "/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT/download"
  }
}

Download result

bash

curl "https://api.docushell.com/api/v1/jobs/job_01JX8Y5YJ2M2D8N1AQ5F7Q3KVT/download" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output quickstart.pdf
Fetch the artifact only after the job is terminal. Downloads are one-time streams.

Section

Request Basics

These fields apply across the public API unless an endpoint page says otherwise.

ItemRequiredNotes
AuthorizationYesBearer API key. Send on submit, status, and download requests.
Idempotency-KeyRecommendedUse a fresh value for each logical submit. Reuse it only for the exact same retry.
Content-TypeDependsapplication/json for JSON routes; multipart/form-data for file uploads.
job_idResponseStore it after submit and poll GET /v1/jobs/:jobId.
request_idResponseTrace id returned in JSON and x-request-id; include it in support reports.
Field casingResponsePublic API JSON deliberately uses snake_case for stable wire compatibility. SDKs may map fields to language-native casing.

Section

Next Steps

Move from the generic job flow to the endpoint you plan to ship.