PDF2MD Jobs API

Creating, retrieving, and deleting conversion jobs

GitHub OpenAPI

Operations 5

POST /jobs Create a conversion job #
GET /jobs Get the device's most recent jobs #
GET /jobs/{jobId} Get a job by id (EP-031-T6) #
DELETE /jobs/{jobId} Delete or cancel a job #
GET /jobs/{jobId}/download Download the ready Markdown #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pdf2md-dev:pdf2md-dev-jobs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pdf2md-dev-jobs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PDF to Markdown API Facade Jobs API
  version: 2.1.1
  description: 'API facade for the PDF → Markdown Chrome extension. Core logic for the queue and result delivery,

    device identification via a WebCrypto keypair + device_token, signed requests (see docs/security.md).


    v2.0.0 (EP-023): additively introduced `/api/v2/*` endpoints for accounts, API keys, hosted MCP, and

    paid tiers. Authentication for `/api/v2/*` — `Authorization: Bearer p2m_...` (API key, over TLS, without

    an ES256 signature) OR an OAuth session (extension/web). See docs/v2.0.0-roadmap.md §6-7, docs/security.md.


    BACKWARD COMPATIBILITY (hard invariant): all v1 paths (`/register`, `/jobs`, `/jobs/{id}`,

    `/jobs/{id}/download`, `/settings`) and their schemas do NOT change — the old and new extensions work

    simultaneously against backend 2.0.0 without errors (docs/v2.0.0-roadmap.md §6.9).'
servers:
- url: https://pdf2md.dev
  description: 'Production — PRIMARY origin (EP-024, promoted). v1 at root (/register, /jobs, …); v2 under /api/v2/*. The API is served identically on both production domains; OAuth redirect_uri and billing return URLs follow the request origin (allow-list PUBLIC_ORIGINS), so the OAuth callback host matches whichever domain you start on.

    '
- url: https://pdf2md.huskyhaul.online
  description: Production — alternative origin (kept for the v1 extension). Same API surface.
