{ "openapi": "3.0.3", "info": { "title": "PDFShift API Documentation", "version": "3.0", "description": "This is the documentation for the PDFShift API.\n\nOur aim here is to provide you with a clear, concise and complete set of tool to generate the PDF you want.\n\nDon't forget to add the `sandbox` parameter to `True` while testing the API, this won't use your credits and generate free PDF (with a watermark).\nBut if you forgot to set it, don't worry ; Send us a message and we'll reset your credits usage.", "termsOfService": "https://pdfshift.io/terms", "contact": { "name": "PDFShift", "url": "https://pdfshift.io", "email": "support@pdfshift.io" }, "x-logo": { "url": "https://pdfshift.io/images/favicons/android-chrome-512x512.png" } }, "servers": [{ "url": "https://api.pdfshift.io/v3", "description": "", "x-last-modified": 1764750693905 }], "paths": { "/account": { "get": { "tags": ["account", "details"], "summary": "Account details", "description": "Returns the account details for the connected API Key", "responses": { "200": { "description" : "Account details", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" }, "example": { "success": true, "account": { "name": "Richard Hendricks", "firstname": "Richard", "email": "richard@piedpiper.com", "created": 1526561399000, "company_name": "PiedPiper", "company_details": "Hacker Hostel,\n5230 Newell Road,\nPalo Alto, CA 94303", "company_vat": null, "country": "US", "renew_date": 1763683200000, "avatar": "https://secure.gravatar.com/avatar/584ac79c82c64934d475251b46f78f4a?d=mm&s=96", "billing_email": "jared@piedpiper.com", "plan": { "display": "Business", "name": "business", "credits": 50000, "filesize": 1250, "timeout": 100, "price": 99, "yearly": false, "overage": 20 }, "hard_limit": null, "subscription_ends_at": null } } } }, "x-last-modified": 1764751907156 }, "401": { "description": "Unauthorized. Invalid auth key, missing, or disabled.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Too Many Requests. You have been rate limited.", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "x-last-modified": 1764751450778 }, "/credits/usage": { "get": { "tags": ["credits", "usage"], "summary": "Credits usage", "description": "Returns the current credits usage with some details to help you know where your usage is at.\n\nIt contains the `total` credits, the `remaining` credits you can use for your period and the `used` number of credits.\n\nThe `base` value might differ from the `total` if you have enabled overage. In this case, `base` represent the default limit from your current plan, whereas `total` is the limit set in your overage. Once your credit usage reaches the `total`, the conversions will be refused.", "responses": { "200": { "description": "Current credit usage", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Credits" }, "example": { "credits": { "base": 50000, "remaining": 49881, "total": 50000, "used": 119 }, "success": true } } }, "x-last-modified": 1764750969372 }, "401": { "description": "Unauthorized. Invalid auth key, missing, or disabled.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Too Many Requests. You have been rate limited.", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "x-last-modified": 1764750838571 }, "/invoices": { "get": { "tags": [], "summary": "Invoices list", "description": "", "responses": { "200": { "description": "List of invoices", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Invoices" }, "example": { "success": true, "invoices": { "has_more": true, "data": [ { "created": 1763123660000, "amount": 99, "reference": "PS202511-00010", "download_url": "https://api.pdfshift.io/v3/invoices/PS202511-00110.pdf?token=xxx_token_xxx" }, { "created": 1760445289000, "amount": 99, "reference": "PS202510-00109", "download_url": "https://api.pdfshift.io/v3/invoices/PS202510-00109.pdf?token=xxx_token_xxx" }, { "created": 1757853195000, "amount": 99, "reference": "PS202509-00108", "download_url": "https://api.pdfshift.io/v3/invoices/PS202509-00108.pdf?token=xxx_token_xxx" }, { "created": 1755180347000, "amount": 99, "reference": "PS202508-00107", "download_url": "https://api.pdfshift.io/v3/invoices/PS202508-00107.pdf?token=xxx_token_xxx" }, { "created": 1752496441000, "amount": 99, "reference": "PS202507-00106", "download_url": "https://api.pdfshift.io/v3/invoices/PS202507-00106.pdf?token=xxx_token_xxx" }, { "created": 1749904431000, "amount": 99, "reference": "PS202506-00105", "download_url": "https://api.pdfshift.io/v3/invoices/PS202506-00105.pdf?token=xxx_token_xxx" }, { "created": 1747226035000, "amount": 99, "reference": "PS202505-00104", "download_url": "https://api.pdfshift.io/v3/invoices/PS202505-00104.pdf?token=xxx_token_xxx" }, { "created": 1744634029000, "amount": 99, "reference": "PS202504-00103", "download_url": "https://api.pdfshift.io/v3/invoices/PS202504-00103.pdf?token=xxx_token_xxx" }, { "created": 1741955686000, "amount": 99, "reference": "PS202503-00102", "download_url": "https://api.pdfshift.io/v3/invoices/PS202503-00102.pdf?token=xxx_token_xxx" }, { "created": 1739536453000, "amount": 99, "reference": "PS202502-00101", "download_url": "https://api.pdfshift.io/v3/invoices/PS202502-00101.pdf?token=xxx_token_xxx" } ], "limit": 10, "page": 0, "total": 28 } } } }, "x-last-modified": 1764751440861 }, "401": { "description": "Unauthorized. Invalid auth key, missing, or disabled.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "429": { "description": "Too Many Requests. You have been rate limited.", "headers": { "X-RateLimit-Remaining": { "description": "The number of requests remaining in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Limit": { "description": "The maximum number of requests allowed in the current rate limit window.", "schema": { "type": "integer" } }, "X-RateLimit-Reset": { "description": "The time at which the current rate limit window resets (Unix timestamp).", "schema": { "type": "integer", "format": "int64" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "x-last-modified": 1764751463833 }, "/convert/pdf": { "post": { "tags": [], "summary": "Convert to PDF", "x-mint": { "content": "Convert a given HTML document to a PDF file.\n\nYou can provide the HTML source directly, or a URL to fetch it from.\n\nNumerous options are available to customize the generated PDF document.\n\n\nPlease note that the response from this endpoint will vary depending on some parameters.\n\nYou can read more at [Varying responses](/docs/varying-responses).\n" }, "parameters": [ { "name": "X-Processor-Version", "in": "header", "description": "Specifies the Chromium version that will be used for the conversion. Right now, only \"116\" and \"142\" are accepted.\nAll new users are automatically using the latest version.", "required": false, "schema": { "type": "string", "enum": ["116", "142"] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/ConvertForm" }, { "type": "object", "properties": { "landscape": { "type": "boolean", "default": false, "description": "Will set the view in landscape mode instead of portrait." }, "format": { "type": "string", "default": "A4", "description": "Format of the document.\nYou can either use the standard values (Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5) or a custom `{width}x{height}` value.\nFor `{width}` and `{height}`, you can indicate the following units: in, cm, mm.\n. The `{height}` value can be replaced by `auto` to automatically adjust the height to the content. For instance, pasing the format `1024xauto` will set the page width to 1024px and the height to the content height." }, "disable_backgrounds": { "type": "boolean", "default": false, "description": "The final document will not have the background images." }, "remove_blank": { "type": "boolean", "default": false, "description": "Will analyze the last page of the document. If no content is present in it, the page will be removed. But note that if there are remaining hidden data, header or footer that have been pushed to that page, the page will be kept." }, "pages": { "type": "string", "default": null, "description": "Pages to print. Can be one number (`3`), a range (`1-5`), a list (`4,5,6`) or a combination of both (`1-3,6,7`).\nIf the number is higher than the real number of pages, that number will be ignored." }, "zoom": { "type": "number", "minimum": 0.1, "maximum": 2, "default": 1, "description": "A value between 0.1 and 2.\nAllows you to increase the zoom in the document for specific purposes.\n1 is the default zoom, lower is smaller, higher is bigger." }, "margin": { "oneOf": [ { "$ref": "#/components/schemas/MarginForm" }, { "type": "string" }, { "type": "integer" } ], "default": null, "description": "Empty spaces between the outer and the beginning of the content. See the [Margin](/docs/margin) section for more details." }, "header": { "$ref": "#/components/schemas/CustomHeaderFooter", "description": "Defines a custom header.\n\n**Note**: The footer and header are Independent from the rest of the document.\n\nAs such, the CSS style defined in your body won't apply on your header/footer. To style your header/footer, you need to set a specific style either using