Documentation

API URL


POST /api/v1/document-convert/convert (POST), /formats (GET)

Headers
Code
Content-Type: application/json
Body Parameters


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 OK
Body
Code
{
  "success": true,
  "sourceFormat": "html",
  "targetFormat": "docx",
  "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "filename": "note.docx",
  "fileBase64": "UEsDBBQAAAAI...",
  "engine": "html-to-docx"
}

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 out

Last Updated:  May 4, 2026