PDF2MD v2 Webhooks API

v2 (EP-023): registered webhooks (§6.8)

GitHub OpenAPI

Operations 4

GET /api/v2/webhooks List registered webhook endpoints #
POST /api/v2/webhooks Register a webhook (signing secret is shown once) #
GET /api/v2/webhooks/deliveries Delivery history (debugging/support) #
DELETE /api/v2/webhooks/{webhookId} Delete a webhook #

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-v2-webhooks-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-v2-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PDF to Markdown API Facade v2 Webhooks 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: v2 Webhooks
  description: 'v2 (EP-023): registered webhooks (§6.8)'
paths:
  /api/v2/webhooks:
    get:
      tags:
      - v2 Webhooks
      summary: List registered webhook endpoints
      description: EP-023-T10 (implemented, §6.8). Account-scoped (web session OR device-signed-linked, like api-keys). Paid feature (webhooks_enabled).
      security:
      - Session: []
      - DeviceToken: []
      responses:
        '200':
          description: List
          content:
            application/json:
              schema:
                type: object
                required:
                - items
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/V2Webhook'
                  limit:
                    type: integer
                    description: Plan's webhooks_limit
                  used:
                    type: integer
                  enabled:
                    type: boolean
                    description: Whether webhooks are available on the plan
        '401':
          $ref: '#/components/responses/V2Unauthorized'
      operationId: getApiV2Webhooks
      x-operation-id-source: derived
    post:
      tags:
      - v2 Webhooks
      summary: Register a webhook (signing secret is shown once)
      description: EP-023-T10. The server generates a signing secret whsec_… (returned ONCE), used to sign deliveries (X-P2M-Signature). url must be https and public (SSRF-guard). events — filter (empty = all). 403 if the tier has no webhooks_enabled or the tier's endpoint limit is reached.
      security:
      - Session: []
      - DeviceToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/V2WebhookCreateRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2WebhookCreated'
        '400':
          description: Invalid url/events
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2Error'
        '401':
          $ref: '#/components/responses/V2Unauthorized'
        '403':
          description: Webhooks unavailable on the tier or limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2Error'
      operationId: postApiV2Webhooks
      x-operation-id-source: derived
  /api/v2/webhooks/deliveries:
    get:
      tags:
      - v2 Webhooks
      summary: Delivery history (debugging/support)
      description: 'EP-023-T10 acceptance: visible delivery history (incl. failed) — status, attempts, response code, error.'
      security:
      - Session: []
      - DeviceToken: []
      responses:
        '200':
          description: Recent deliveries (newest first)
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/V2WebhookDelivery'
        '401':
          $ref: '#/components/responses/V2Unauthorized'
      operationId: getApiV2WebhooksDeliveries
      x-operation-id-source: derived
  /api/v2/webhooks/{webhookId}:
    delete:
      tags:
      - v2 Webhooks
      summary: Delete a webhook
      security:
      - Session: []
      - DeviceToken: []
      parameters:
      - name: webhookId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/V2Unauthorized'
        '404':
          $ref: '#/components/responses/V2NotFound'
      operationId: deleteApiV2WebhooksByWebhookId
      x-operation-id-source: derived
components:
  schemas:
    V2WebhookCreateRequest:
      type: object
      required:
      - url
      properties:
        url:
          type: string
          format: uri
          description: https, public host (SSRF-guard)
        events:
          type: array
          description: empty = subscribe to all events
          items:
            type: string
            enum:
            - job.ready
            - job.error
            - job.deleted
            - job.truncated
        description:
          type: string
          maxLength: 256
    V2Error:
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: 'v2 codes: validation_error, unauthorized, forbidden, not_found, slots_full, rate_limited, not_ready, gone, idempotency_conflict, active_subscription, checkout_in_progress, quota_exceeded, file_too_large'
          example: rate_limited
        message:
          type: string
        reason:
          type: string
          description: 'EP-065-T8. Machine-readable sub-case, currently only on 409 active_subscription from /billing/checkout: same_plan | downgrade | shorter_interval | current_interval_unknown. Lets a localized client render its own wording instead of the English `message`. ABSENT for an anonymous caller by design — the per-case detail is what made the endpoint answer "does this address pay us" (EP-064-T7). Additive and optional: clients that ignore it keep working.

            '
          enum:
          - same_plan
          - downgrade
          - shorter_interval
          - current_interval_unknown
        used:
          type: integer
          format: int64
          description: 'EP-070-T7: on 409 quota_exceeded — pages already spent this month.'
        limit:
          type: integer
          description: 'EP-070-T7: on 409 quota_exceeded — the monthly allowance that was reached.'
        reset_at:
          type: string
          format: date-time
          description: 'EP-070-T7: on 409 quota_exceeded — when the allowance returns (start of the next UTC calendar month, the exact boundary the counter rolls over on). Computed server-side so a client never guesses our timezone.'
    V2Webhook:
      type: object
      required:
      - id
      - url
      - events
      - enabled
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        events:
          type: array
          description: subscribed events; [] = all
          items:
            type: string
            enum:
            - job.ready
            - job.error
            - job.deleted
            - job.truncated
        description:
          type: string
        enabled:
          type: boolean
        failure_count:
          type: integer
          description: consecutive failed exhausted deliveries
        last_delivery_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
    V2WebhookCreated:
      allOf:
      - $ref: '#/components/schemas/V2Webhook'
      - type: object
        required:
        - secret
        properties:
          secret:
            type: string
            description: Signing secret (whsec_…) for X-P2M-Signature — shown ONCE
    V2WebhookDelivery:
      type: object
      description: 'EP-023-T10: one delivery attempt (history for debugging/support).'
      properties:
        id:
          type: string
          format: uuid
        webhook_id:
          type: string
          format: uuid
          nullable: true
          description: null = per-job callback
        job_id:
          type: string
          format: uuid
        event:
          type: string
          enum:
          - job.ready
          - job.error
          - job.deleted
          - job.truncated
        target_url:
          type: string
          format: uri
        status:
          type: string
          enum:
          - pending
          - sending
          - delivered
          - failed
          - exhausted
        attempts:
          type: integer
        max_attempts:
          type: integer
          description: per-tier retry budget
        response_code:
          type: integer
          nullable: true
        last_error:
          type: string
          nullable: true
        last_attempt_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
  responses:
    V2NotFound:
      description: Not found or no access (ownership)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V2Error'
    V2Unauthorized:
      description: Missing/invalid API key or session
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V2Error'
  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.

        '