- url: http://localhost:8080
  description: Local docker nginx (same routing — v1 root + /api/v2/*)
security:
- DeviceToken: []
tags:
- name: Jobs
  description: Creating, retrieving, and deleting conversion jobs
paths:
  /jobs:
    post:
      tags:
      - Jobs
      summary: Create a conversion job
      description: 'Accepts a PDF file (multipart) or a link to a PDF (JSON). Maximum file size — 10 MB.

        Priority is assigned by the number of device runs per day for the selected converter (minimum 4).

        Processing lasts up to 5 minutes; if exceeded, the job fails with an error. The result is stored for 1 hour after it is ready.'
      parameters:
      - $ref: '#/components/parameters/IdempotencyKey'
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/Nonce'
      - $ref: '#/components/parameters/BodySHA256'
      - $ref: '#/components/parameters/Signature'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateJobFromFileRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJobFromUrlRequest'
      responses:
        '201':
          description: Job queued
          headers:
            Location:
              description: Absolute link to the job list (`/jobs`)
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResource'
        '400':
          description: Invalid data (no file/URL, not a PDF, broken link)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or expired device_token / request signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Device blocked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Replay detected (nonce already used)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: File exceeds the 10 MB limit
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Device or IP limits exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: postJobs
      x-operation-id-source: derived
    get:
      tags:
      - Jobs
      summary: Get the device's most recent jobs
      description: 'Returns up to 3 device jobs, sorted for display in the popup.

        For the `ready` status, the client computes the auto-deletion time as `status_since + 1h`.'
      parameters:
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/Nonce'
      - $ref: '#/components/parameters/BodySHA256'
      - $ref: '#/components/parameters/Signature'
      responses:
        '200':
          description: Job list
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    maxItems: 3
                    items:
                      $ref: '#/components/schemas/JobResource'
                required:
                - items
        '401':
          description: Invalid or expired device_token / request signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Device blocked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Replay detected (nonce already used)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Device or IP limits exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getJobs
      x-operation-id-source: derived
  /jobs/{jobId}:
    get:
      tags:
      - Jobs
      summary: Get a job by id (EP-031-T6)
      description: 'Per-job status lookup by id, device-signed (same ownership check as the v1

        list). Used to re-query a job that has aged out of the recent list.'
      parameters:
      - $ref: '#/components/parameters/JobId'
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/Nonce'
      - $ref: '#/components/parameters/BodySHA256'
      - $ref: '#/components/parameters/Signature'
      responses:
        '200':
          description: The job resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResource'
        '401':
          description: Invalid or expired device_token / request signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getJobsByJobId
      x-operation-id-source: derived
    delete:
      tags:
      - Jobs
      summary: Delete or cancel a job
      description: 'If the job is in the `queued` or `processing` status, marks it as canceled and deletes the input file.

        If `ready` or `error`, deletes the Markdown and the record. The operation is idempotent.'
      parameters:
      - $ref: '#/components/parameters/JobId'
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/Nonce'
      - $ref: '#/components/parameters/BodySHA256'
      - $ref: '#/components/parameters/Signature'
      responses:
        '200':
          description: Job deleted or canceled
          content:
            application/json:
              schema:
                type: object
                properties:
                  job_id:
                    type: string
                    format: uuid
                  status:
                    $ref: '#/components/schemas/JobStatus'
                  message:
                    type: string
                required:
                - job_id
                - status
        '401':
          description: Invalid or expired device_token / request signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Device blocked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Replay detected (nonce already used)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Device or IP limits exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: deleteJobsByJobId
      x-operation-id-source: derived
  /jobs/{jobId}/download:
    get:
      tags:
      - Jobs
      summary: Download the ready Markdown
      description: 'Streaming delivery of Markdown for jobs in the `ready` status. Returns 409 if the job is not yet ready,

        and 410 if the file was deleted by its TTL or manually.'
      parameters:
      - $ref: '#/components/parameters/JobId'
      - $ref: '#/components/parameters/Timestamp'
      - $ref: '#/components/parameters/Nonce'
      - $ref: '#/components/parameters/BodySHA256'
      - $ref: '#/components/parameters/Signature'
      responses:
        '200':
          description: Ready Markdown
          headers:
            Content-Disposition:
              description: Suggested file name
              schema:
                type: string
          content:
            text/markdown:
              schema:
                type: string
                description: Markdown content
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          description: Invalid or expired device_token / request signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Device blocked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Job not found or not accessible to the device
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Job not yet ready
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '410':
          description: File deleted by its TTL or manually
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Device or IP limits exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      operationId: getJobsByJobIdDownload
      x-operation-id-source: derived
components:
  parameters:
    Timestamp:
      name: X-Timestamp
      in: header
      required: true
      description: Unix time (sec) for the request signature (±300s window, see docs/security.md)
      schema:
        type: integer
        format: int64
        example: 1700000000
    JobId:
      name: jobId
      in: path
      required: true
      description: Job identifier (UUID)
      schema:
        type: string
        format: uuid
    BodySHA256:
      name: X-Body-SHA256
      in: header
      required: true
      description: hex sha256 of the request body (for GET/DELETE — sha256 of an empty body)
      schema:
        type: string
        pattern: ^[A-Fa-f0-9]{64}$
        example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
    Signature:
      name: X-Signature
      in: header
      required: true
      description: Signature of the canonical string (ES256), see docs/security.md
      schema:
        type: string
        maxLength: 512
        example: MEYCIQCZqlk3E1p5k2y1hZ0ykjW9tzjO4GDBWJ3QYw9UWF2gtwIhAKuQKk8NfZp7uA9u6YzKxHnD7bHkHHRp2tkMZ0QYpQMb
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: Idempotency key for safe retries of job-creation requests (ttl 24h)
      schema:
        type: string
        maxLength: 128
        example: req-123e4567
    Nonce:
      name: X-Nonce
      in: header
      required: true
      description: Random string (base64url), unique per request (TTL 5 minutes, anti-replay)
      schema:
        type: string
        maxLength: 128
        example: bXlfbm9uY2UtdjE
  schemas:
    OCRLang:
      type: string
      description: 'OCR language hint (EP-070, additive). Selects the OCR recognition model for

        scanned pages / forced OCR in BOTH engines (MinerU maps ja→japan, ko→korean and

        es/pt/de/fr→latin; docling builds a per-request EasyOCR list <lang>+en).

        Only affects OCR: PDFs with a digital text layer are extracted, not

        recognized, and ignore this hint. Absent → the engine''s env default

        (current ru+en behavior). The stable code ru selects the Cyrillic OCR model.

        Unknown values are rejected with 400.

        '
      enum:
      - ru
      - en
      - ja
      - ko
      - es
      - pt
      - de
      - fr
    CreateJobFromUrlRequest:
      type: object
      required:
      - url
      - converter_code
      properties:
        url:
          type: string
          format: uri
          description: Direct link to a PDF
          example: https://example.com/files/report.pdf
        file_name:
          type: string
          maxLength: 255
          description: File name for display (optional)
          example: report.pdf
        converter_code:
          type: string
          description: 'Converter code (MVP: pdf_to_md)'
          example: pdf_to_md
        ocr_lang:
          $ref: '#/components/schemas/OCRLang'
    JobStatus:
      type: string
      description: Job status
      enum:
      - queued
      - processing
      - ready
      - error
      - canceled
      - deleted
    ErrorResponse:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: Short error code
          enum:
          - validation_error
          - token_invalid_or_expired
          - signature_invalid
          - replay_detected
          - rate_limited
          - device_blocked
          - not_ready
          - gone
          example: signature_invalid
        message:
          type: string
          example: Invalid request signature
    JobResource:
      type: object
      required:
      - job_id
      - converter_code
      - status
      - status_since
      - priority
      - priority_assigned_at
      - file_name
      properties:
        job_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/JobStatus'
        converter_code:
          type: string
          example: pdf_to_md
        status_since:
          type: string
          format: date-time
          description: Time of entry into the current status (UTC)
        priority:
          type: integer
          format: int32
          description: 'A lower number — higher priority. v2 (EP-023, §7.7): a band scale, `min` is no longer 4 — the client treats the value as opaque (timers are computed from `status_since`/`ready_at`, not from priority).

            '
        priority_assigned_at:
          type: string
          format: date-time
          description: When priority was assigned/lowered
        error_message:
          type: string
          nullable: true
        error_code:
          type: string
          nullable: true
          description: 'Stable machine error code for a failed job (EP-031). Additive — absent on

            success and on older records. Clients localize by this code; the human

            error_message is a fallback.

            '
        file_name:
          type: string
          maxLength: 255
        output_size:
          type: integer
          format: int64
          nullable: true
          description: Markdown size (bytes), only for `ready`
        download_url:
          type: string
          format: uri
          nullable: true
          description: Populated for `ready`
        pages:
          type: integer
          nullable: true
          description: 'Number of pages in the source PDF (EP-018). An additive field — absent on the old backend/old jobs; clients should ignore it if missing.

            '
        truncated:
          type: boolean
          default: false
          description: '`true` — the result is partial: conversion reached the soft time budget and a disclaimer was appended to the end of the Markdown (EP-018). Additive, backward-compatible: absence/`false` = full result.

            '
    CreateJobFromFileRequest:
      type: object
      required:
      - file
      - converter_code
      properties:
        file:
          type: string
          format: binary
          description: PDF file, maximum 10 MB
        file_name:
          type: string
          maxLength: 255
          description: File name for display (optional)
          example: paper.pdf
        converter_code:
          type: string
          description: 'Converter code (MVP: pdf_to_md)'
          example: pdf_to_md
        ocr_lang:
          $ref: '#/components/schemas/OCRLang'
  securitySchemes:
    AdminSecret:
      type: http
      scheme: bearer
      description: 'v2 (EP-023-T9): support read-view secret (ADMIN_SECRET). Server-only; empty → /api/v2/admin/* 404.'
    DeviceToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'device_token, issued at `/register`. All protected requests are also signed (timestamp, nonce, body hash, signature) —

        see docs/security.md (canonical string `METHOD\nPATH\nTIMESTAMP\nNONCE\nBODY_SHA256`, ±300s window, nonce TTL 5 min).

        '
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: opaque
      description: 'v2 (EP-023): API key `Authorization: Bearer p2m_...` over TLS. WITHOUT an ES256 body signature and anti-replay

        (unlike DeviceToken) — this is a deliberate perimeter shift (docs/security.md §0-2). Scopes/limits/ownership

        are checked by the server; the tier is not stored on the key (entitlements are resolved live).

        '
    Session:
      type: apiKey
      in: cookie
      name: p2m_session
      description: 'v2 (EP-023): the extension/web OAuth session (Google login). Used by the UI for /api/v2/me, /api/v2/limits, /api/v2/api-keys.'
    UploadTicket:
      type: apiKey
      in: header
      name: Upload-Ticket
      description: 'v2 (EP-048): a one-time, short-TTL ticket from POST /api/v2/jobs/upload-ticket, bound

        server-side to {device, account, tier, byte cap}. Authenticates the streamed

        POST /api/v2/jobs/upload WITHOUT a per-body ES256 signature (so the body can stream).

        Single-use (consumed on arrival) and short-lived, which bounds theft/replay.

        '