API URL
POST /api/v1/document-convert/convert (POST), /formats (GET)
Headers
Code
Content-Type: application/jsonBody Parameters
Param
Type
Description
sourceFormat
required
string
Source format docx xlsx pptx pdf or html
targetFormat
required
string
Target format pdf docx txt or images
fileBase64
required
string
Base64 encoded file contents
fileUrl
required
string
Public HTTP or HTTPS URL to download
filename
optional
string
Original filename used to name the output
Example Request
Code
POST https://datpaq.com/api/v1/document-convert/convert?api_key=your-api-key | Body: {"sourceFormat":"html","targetFormat":"docx","fileBase64":"PGgxPkhlbGxvPC9oMT4=","filename":"note.html"}Successful Response
Status
HTML
200 OKBody
Code
{
"success": true,
"sourceFormat": "html",
"targetFormat": "docx",
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"filename": "note.docx",
"fileBase64": "UEsDBBQAAAAI...",
"engine": "html-to-docx"
}Field
Type
success
boolean
pairs
array
limits
object
libreOfficeAvailable
boolean
sourceFormat
string
targetFormat
string
mimeType
string
filename
string
fileBase64
string
files
array
text
string
pageCount
number
engine
string
meta
object
available
boolean
feature
string
reason
string
details
array
correlationId
string
metadata
object
Error Response
Example
Code
HTTP 400 ValidationError: Missing unknown or invalid body field — Request rejected before conversion; HTTP 400 InvalidJson: Request body is not valid JSON — Body parser rejected the payload; HTTP 400 UnsupportedFormat: File bytes do not match sourceFormat — Magic-byte check failed; HTTP 400 UrlBlocked: fileUrl resolved to a private or blocked host — SSRF guard rejected the URL; HTTP 401 AuthenticationError: Gateway authentication failure — Request rejected due to missing or invalid API credentials; HTTP 404 NotFound: Unknown endpoint path — Request path does not map to available document-convert routes; HTTP 413 PayloadTooLarge: Decoded file over 10 MB or body over 15 MB — Document too large to convert; HTTP 415 UnsupportedMediaType: Source and target pair is not in the matrix — Conversion pair is not implemented; HTTP 422 UnprocessableEntity: Conversion engine failed — File could not be converted; HTTP 429 RateLimitError: More than 20 requests in 15 minutes — Request rejected by service rate limiter; HTTP 500 InternalError: Unexpected conversion handler failure — Shared error middleware returns an internal server error; HTTP 502 UpstreamError: Public fileUrl fetch failed after SSRF checks — Download did not succeed; HTTP 503 ServiceUnavailable: LibreOffice binary is not installed — Office conversion pairs are gated; HTTP 504 GatewayTimeout: Convert or download exceeded the time budget — Operation timed outLast Updated: May 4, 2026