{"openapi":"3.0.3","info":{"title":"PDF Toolkit API","version":"1.0.0","description":"Merge, split, compress, protect and read PDF files.\n\nThe PDF operations every back office needs, without shipping Ghostscript and qpdf into your own image. Returns the binary directly, or JSON when you ask for metadata.","contact":{"url":"https://173-249-18-142.sslip.io"}},"servers":[{"url":"https://173-249-18-142.sslip.io"}],"tags":[{"name":"PDF Toolkit API","description":"Merge, split, compress, protect and read PDF files."}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Your Smallapis key. Omit it to use the demo quota."}}},"security":[{"apiKey":[]}],"paths":{"/v1/pdf/merge":{"post":{"tags":["PDF Toolkit API"],"summary":"Merge several PDFs into one","description":"Repeat the `file` part, or pass `urls` as a comma-separated list. Up to 20 documents per call.","operationId":"v1_pdf_merge","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"A PDF. Repeat the part for each document.","format":"binary"},"urls":{"type":"string","description":"Comma-separated public URLs instead of uploads."}}}},"application/json":{"schema":{"type":"object","properties":{"urls":{"type":"string","description":"Comma-separated public URLs instead of uploads."}}}}}}}},"/v1/pdf/split":{"post":{"tags":["PDF Toolkit API"],"summary":"Extract a page selection into a new PDF","description":"Extract a page selection into a new PDF","operationId":"v1_pdf_split","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"pages":{"type":"string","description":"Selection such as \"1,3,5-9\". Order is preserved."}},"required":["pages"]}},"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"string","description":"Selection such as \"1,3,5-9\". Order is preserved."}},"required":["pages"]}}}}}},"/v1/pdf/compress":{"post":{"tags":["PDF Toolkit API"],"summary":"Reduce the size of a PDF","description":"Runs Ghostscript and returns whichever of the two files is smaller, so a call can never inflate a document.","operationId":"v1_pdf_compress","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"level":{"type":"string","description":"screen, ebook, printer or prepress, from smallest to sharpest.","default":"ebook"}}}},"application/json":{"schema":{"type":"object","properties":{"level":{"type":"string","description":"screen, ebook, printer or prepress, from smallest to sharpest.","default":"ebook"}}}}}}}},"/v1/pdf/to-images":{"post":{"tags":["PDF Toolkit API"],"summary":"Render PDF pages to PNG or JPEG","description":"A single page comes back as a binary image; several pages come back as JSON with base64 payloads.","operationId":"v1_pdf_to_images","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"first":{"type":"integer","description":"First page to render, 1-based.","default":1},"last":{"type":"integer","description":"Last page to render. At most 50 pages per call."},"dpi":{"type":"integer","description":"Render resolution, 36-400.","default":150},"format":{"type":"string","description":"png or jpeg.","default":"png"}}}},"application/json":{"schema":{"type":"object","properties":{"first":{"type":"integer","description":"First page to render, 1-based.","default":1},"last":{"type":"integer","description":"Last page to render. At most 50 pages per call."},"dpi":{"type":"integer","description":"Render resolution, 36-400.","default":150},"format":{"type":"string","description":"png or jpeg.","default":"png"}}}}}}}},"/v1/pdf/from-images":{"post":{"tags":["PDF Toolkit API"],"summary":"Build a PDF from images","description":"Build a PDF from images","operationId":"v1_pdf_from_images","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"An image. Repeat the part for each page.","format":"binary"},"margin":{"type":"integer","description":"White margin in points.","default":0}}}},"application/json":{"schema":{"type":"object","properties":{"margin":{"type":"integer","description":"White margin in points.","default":0}}}}}}}},"/v1/pdf/extract-text":{"post":{"tags":["PDF Toolkit API"],"summary":"Pull the text layer out of a PDF","description":"Also returns `scannedLikely`, which tells you when to fall back to the OCR API.","operationId":"v1_pdf_extract_text","responses":{"200":{"description":"Result payload","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"layout":{"type":"boolean","description":"Keep the visual column layout.","default":false}}}},"application/json":{"schema":{"type":"object","properties":{"layout":{"type":"boolean","description":"Keep the visual column layout.","default":false}}}}}}}},"/v1/pdf/info":{"post":{"tags":["PDF Toolkit API"],"summary":"Read page count, size, author and encryption state","description":"Read page count, size, author and encryption state","operationId":"v1_pdf_info","responses":{"200":{"description":"Result payload","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"url":{"type":"string","description":"Public URL instead of an upload."}}}},"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Public URL instead of an upload."}}}}}}}},"/v1/pdf/protect":{"post":{"tags":["PDF Toolkit API"],"summary":"Encrypt a PDF with a password (AES-256)","description":"Encrypt a PDF with a password (AES-256)","operationId":"v1_pdf_protect","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"password":{"type":"string","description":"User password, 4 characters or more."}},"required":["password"]}},"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"User password, 4 characters or more."}},"required":["password"]}}}}}},"/v1/pdf/unlock":{"post":{"tags":["PDF Toolkit API"],"summary":"Remove the password from a PDF you own","description":"Remove the password from a PDF you own","operationId":"v1_pdf_unlock","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Encrypted PDF.","format":"binary"},"password":{"type":"string","description":"Current password."}}}},"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","description":"Current password."}}}}}}}},"/v1/pdf/watermark":{"post":{"tags":["PDF Toolkit API"],"summary":"Draw a diagonal text watermark on every page","description":"Draw a diagonal text watermark on every page","operationId":"v1_pdf_watermark","responses":{"200":{"description":"The produced file","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters"},"401":{"description":"Missing or invalid API key"},"413":{"description":"Payload larger than the plan allows"},"429":{"description":"Plan quota exhausted"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Source PDF.","format":"binary"},"text":{"type":"string","description":"Caption to draw."},"opacity":{"type":"number","description":"Fill opacity, 0.02-1.","default":0.18},"angle":{"type":"integer","description":"Rotation in degrees, -90 to 90.","default":45}},"required":["text"]}},"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"Caption to draw."},"opacity":{"type":"number","description":"Fill opacity, 0.02-1.","default":0.18},"angle":{"type":"integer","description":"Rotation in degrees, -90 to 90.","default":45}},"required":["text"]}}}}}}}}