Documentation / API overview
Convert
Convert a document into another format or an editable representation.
One document + target representation
A converted file or editable layers
Conversions
| Input | Output | Use case |
|---|---|---|
| PPTX | Recover an editable PowerPoint presentation. | |
| DOCX | Recover an editable Word document. | |
| HTML | PPTX or DOCX | Produce editable documents from HTML content. |
| PNG or other raster document | Editable layers | Separate flattened content into editable elements. |
Layerize
Layerize is part of Convert. It reconstructs editable elements from a flattened image, including text, images, and shapes. Use it when the source is a screenshot or raster document rather than an editable file.
Request and response
Proposed API contract
This request converts an uploaded PDF into an editable PPTX. Use
to: "docx" for Word output. For layerization, set
to: "layers"; the result contains editable elements
instead of a document download.
curl https://api.moda.app/v1/documents/convert \
-H "Authorization: Bearer $MODA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_ref": "file_report_pdf",
"to": "pptx"
}'
The request starts a job. Poll the returned
poll_url until the status is completed or
failed. See
the shared job lifecycle.
{
"id": "job_convert_example",
"status": "completed",
"result": {
"file": {
"url": "https://files.example.com/report.pptx",
"format": "pptx"
},
"warnings": []
}
}
Fields
file_ref- The reference returned when the source file is uploaded.
to- Target representation: pptx, docx, or layers for the conversions described here.
result.file- Download URL and format for a file conversion.
result.layers- Editable text, image, and shape elements for a layerization request.
result.warnings- Conversion issues the caller should review.
Example workflow
- Start with a presentation saved as a PDF.
- Choose PPTX as the output format.
- Use the converted presentation to edit its content in PowerPoint.
Related APIs
Use Generate to create a file from a JSON or XML document description. Use Parse if you need the document’s data rather than another file format.