PDF to Word

Convert PDF documents to editable Microsoft Word (.docx) format.

POSThttps://api.morphopdf.com/v1/convert/pdf-to-word

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the PDF file using one of the following methods.

fileFile

PDF file uploaded via multipart/form-data.

urlstringOptional

Public URL pointing to a PDF file. Alternative to file upload.

Query Parameters

formatstringOptionalDefault: json

Response format. Use 'binary' to receive the Word document directly, or 'json' (default) to receive metadata with a download URL.

URL Requirements

URLs must be publicly accessible, use http:// or https://, max 50MB per file, 30s timeout. Private IPs (localhost, 192.168.x.x, 10.x.x.x) are blocked for security.

Response

When using format=json (default):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the generated Word document.

downloadUrlstring

Presigned URL to download the file. Valid for 1 hour.

pageCountnumber

Number of pages in the original PDF.

methodstring

Conversion method used ('cli' for high-quality, 'fallback' for basic).

Binary Response

Add ?format=binary to receive the Word document directly with these headers:

  • Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • Content-Disposition: attachment; filename="document.docx"

Error Responses

StatusCodeDescription
400INVALID_INPUTNo file provided or invalid file format
400PASSWORD_PROTECTEDPDF is password-protected. Unlock it first.
401AUTHENTICATION_REQUIREDMissing or invalid API key
413FILE_TOO_LARGEFile exceeds maximum size limit
500PROCESSING_FAILEDInternal processing error
POST/v1/convert/pdf-to-word
curl -X POST "https://api.morphopdf.com/v1/convert/pdf-to-word?format=binary" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  --output document.docx
200OK
{
  "success": true,
  "message": "File processed successfully",
  "fileName": "document.docx",
  "downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/document.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
  "pageCount": 10,
  "method": "cli"
}