{
  "openapi": "3.0.4",
  "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": {
    "/convert/eml/to/pdf": {
      "summary": "EML to PDF API",
      "description": "Convert EML emails to PDF/A with headers, attachments, merge, page size, orientation, margins, and compression options.",
      "post": {
        "tags": [
          "Conversion"
        ],
        "externalDocs": {
          "description": "Read more about the converter",
          "url": "https://www.convertapi.com/eml-to-pdf"
        },
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "File": {
                    "type": "string",
                    "description": "File to be converted. Value can be URL or file content.",
                    "format": "binary",
                    "x-ca-featured": true,
                    "x-ca-label": "File",
                    "x-ca-group": "Input",
                    "x-ca-type": "File",
                    "x-ca-representation": "Default",
                    "x-ca-allowed-extensions": [
                      "eml",
                      "msg"
                    ]
                  },
                  "FileName": {
                    "type": "string",
                    "description": "The `FileName` property defines the name of the output file(s) generated by the file conversion API, ensuring safe and\r\nunique file naming. It sanitizes input filenames to remove potentially harmful characters, automatically appends the\r\ncorrect file extension based on the target format, and includes an indexing feature to distinguish multiple output files\r\nfrom a single input. For example, converting `report.docx` to PDF format might result in `report.pdf` for a single file,\r\nor `report_0.pdf`, `report_1.pdf` for multiple files, ensuring each output file is uniquely identifiable.",
                    "x-ca-featured": false,
                    "x-ca-label": "Output file name",
                    "x-ca-group": "Output",
                    "x-ca-type": "String",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "1",
                      "to": "200"
                    }
                  },
                  "ConvertHeader": {
                    "type": "boolean",
                    "description": "This property controls the inclusion of email header in the PDF conversion process. \r\nWhen set to `true`, the converter will incorporate the email's header information, such as **From**, **To**, **Subject**, **Date**, etc., into the generated PDF file.\r\nWhen `TemplateFile` is set, this parameter has no effect - the template decides which header fields appear.\r\n",
                    "default": true,
                    "x-ca-featured": false,
                    "x-ca-label": "Convert Header",
                    "x-ca-group": "Email",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  },
                  "TemplateFile": {
                    "type": "string",
                    "description": "Custom HTML page used to lay out the converted email. Value can be URL or file content. When not set, the built-in template is used (with or without the header table depending on `ConvertHeader`). When set, `ConvertHeader` has no effect - the template decides which header fields appear.\r\n\r\nThe template is plain HTML with the following placeholders:\r\n\r\n- `{{subject}}` - email subject\r\n- `{{from}}` - sender\r\n- `{{to}}` - recipients\r\n- `{{cc}}` - copied recipients\r\n- `{{sent}}` - sent date, formatted according to `DateTimeFormat`\r\n- `{{emailContent}}` - the email body, inserted where the placeholder is\r\n\r\nExample:\r\n\r\n```html\r\n<html>\r\n<body>\r\n  <h2>{{subject}}</h2>\r\n  <p>From: {{from}} - Sent: {{sent}}</p>\r\n  {{emailContent}}\r\n</body>\r\n</html>\r\n```\r\n\r\nThe email body is rendered in its own isolated block, so the email's CSS does not affect your page and your CSS does not affect the email.\r\n",
                    "format": "binary",
                    "x-ca-featured": false,
                    "x-ca-label": "Template file",
                    "x-ca-group": "Email",
                    "x-ca-type": "File",
                    "x-ca-representation": "Default",
                    "x-ca-allowed-extensions": [
                      "html",
                      "htm"
                    ]
                  },
                  "DateTimeFormat": {
                    "type": "string",
                    "description": "Format of the **Sent** date shown in the email header, as a .NET custom date and time format string. When not set, the date is printed in US style with a 12-hour clock. Common values:\r\n\r\n- `yyyy-MM-dd HH:mm` - ISO order, 24-hour time\r\n- `yyyy/MM/dd HH:mm` - year first with slashes\r\n- `dd.MM.yyyy HH:mm` - day first with dots\r\n- `dd-MM-yyyy HH:mm` - day first with dashes\r\n- `dd/MM/yyyy HH:mm` - day first with slashes\r\n- `MM/dd/yyyy h:mm tt` - month first, 12-hour clock with AM/PM\r\n- `yyyy-MM-dd` - date only\r\n- `yyyy-MM-dd HH:mm zzz` - with the sender's UTC offset\r\n\r\nSupported format specifiers: `yyyy` year, `MM` month number, `MMM` abbreviated month name, `MMMM` full month name, `dd` day, `HH` hours (24-hour clock), `hh` hours (12-hour clock), `tt` AM/PM designator, `mm` minutes, `ss` seconds, `zzz` UTC offset. Other characters are printed literally. Literal words must be enclosed in single quotes, for example `d MMMM yyyy 'at' HH:mm`. Month and day names are rendered in English.\r\n",
                    "x-ca-featured": false,
                    "x-ca-label": "Date and time format",
                    "x-ca-group": "Email",
                    "x-ca-type": "String",
                    "x-ca-representation": "Default"
                  },
                  "ConvertAttachments": {
                    "type": "boolean",
                    "description": "Convert email attachments.",
                    "default": false,
                    "x-ca-featured": false,
                    "x-ca-label": "Convert attachments",
                    "x-ca-group": "Email",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  },
                  "IgnoreAttachmentErrors": {
                    "type": "boolean",
                    "description": "When enabled, attachment conversion errors are ignored and the email is still converted. This parameter is only used when `ConvertAttachments` is enabled.",
                    "default": false,
                    "x-ca-featured": false,
                    "x-ca-label": "Ignore attachment errors",
                    "x-ca-group": "Email",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  },
                  "Merge": {
                    "type": "boolean",
                    "description": "Merge email body with attachments during the conversion process. Only works when `ConvertAttachments` property enabled. ",
                    "default": true,
                    "x-ca-featured": false,
                    "x-ca-label": "Merge body and attachments",
                    "x-ca-group": "Email",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  },
                  "PageOrientation": {
                    "enum": [
                      "portrait",
                      "landscape"
                    ],
                    "type": "string",
                    "description": "PDF page orientation.",
                    "default": "portrait",
                    "x-ca-featured": false,
                    "x-ca-label": "Page orientation",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Collection",
                    "x-ca-representation": "Dropdown",
                    "x-ca-values": {
                      "portrait": "Portrait",
                      "landscape": "Landscape"
                    }
                  },
                  "PageSize": {
                    "enum": [
                      "a0",
                      "a1",
                      "a2",
                      "a3",
                      "a4",
                      "a5",
                      "a6",
                      "a7",
                      "a8",
                      "a9",
                      "b0",
                      "b1",
                      "b2",
                      "b3",
                      "b4",
                      "b5",
                      "letter",
                      "legal",
                      "ledger"
                    ],
                    "type": "string",
                    "description": "PDF page size.",
                    "default": "a4",
                    "x-ca-featured": false,
                    "x-ca-label": "Page size",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Collection",
                    "x-ca-representation": "Dropdown",
                    "x-ca-values": {
                      "a0": "A0",
                      "a1": "A1",
                      "a2": "A2",
                      "a3": "A3",
                      "a4": "A4",
                      "a5": "A5",
                      "a6": "A6",
                      "a7": "A7",
                      "a8": "A8",
                      "a9": "A9",
                      "b0": "B0",
                      "b1": "B1",
                      "b2": "B2",
                      "b3": "B3",
                      "b4": "B4",
                      "b5": "B5",
                      "letter": "Letter",
                      "legal": "Legal",
                      "ledger": "Ledger"
                    }
                  },
                  "MarginTop": {
                    "maximum": 500,
                    "minimum": 0,
                    "type": "integer",
                    "description": "Set the page top margin in millimeters (mm).",
                    "default": 5,
                    "x-ca-featured": false,
                    "x-ca-label": "Margin top",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Integer",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "0",
                      "to": "500"
                    }
                  },
                  "MarginRight": {
                    "maximum": 500,
                    "minimum": 0,
                    "type": "integer",
                    "description": "Set the page right margin in millimeters (mm).",
                    "default": 5,
                    "x-ca-featured": false,
                    "x-ca-label": "Margin right",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Integer",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "0",
                      "to": "500"
                    }
                  },
                  "MarginBottom": {
                    "maximum": 500,
                    "minimum": 0,
                    "type": "integer",
                    "description": "Set the page bottom margin in millimeters (mm).",
                    "default": 5,
                    "x-ca-featured": false,
                    "x-ca-label": "Margin bottom",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Integer",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "0",
                      "to": "500"
                    }
                  },
                  "MarginLeft": {
                    "maximum": 500,
                    "minimum": 0,
                    "type": "integer",
                    "description": "Set the page left margin in millimeters (mm).",
                    "default": 5,
                    "x-ca-featured": false,
                    "x-ca-label": "Margin left",
                    "x-ca-group": "Page Options",
                    "x-ca-type": "Integer",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "0",
                      "to": "500"
                    }
                  },
                  "Pdfa": {
                    "type": "boolean",
                    "description": "Create PDF/A-1b compliant document.",
                    "default": false,
                    "x-ca-featured": false,
                    "x-ca-label": "Create PDF/A",
                    "x-ca-group": "PDF Output",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  },
                  "Timeout": {
                    "maximum": 1200,
                    "minimum": 10,
                    "type": "integer",
                    "description": "Conversion timeout in seconds.",
                    "default": 900,
                    "x-ca-featured": false,
                    "x-ca-label": "Timeout",
                    "x-ca-group": "Execution",
                    "x-ca-type": "Integer",
                    "x-ca-representation": "Default",
                    "x-ca-range": {
                      "from": "10",
                      "to": "1200"
                    }
                  },
                  "StoreFile": {
                    "type": "boolean",
                    "description": "When the `StoreFile` parameter is set to `True`, your converted file is written to ConvertAPI’s encrypted, temporary storage and made available via a time-limited secure download URL, valid for up to 3 hours. After this period, the file is permanently deleted.\r\n\r\nWhen `StoreFile` is set to `False`, conversion happens entirely in-memory. The raw file bytes are streamed back in the API response without touching disk or external storage, ensuring maximum security and zero persistence so that only you can access the content.\r\n",
                    "default": false,
                    "x-ca-featured": false,
                    "x-ca-label": "Store file",
                    "x-ca-group": "Output",
                    "x-ca-type": "Bool",
                    "x-ca-representation": "Default"
                  }
                }
              }
            }
          }
        },
        "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": [ ]
          },
          {
            "token": [ ]
          },
          {
            "jwt": [ ]
          }
        ]
      },
      "x-ca-overview": "The EML to PDF API swiftly converts EML email files into PDF documents, offering a rapid solution to your email file conversion needs.\nIt includes options for adding email headers, adjusting page orientation and size, setting margins, and compressing\nfiles. The API also supports converting email attachments and merging them with email bodies, creating PDF and PDF/A\ncompliant documents.\nThis API is useful for businesses needing to archive emails in a standardized and accessible\nformat, and for legal firms requiring documented email evidence in a secure, non-editable format.\n",
      "x-ca-overview-markdown": "The EML to PDF API swiftly converts **EML** email files into **PDF** documents, offering a rapid solution to your email file conversion needs.\r\n\r\nIt includes options for adding **email headers**, adjusting **page orientation** and **size**, setting **margins**, and compressing\r\nfiles. The API also supports converting **email attachments** and **merging** them with email bodies, creating **PDF** and **PDF/A**\r\ncompliant documents. \r\n\r\nThis API is useful for businesses needing to archive emails in a standardized and accessible\r\nformat, and for legal firms requiring documented email evidence in a secure, non-editable format.",
      "x-ca-meta-title": "EML to PDF API: Convert EML emails to PDF with Options",
      "x-ca-meta-description": "Convert EML emails to PDF using EML to PDF API. Customize orientation, size, margins, and more. Optimal for archiving and sharing emails.",
      "x-ca-keywords": "",
      "x-ca-source-formats": "eml,msg",
      "x-ca-destination-formats": "pdf",
      "x-ca-tags": [
        "email",
        "pdf"
      ]
    }
  },
  "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": "http",
        "description": "[Get `Secret`](https://www.convertapi.com/a/secret)",
        "scheme": "bearer"
      },
      "token": {
        "type": "http",
        "description": "[Get `Token`](https://www.convertapi.com/a/api-tokens)",
        "scheme": "bearer"
      },
      "jwt": {
        "type": "http",
        "description": "[Get `JWT`](https://www.convertapi.com/a/jwt-tokens)",
        "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"
  }
}