{ "openapi": "3.0.1", "info": { "title": "ConvertAPI", "description": "# High-Performance File Conversion API\nConvert Word, Excel, PowerPoint, HTML, PDF and Image formats with our powerful file conversion service.\nWe support more than [200 file types.]( https://www.convertapi.com/doc/file-formats)", "termsOfService": "https://www.convertapi.com/terms", "contact": { "url": "https://www.convertapi.com/support", "email": "support@convertapi.com" }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "v2" }, "servers": [ { "url": "https://v2.convertapi.com" }, { "url": "https://eu-v2.convertapi.com" }, { "url": "https://uk-v2.convertapi.com" }, { "url": "https://us-v2.convertapi.com" }, { "url": "https://ca-v2.convertapi.com" }, { "url": "https://as-v2.convertapi.com" }, { "url": "https://au-v2.convertapi.com" } ], "paths": { "/upload": { "post": { "tags": [ "File Server" ], "summary": "File upload to the ConvertAPI file server", "description": "When source files require multiple conversions, optimizing performance is possible by uploading the file once and then performing multiple conversions without the need for re-uploading.\nThe uploaded file is securely stored on the convertapi.com server for a maximum period of 3 hours and can be accessed through a unique secret URL with a UUID.\nIn conversion requests, the file can be referenced using the File ID, which is generated upon successful file upload.\n", "externalDocs": { "url": "https://www.convertapi.com/doc/upload" }, "parameters": [ { "name": "filename", "in": "query", "description": "File name.\nRequired if the header field `content-disposition` is not set.\n", "schema": { "type": "string" }, "example": "myfile.pdf" }, { "name": "content-disposition", "in": "header", "description": "This header field is used to determine the file name.\n**Required** if query parameter `filename` is not set.\nQuery parameter `filename` overrides this parameter.\n", "schema": { "type": "string" }, "example": "Content-Disposition: inline; filename=\"myfile.pdf\"" }, { "name": "fileId", "in": "query", "description": "Custom ID for the file that is uploaded. Lowercase alphanumeric character string.", "schema": { "$ref": "#/components/schemas/fileId" }, "example": "25811safe8e61dd3f51ef00ee5f58b92" }, { "name": "url", "in": "query", "description": "Remote file URL. The URL of the file you want to upload and store on the ConvertAPI file server.\nIf the file is accessible by the URL, it can be uploaded directly from its location by passing the URL instead of the file itself.\n", "schema": { "type": "string", "format": "uri" }, "example": "https://example.com/myfile.pdf" }, { "name": "headername", "in": "query", "description": "Remote file request header field name (used exclusively in conjunction with the `url` parameter).", "schema": { "type": "string" }, "example": "header-field-name" }, { "name": "headervalue", "in": "query", "description": "Remote file request header field value (used exclusively in conjunction with the `url` and `headername` parameters).", "schema": { "type": "string" }, "example": "Header field value" } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "description": "The file to upload", "format": "binary" } } }, "example": "There can be only one part with file data.\n```http\n[POST]\nhttps://v2.convertapi.com/upload \nContent-Type: multipart/form-data; boundary=----7MA4YWxkTrZu0gW\n\n------7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"file\"; filename=\"my_file.doc\"\n\n--FILE DATA--\n------7MA4YWxkTrZu0gW--\n```\n" }, "application/octet-stream": { "schema": { "type": "string", "format": "binary" }, "example": "```http\n[POST]\nhttps://v2.convertapi.com/upload \nContent-Disposition: inline; filename=\"my_file.doc\"\n\n--FILE DATA--\n```\n" } } }, "responses": { "200": { "description": "The file to upload", "content": { "application/json": { "schema": { "type": "object", "properties": { "FileName": { "type": "string", "example": "myfile.docx" }, "FileExt": { "type": "string", "example": "docx" }, "FileSize": { "type": "integer", "format": "int32", "example": "1026736" }, "FileId": { "type": "string", "example": "9shcxkk4zvesuzl2xavmg9afqbr2ty62" }, "Url": { "type": "string", "format": "uri", "example": "https://v2.convertapi.com/d/9shcxkk4zvesuzl2xavmg9afqbr2ty62" } } } }, "text/plain": { "schema": { "format": "string", "example": "9shcxkk4zvesuzl2xavmg9afqbr2ty62" } } } }, "400": { "description": "File request with an invalid file ID" }, "415": { "description": "The file type is not supported" }, "500": { "description": "Unable to store or download remote file" } } } }, "/d/{fileId}": { "get": { "tags": [ "File Server" ], "summary": "File download from the ConvertAPI file server", "operationId": "download", "parameters": [ { "$ref": "#/components/parameters/fileId" }, { "name": "download", "in": "query", "description": "- `attachment` - download a file\n- `inline` - view file in a web browser\n", "schema": { "enum": [ "attachment", "inline" ], "type": "string" } } ], "responses": { "200": { "description": "Success", "headers": { "content-disposition": { "$ref": "#/components/headers/content-disposition" }, "file-name": { "$ref": "#/components/headers/file-name" }, "file-ext": { "$ref": "#/components/headers/file-ext" }, "file-size": { "$ref": "#/components/headers/file-size" } }, "content": { "application/octet-stream": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "File not found" } } }, "delete": { "tags": [ "File Server" ], "summary": "Delete uploaded file", "description": "If the file is no longer required it can be deleted. Otherwise, it will be automatically deleted after 3 hours.", "parameters": [ { "$ref": "#/components/parameters/fileId" } ], "responses": { "200": { "description": "File deleted successfuly" }, "404": { "description": "File not found" } } }, "head": { "tags": [ "File Server" ], "summary": "Get file information without receiving file", "parameters": [ { "$ref": "#/components/parameters/fileId" } ], "responses": { "200": { "description": "Success", "headers": { "content-disposition": { "$ref": "#/components/headers/content-disposition" }, "file-name": { "$ref": "#/components/headers/file-name" }, "file-ext": { "$ref": "#/components/headers/file-ext" }, "file-size": { "$ref": "#/components/headers/file-size" } } }, "404": { "description": "File not found" } } } }, "/user": { "get": { "tags": [ "User" ], "summary": "User information", "description": "The endpoint returns information about a user account.\nIt is helpful to check the account balance status and other data.\nThe /user endpoint can be authenticated only with a secret.\nThe token is not accepted.\n", "externalDocs": { "url": "https://www.convertapi.com/doc/user" }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "Active": { "type": "boolean", "description": "User can perform conversions" }, "Email": { "type": "string", "description": "User email", "example": "user@example.com" }, "Secret": { "type": "string", "description": "Authentication secret", "example": "1XKrszdaFZH33WTh" }, "ApiKey": { "type": "integer", "description": "Authentication API key", "format": "int64", "example": 842679918 }, "ConversionsTotal": { "type": "integer", "description": "Plan conversion count", "format": "int64", "example": 5000 }, "ConversionsConsumed": { "type": "integer", "description": "Conversions consumed", "format": "int64", "example": 458 }, "SecondsLeft": { "type": "integer", "format": "int64", "deprecated": true }, "FullName": { "type": "string", "description": "User full name", "example": "John Wick" } } } } } }, "401": { "$ref": "#/components/responses/401" } }, "security": [ { "secret": [ ] } ] } }, "/user/statistic": { "get": { "tags": [ "User" ], "summary": "Usage statistics information", "description": "The endpoint that returns information about your usage statistics based on the date range.", "externalDocs": { "url": "https://www.convertapi.com/doc/user" }, "parameters": [ { "name": "startDate", "in": "query", "description": "Conversions from date", "required": true, "schema": { "type": "string" }, "example": "2023-09-01" }, { "name": "endDate", "in": "query", "description": "Conversions to date", "required": true, "schema": { "type": "string" }, "example": "2023-09-30" } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "Result": { "type": "boolean", "description": "Is conversion successful" }, "CreatedAt": { "type": "string", "description": "Conversion time" }, "ExecutionTime": { "type": "integer", "description": "Conversion duration", "format": "int32" }, "Converter": { "type": "string", "description": "File converter name" }, "SourceFormat": { "type": "string", "description": "Source file format (docx, pdf, jpg etc.)" }, "DestinationFormat": { "type": "string", "description": "Destination file format (docx, pdf, jpg etc.)" }, "Ip": { "type": "string", "description": "File conversion request origin IP" }, "Source": { "type": "string", "description": "Source file name" }, "Error": { "type": "string", "description": "Conversion error message" } } } } }, "text/csv": { "schema": { "type": "string" } } } }, "400": { "$ref": "#/components/responses/400" } }, "security": [ { "secret": [ ] } ] } }, "/convert/pdf/to/compress": { "summary": "PDF to COMPRESS File Conversion API", "description": "Compress and reduce a PDF file size by up to 90% \n Read more about the converter here: https://www.convertapi.com/pdf-to-compress", "post": { "tags": [ "Conversion" ], "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "File" ], "type": "object", "properties": { "Timeout": { "maximum": 1200, "minimum": 10, "type": "integer", "description": "Conversion timeout in seconds.", "default": 900 }, "StoreFile": { "type": "boolean", "description": "Store converted file on our secure server and provides download URL.", "default": false }, "File": { "type": "string", "description": "File to be converted. Value can be URL or file content.", "format": "binary" }, "FileName": { "type": "string", "description": "" }, "Password": { "type": "string", "description": "Sets the password to open protected documents." }, "Presets": { "enum": [ "none", "text", "archive", "web", "ebook", "printer" ], "type": "string", "description": "Choose compression level from presets. If preset is selected all other compression options are ignored.\n * `none` - Not set - advanced properties used\n * `text` - Text - 20 image DPI, lowest quality, highest compression\n * `archive` - Archive - 40 image DPI, low quality, high compression\n * `web` - Web - 75 image DPI, medium quality, high compression\n * `ebook` - Ebook - 150 image DPI, high quality, medium compression\n * `printer` - Printer - 300 image DPI, high quality, low compression", "default": "none" }, "ColorImageCompression": { "enum": [ "none", "jpg", "jpx", "zip" ], "type": "string", "description": "Color image compression algorithm.\n * `none` - Image will be left uncompressed\n * `jpg` - JPEG compression\n * `jpx` - JPEG2000 compression (Acrobat 6/PDF v1.5 and later)\n * `zip` - Deflate ZIP compression", "default": "jpg" }, "ColorImageQuality": { "maximum": 100, "minimum": 10, "type": "integer", "description": "Color image compression quality. The parameter applies only to JPX and JPG compressions.", "default": 50 }, "ColorImageDownsample": { "type": "boolean", "description": "Enable Bicubic image downsampling and decreases the number of pixels in the color image which in turn makes the file smaller.", "default": false }, "ColorImageThresholdDpi": { "maximum": 3000, "minimum": 72, "type": "integer", "description": "Threshold in DPI to activate color images resampling. ColorImageDownsample property must be enabled.", "default": 200 }, "ColorImageResampleDpi": { "maximum": 2400, "minimum": 10, "type": "integer", "description": "Color image resolution in DPI after Bicubic resampling. ColorImageDownsample property must be enabled.", "default": 150 }, "GrayscaleImageCompression": { "enum": [ "none", "jpg", "jpx", "zip" ], "type": "string", "description": "Grayscale image compression algorithm.\n * `none` - Image will be left uncompressed\n * `jpg` - JPEG compression\n * `jpx` - JPEG2000 compression (Acrobat 6/PDF v1.5 and later)\n * `zip` - Deflate ZIP compression", "default": "jpg" }, "GrayscaleImageQuality": { "maximum": 100, "minimum": 10, "type": "integer", "description": "Grayscale image compression quality. The parameter applies only to JPX and JPG compressions.", "default": 50 }, "GrayscaleImageDownsample": { "type": "boolean", "description": "Enable Bicubic image downsampling and decreases the number of pixels in the grayscale image which in turn makes the file smaller.", "default": false }, "GrayscaleImageThresholdDpi": { "maximum": 3000, "minimum": 72, "type": "integer", "description": "Threshold in DPI to activate grayscale images resampling. GrayscaleImageDownsample property must be enabled.", "default": 200 }, "GrayscaleImageResampleDpi": { "maximum": 2400, "minimum": 10, "type": "integer", "description": "Grayscale image resolution in DPI after Bicubic resampling. GrayscaleImageDownsample property must be enabled.", "default": 150 }, "MonochromeImageCompression": { "enum": [ "none", "jbig2", "jbig2l", "fax", "zip" ], "type": "string", "description": "Monochrome image compression algorithm.\n * `none` - Image will be left uncompressed\n * `jbig2` - JBIG2 lossy compression (Acrobat 5/PDF v1.4 and later)\n * `jbig2l` - JBIG2 lossless compression (Acrobat 5/PDF v1.4 and later)\n * `fax` - Group 4 CCITT facsimile/fax compression\n * `zip` - Deflate ZIP compression", "default": "jbig2l" }, "MonochromeImageQuality": { "maximum": 10, "minimum": 1, "type": "integer", "description": "Monochrome image compression quality. The parameter applies only to jbig2 and jbig2l compressions.", "default": 5 }, "MonochromeImageDownsample": { "type": "boolean", "description": "Enable Bicubic image downsampling and decreases the number of pixels in the monochrome image which in turn makes the file smaller.", "default": false }, "MonochromeImageThresholdDpi": { "maximum": 3000, "minimum": 100, "type": "integer", "description": "Threshold in DPI to activate Monochrome images resampling. MonochromeImageDownsample property must be enabled.", "default": 200 }, "MonochromeImageResampleDpi": { "maximum": 240, "minimum": 10, "type": "integer", "description": "Monochrome image resolution in DPI after Bicubic resampling. MonochromeImageDownsample property must be enabled.", "default": 150 }, "UnembedBaseFonts": { "type": "boolean", "description": "Specifies whether to remove the base fonts from the PDF file.", "default": false }, "SubsetEmbeddedFonts": { "type": "boolean", "description": "Output PDF should only contain font characters utilized in the original document, and any unused glyphs from all fonts in the document should be removed.", "default": false }, "RemoveBookmarks": { "type": "boolean", "description": "Remove bookmarks from the PDF file.", "default": false }, "RemoveAnnotations": { "type": "boolean", "description": "Remove text annotations from the PDF file.", "default": false }, "RemoveForms": { "type": "boolean", "description": "Remove PDF forms from the PDF file.", "default": false }, "RemovePageLabels": { "type": "boolean", "description": "Remove page labels from the PDF file.", "default": false }, "RemoveLayers": { "type": "boolean", "description": "Removes hidden layers and flatten visible ones.", "default": false }, "RemoveArticleThreads": { "type": "boolean", "description": "Remove article threads from the PDF file.", "default": false }, "RemoveTaggedInfo": { "type": "boolean", "description": "Remove tagged information from the PDF file.", "default": true }, "RemovePageThumbnails": { "type": "boolean", "description": "Remove page thumbnails from the PDF file.", "default": true }, "RemoveDuplicates": { "type": "boolean", "description": "Remove duplicate fonts and color profiles from the PDF file.", "default": true }, "RemoveAlternateImages": { "type": "boolean", "description": "Removes alternate images and leave only the one for on-screen viewing.", "default": true }, "RemoveNamedDestinations": { "type": "boolean", "description": "Remove named destinations from the PDF file.", "default": false }, "RemoveEmbeddedFiles": { "type": "boolean", "description": "Remove embedded/attachments files from the PDF file.", "default": true }, "RemovePieceInformation": { "type": "boolean", "description": "Remove piece information dictionaries like Adobe Illustrator or Photoshop private data.", "default": true }, "CreateObjectStreams": { "type": "boolean", "description": "Create object streams in the PDF file. An object stream represents a stream that contains a sequence of PDF objects. This allows a greater number of PDF objects to be compressed. Property compatible with Acrobat 6/PDF v1.5 and later.", "default": true }, "Optimize": { "type": "boolean", "description": "Optimize page content streams in the PDF file.", "default": true }, "LzwToFlate": { "type": "boolean", "description": "In streams that use LZW encoding, use Flate instead.", "default": true }, "Linearize": { "type": "boolean", "description": "Linearize PDF file and optimize for fast Web View.", "default": false }, "PreservePdfa": { "type": "boolean", "description": "Preserve the PDF/A standard in the PDF file.", "default": true } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "ConversionCost": { "type": "integer", "description": "This amount will be deducted from your balance after the conversion.", "format": "int32", "example": 1 }, "Files": { "type": "array", "items": { "type": "object", "properties": { "FileName": { "type": "string", "description": "Name of the converted file.", "example": "myfile.pdf" }, "FileExt": { "type": "string", "description": "File type (file name extension)", "example": "pdf" }, "FileSize": { "type": "integer", "description": "File size", "format": "int32", "example": 111955 }, "FileId": { "type": "string", "description": "File ID", "example": "25811safe8e61dd3f51ef00ee5f58b92" }, "Url": { "type": "string", "description": "File URL", "example": "https://v2.convertapi.com/d/v01plsb72o0cmdooq90w4d1lnqsf6oy4/myfile.pdf" }, "FileData": { "type": "string", "description": "Base64 encoded file data", "format": "base64", "example": "JVBERi0xLjcKJb662+4KMSAwIG9iago8PC9UeXBlIC9DYXRhbG9n..." } } } } }, "externalDocs": { "url": "https://www.convertapi.com/doc/content-types#applicationjson-1" } } }, "multipart/mixed": { "schema": { "type": "string", "format": "binary", "externalDocs": { "url": "https://www.convertapi.com/doc/content-types#multipartmixed" } }, "example": "--43cf1475-ab15-4c6b-b5ee-e2cbcedfe92f\nConversionCost: 1\nContent-Type: application/octet-stream\nContent-Disposition: attachment; filename=\"my_file.pdf\"; size=8475\n\n--FILE CONTENT--\n--43cf1475-ab15-4c6b-b5ee-e2cbcedfe92f--\n" }, "application/octet-stream": { "schema": { "type": "string", "format": "binary", "externalDocs": { "url": "https://www.convertapi.com/doc/content-types#applicationoctet-stream-1" } } } } }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "415": { "$ref": "#/components/responses/415" }, "500": { "$ref": "#/components/responses/500" }, "503": { "$ref": "#/components/responses/503" } }, "security": [ { "secret": [ ] }, { "apiKey": [ ] }, { "token": [ ] }, { "basicAuth": [ ] }, { "jwt": [ ] } ] } } }, "components": { "schemas": { "fileId": { "maxLength": 32, "minLength": 32, "type": "string", "description": "Uploaded File ID", "example": "25811safe8e61dd3f51ef00ee5f58b92" }, "error": { "type": "object", "properties": { "Code": { "type": "integer", "description": "Error message code", "format": "int32", "example": 4000 }, "Message": { "type": "string", "description": "Error message text", "example": "Parameter validation error." } }, "externalDocs": { "url": "https://www.convertapi.com/doc/response-codes" } } }, "responses": { "400": { "description": "Malformed request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } } }, "401": { "description": "Authentication error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } } }, "415": { "description": "File type error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } } }, "500": { "description": "Conversion failure", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } } }, "503": { "description": "Conversion rate limit error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/error" } } } } }, "parameters": { "fileId": { "name": "fileId", "in": "path", "description": "File ID", "required": true, "schema": { "$ref": "#/components/schemas/fileId" } }, "src": { "name": "src", "in": "path", "description": "Source file format (docx, pdf, jpg etc.)", "required": true, "schema": { "type": "string" } }, "dst": { "name": "dst", "in": "path", "description": "Destination file format (docx, pdf, jpg etc.)", "required": true, "schema": { "type": "string" } } }, "headers": { "content-disposition": { "description": "File information ([docummentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition))", "schema": { "type": "string" } }, "file-name": { "description": "File name", "schema": { "type": "string" } }, "file-ext": { "description": "File name extension", "schema": { "type": "string" } }, "file-size": { "description": "File size", "schema": { "type": "integer" } } }, "securitySchemes": { "secret": { "type": "apiKey", "name": "secret", "in": "query" }, "apiKey": { "type": "apiKey", "name": "apikey", "in": "query" }, "token": { "type": "apiKey", "description": "[More information about the `Token`](https://www.convertapi.com/doc/auth#token)", "name": "token", "in": "query" }, "basicAuth": { "type": "http", "description": "[More information about the `Basic Authentication`](https://www.convertapi.com/doc/auth#basic-authentication)", "scheme": "basic" }, "jwt": { "type": "http", "description": "[More information about the `JWT`](https://www.convertapi.com/doc/auth#jwt-token)", "scheme": "bearer", "bearerFormat": "JWT" } } }, "tags": [ { "name": "Conversion", "description": "File Conversion API call", "externalDocs": { "description": "File Conversion related operations", "url": "https://www.convertapi.com/doc/content-types" } }, { "name": "File Server", "description": "ConvertAPI temporary file storage", "externalDocs": { "description": "File Server related operations", "url": "https://www.convertapi.com/doc/upload" } }, { "name": "User", "description": "API User", "externalDocs": { "description": "API User related operations", "url": "https://www.convertapi.com/doc/user" } } ], "externalDocs": { "description": "Find out more about ConvertAPI", "url": "https://www.convertapi.com/doc" } }