Description

This endpoint converts various document formats to PDF. It supports a wide range of input formats including office documents, images, and web formats.

Endpoint

POST /api/v1/convert-to-pdf

Headers

  • Content-Type: application/json
  • Authorization: Bearer <API_KEY> (required)

Request Body

{
  "inputMethod": "string", // Required. Either "url" or "base64"
  "file": "string" // Required. URL or base64-encoded file content
}

Responses

Success (200)

Returns the URL of the converted PDF.

{
  "url": "string" // URL to the converted PDF file
}
  • X-RateLimit-Limit: The rate limit for the user
  • X-RateLimit-Remaining: The remaining number of requests for the user

Bad Request (400)

Returned if the request is invalid or the file format is unsupported.

{
  "error": "Error message describing the issue"
}

Internal Server Error (500)

Returned if there’s an error during the conversion process.

{
  "error": "Failed to convert to PDF: [error details]"
}

Example Request

curl -X POST https://app.dumplingai.com/api/v1/convert-to-pdf \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
  "inputMethod": "url",
  "file": "https://example.com/document.docx"
}'

Notes

  • Credit usage: 5 credits per 100MB of output PDF size
  • The converted PDF is temporarily stored (24-hour retention)
  • You can get a list of supported formats by calling:
GET /api/v1/convert-to-pdf

Supported Formats

“.123”, “.602”, “.abw”, “.bib”, “.bmp”, “.cdr”, “.cgm”, “.cmx”, “.csv”, “.cwk”, “.dbf”, “.dif”, “.doc”, “.docm”, “.docx”, “.dot”, “.dotm”, “.dotx”, “.dxf”, “.emf”, “.eps”, “.epub”, “.fodg”, “.fodp”, “.fods”, “.fodt”, “.fopd”, “.gif”, “.htm”, “.html”, “.hwp”, “.jpeg”, “.jpg”, “.key”, “.ltx”, “.lwp”, “.mcw”, “.met”, “.mml”, “.mw”, “.numbers”, “.odd”, “.odg”, “.odm”, “.odp”, “.ods”, “.odt”, “.otg”, “.oth”, “.otp”, “.ots”, “.ott”, “.pages”, “.pbm”, “.pcd”, “.pct”, “.pcx”, “.pdb”, “.pgm”, “.png”, “.pot”, “.potm”, “.potx”, “.ppm”, “.pps”, “.ppt”, “.pptm”, “.pptx”, “.psd”, “.psw”, “.pub”, “.pwp”, “.pxl”, “.ras”, “.rtf”, “.sda”, “.sdc”, “.sdd”, “.sdp”, “.sdw”, “.sgl”, “.slk”, “.smf”, “.stc”, “.std”, “.sti”, “.stw”, “.svg”, “.svm”, “.swf”, “.sxc”, “.sxd”, “.sxg”, “.sxi”, “.sxm”, “.sxw”, “.tga”, “.tif”, “.tiff”, “.txt”, “.uof”, “.uop”, “.uos”, “.uot”, “.vdx”, “.vor”, “.vsd”, “.vsdm”, “.vsdx”, “.webp”, “.wb2”, “.wk1”, “.wks”, “.wmf”, “.wpd”, “.wpg”, “.wps”, “.xbm”, “.xhtml”, “.xls”, “.xlsb”, “.xlsm”, “.xlsx”, “.xlt”, “.xltm”, “.xltx”, “.xlw”, “.xml”, “.xpm”, “.zabw”,

Rate Limiting

Rate limit headers (X-RateLimit-Limit and X-RateLimit-Remaining) are included in the response.