{"openapi":"3.1.0","info":{"title":"CookMyPDF API","version":"1.0.0","description":"Convert, compress, and process files. Authenticate with an API key (`Authorization: Bearer ff_live_…`). 1 job = 1 credit; monthly credits per plan: free 300, premium 2000, business 10000. Files are deleted from storage within 1 hour."},"servers":[{"url":"https://api.cookmypdf.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"ff_live_…"}},"schemas":{"Job":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"toolId":{"type":"string","enum":["merge-pdf","split-pdf","remove-pages","extract-pages","rotate-pdf","organize-pdf","compress-pdf","repair-pdf","grayscale-pdf","word-to-pdf","excel-to-pdf","powerpoint-to-pdf","jpg-to-pdf","html-to-pdf","odt-to-pdf","ods-to-pdf","odp-to-pdf","rtf-to-pdf","txt-to-pdf","csv-to-pdf","csv-to-excel","markdown-to-pdf","epub-to-pdf","eml-to-pdf","cbz-to-pdf","pdf-to-word","pdf-to-excel","pdf-to-powerpoint","pdf-to-jpg","pdf-to-png","pdf-to-pdfa","pdf-to-text","pdf-to-html","pdf-to-epub","image-to-text","excel-to-csv","watermark-pdf","page-numbers","ocr-pdf","crop-pdf","edit-pdf","fill-form","mail-merge","flatten-pdf","protect-pdf","unlock-pdf","sign-pdf","redact-pdf","compare-pdf","redaction-check","accessibility-check","make-accessible","pdf-authenticity","print-preflight","pdf-metadata","strip-pdf-metadata","convert-image","svg-to-png","pdf-to-svg","remove-background","compress-image","resize-image","convert-video","compress-video","video-to-gif","video-to-audio","convert-audio","compress-audio","trim-video","trim-audio","mute-video","resize-video","video-thumbnail","gif-to-video","extract-subtitles","create-zip","extract-zip","nup-pdf","alternate-mix","resize-pdf","split-by-size","split-scans","add-bookmarks","extract-bookmarks","split-by-bookmark","split-every-n","booklet-pdf","pdf-stats","header-footer","stamp-pdf","bates-numbering","remove-annotations","sanitize-pdf","pdf-permissions","extract-images","extract-attachments","pdf-to-tiff","pdf-to-webp","pdf-to-odt","pdf-to-rtf","dxf-to-pdf","crop-image","rotate-image","flip-image","watermark-image","image-metadata","strip-image-metadata","favicon-ico","barcode-generator","barcode-reader","images-to-gif","rotate-video","crop-video","flip-video","change-video-speed","change-audio-speed","merge-video","merge-audio","normalize-audio","audio-to-waveform","burn-subtitles","extract-frames","extract-text","summarize-pdf","translate-pdf","pdf-to-markdown","extract-tables","ai-questions","ai-ocr","ai-redact","sort-files","auto-rename","auto-outline"]},"status":{"type":"string","enum":["queued","processing","succeeded","failed","expired"]},"error":{"type":"string"},"errorCode":{"type":"string","enum":["pdf_protected","pdf_no_text"]},"durationMs":{"type":"integer"}}},"Error":{"type":"object","properties":{"error":{"type":"string","description":"For a person. Wording may change; do not branch on it."},"code":{"type":"string","enum":["unauthenticated","forbidden","not_found","invalid_request","unsupported_file","file_too_large","quota_exceeded","rate_limited","payment_required","conflict","blocked","not_configured","internal"],"description":"For a program; stable. Two of them are about plans: `payment_required` means the request needs a paid plan (a Premium tool, a larger batch, a larger file), and `quota_exceeded` means the plan includes it and this period’s allowance is spent (monthly API credits or AI pages, the free plan’s hourly tasks, hourly upload slots). Neither is `rate_limited`, which is the only one worth retrying shortly."},"requestId":{"type":"string","description":"Echoes `x-request-id`; quote it to support."},"upgrade":{"type":"boolean","description":"True on a refusal that a different plan would lift."},"requiredPlan":{"type":"string","enum":["premium","business"],"description":"The cheapest plan that would have accepted the request. Absent when no plan would."},"limit":{"type":"string","enum":["tasks","aiPages","apiCredits","uploadSlots","signRequests","files","fileSize","proposals"],"description":"On every refusal that is about a plan limit: which one. `tasks` (hourly tasks), `aiPages` (monthly AI pages), `apiCredits` (monthly API credits), `uploadSlots` (hourly upload URLs), `signRequests` (daily signature requests), `files` (files in one task), `fileSize` (megabytes in one file), `proposals` (hourly free sort-files proposals). Branch on this, beside `code`, to say which allowance was reached."},"resetsAt":{"type":"string","format":"date-time","description":"On a refusal for a spent hourly allowance (tasks, upload slots, proposals): when it is available again."},"scope":{"type":"string","description":"Set on 403 when the key lacks a required scope."}}}}},"security":[{"apiKey":[]}],"paths":{"/v1/tools":{"get":{"summary":"List available tools","security":[],"responses":{"200":{"description":"Tool catalog"}}}},"/v1/plans":{"get":{"summary":"Plans, prices, limits and feature keys","security":[],"responses":{"200":{"description":"Every per-plan number the API enforces, so a client never has to hard-code one.","content":{"application/json":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["free","premium","business"]},"name":{"type":"string"},"priceMonthlyUsd":{"type":"number"},"priceYearlyUsd":{"type":"number"},"priceMonthlyCents":{"type":"integer"},"priceYearlyCents":{"type":"integer"},"perSeat":{"type":"boolean","description":"Prices are per seat."},"limits":{"type":"object","properties":{"maxFileSizeMb":{"type":["integer","null"]},"maxFilesPerTask":{"type":["integer","null"]},"tasksPerHour":{"type":["integer","null"]},"aiPagesPerMonth":{"type":["integer","null"]},"apiRequestsPerMinute":{"type":["integer","null"]},"signRequestsPerDay":{"type":["integer","null"]},"uploadSlotsPerHour":{"type":["integer","null"]},"workflows":{"type":"boolean"},"priorityQueue":{"type":"boolean"}}},"apiCredits":{"type":"integer"},"features":{"type":"array","items":{"type":"string","enum":["all-core-tools","premium-tools","ai-tools","workflows","priority-queue","teams","team-activity-log","api"]}}}}},"purchasable":{"type":"object","description":"Whether checkout is configured for each paid plan and interval: { premium: { monthly, yearly }, business: { monthly, yearly } }."}}}}}}}}},"/v1/uploads":{"post":{"summary":"Request presigned upload URLs, one per file, each signed for its size","description":"Declare the size of each file in bytes. Each returned URL accepts a PUT of exactly that many bytes (`Content-Length` is a signed header); storage refuses any other length. Sizes over the plan’s file limit are refused before anything is issued. The older `{ count }` body is refused with 400.","security":[{"apiKey":["jobs:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["files"],"properties":{"files":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","required":["size"],"properties":{"size":{"type":"integer","minimum":1,"description":"Bytes."}}}}}}}}},"responses":{"200":{"description":"{ uploads: [{ key, url }] }, in the order of `files`. PUT each file to its `url` (with exactly the declared length), then reference its `key` in the job. A key issued to an account can only be used by that account."},"400":{"description":"No `files` — including the retired `{ count }` form.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"A declared size is over the plan’s file limit (`file_too_large`, `limit: \"fileSize\"`, with `upgrade` and `requiredPlan` when a paid plan allows it). Nothing was issued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"More files than the plan takes in one task (`limit: \"files\"`). `payment_required` with `requiredPlan` when a paid plan allows more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The hour’s upload slots are spent (`quota_exceeded`, `limit: \"uploadSlots\"`, `resetsAt`), or the key’s per-minute request limit was reached (`rate_limited`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs":{"get":{"summary":"List jobs created with this key, newest first","security":[{"apiKey":["jobs:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The `nextCursor` of the previous page."}],"responses":{"200":{"description":"{ jobs: Job[], nextCursor?: string }"},"403":{"description":"The key lacks the jobs:read scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a conversion job (1 credit)","security":[{"apiKey":["jobs:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["toolId","inputKeys"],"properties":{"toolId":{"type":"string"},"inputKeys":{"type":"array","items":{"type":"string"}},"options":{"type":"object","description":"Tool-specific options. Every accepted key, type, default and allowed values are published by GET /v1/tools, and listed per tool below.","additionalProperties":true},"webhookUrl":{"type":"string","description":"Optional https callback POSTed on completion, signed with your key’s webhook secret (X-CookMyPDF-Signature: t=…,v1=HMAC-SHA256(secret, \"t.body\")). It must resolve to a public address, and redirects are not followed. `downloadUrls` are included only for a key that holds jobs:read, and nothing is delivered for a revoked key."}}}}}},"responses":{"202":{"description":"Job accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"402":{"description":"A tool the plan does not include (`payment_required`, with `requiredPlan`), or the month’s API credits or AI pages are spent (`quota_exceeded`, `limit: \"apiCredits\"` or `\"aiPages\"`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Too many files for one task (`limit: \"files\"`) or a file over the plan’s size limit (`limit: \"fileSize\"`) — `payment_required` with `requiredPlan` when a paid plan allows more — or an upload that is missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The key’s per-minute request limit (`rate_limited`). Session callers on the free plan are instead refused with `quota_exceeded`, `limit: \"tasks\"` and `resetsAt` once the hour’s tasks are spent; API keys are metered by monthly credits, not by the hour. A free sort-files proposal (`options.mode: \"propose\"`, which spends no AI pages) past the hourly bound is `quota_exceeded` with `limit: \"proposals\"`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{id}":{"get":{"summary":"Job status","security":[{"apiKey":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}}}}},"/v1/jobs/{id}/download":{"get":{"summary":"Presigned download URLs (valid 15 minutes)","security":[{"apiKey":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"{ urls: string[], files: [{ url, name?, size? }] } — the same results in the same order."}}}},"/v1/jobs/{id}/outputs/{index}/inline":{"get":{"summary":"One small text result, read through the API","description":"For showing a report rather than saving it. `index` is the position in the download route’s `files`, from 0. Only results whose extension is json, txt, csv or md, of at most 512 KB; served as `application/json` or `text/plain` with `X-Content-Type-Options: nosniff`, never as HTML.","security":[{"apiKey":["jobs:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"The result’s bytes","content":{"application/json":{},"text/plain":{}}},"404":{"description":"No such job, no result at that index, or the result has expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The job has not succeeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Larger than 512 KB (`file_too_large`); download it instead","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Not a json, txt, csv or md result (`unsupported_file`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"summary":"This hour’s tasks for the caller","description":"Public. For a signed-out caller, counted by address exactly as the hourly limit counts them; for an API key, `limit` is null because keys are metered by monthly credits.","security":[{},{"apiKey":[]}],"responses":{"200":{"description":"The caller’s plan and hourly task meter","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["free","premium","business"]},"tasks":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":["integer","null"]},"resetsAt":{"type":["string","null"],"format":"date-time"}}}}}}}}}}},"/v1/sign-requests":{"post":{"summary":"Send a document for signature (emails the recipient in your name)","description":"Requires the sign:write scope, which is separate from jobs:write because this acts in the account owner’s name rather than on their files. The account’s email address must be verified, since the email quotes it. Limited per account per day (5 on free, 50 on premium, 200 on business) and to 20 an hour per address. The document must be a PDF no larger than the free plan’s file limit, because the recipient signs it without an account. It is kept for 7 days rather than the usual hour, so the recipient has time to open it.","security":[{"apiKey":["sign:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["inputKey","recipientEmail"],"properties":{"inputKey":{"type":"string","pattern":"^up/[0-9a-f-]{36}$","description":"An upload key from POST /v1/uploads, not a result key."},"recipientEmail":{"type":"string","format":"email","maxLength":254},"message":{"type":"string","maxLength":500},"locale":{"type":"string","enum":["en","es","fr","de","pt","ar"],"description":"The language the recipient's email is written in. Defaults to the sending account's language."}}}}}},"responses":{"201":{"description":"Request created and emailed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"recipientEmail":{"type":"string","format":"email"},"expiresAt":{"type":"string","format":"date-time"}}}}}},"403":{"description":"The key lacks the sign:write scope, or the account’s email address is not verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The upload has expired, is not a PDF, or is too large to be signed (`limit: \"fileSize\"`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"The account has sent its daily allowance of signature requests (`quota_exceeded`, `limit: \"signRequests\"`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sign-requests/{id}":{"delete":{"summary":"Withdraw a signature request that has not been signed","description":"Ends the recipient’s link at once and removes the stored document. Only a pending request can be withdrawn.","security":[{"apiKey":["sign:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"{ ok: true }"},"404":{"description":"No pending request with that id belongs to this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}