Documentation / API overview
Embed
Add a React-compatible document editor or 2D vector canvas to your application.
An editor type for your application
An editing workspace in your own interface
Editor types
| Editor | Purpose |
|---|---|
| DOCX | Edit Word documents. |
| Edit PDF documents. | |
| PPTX | Edit PowerPoint presentations. |
| 2D vector canvas | Edit vector content such as text, shapes, and images. |
React integration
Each editor is React-compatible and runs inside your application’s interface. Embed provides a workspace for users to make changes interactively, alongside the document operations your application performs through the other APIs.
Request and response
Proposed API contract
Create an editor session on your backend, then pass the returned
embed_url to your React application. Your API key stays
on the server; the browser receives only the scoped session URL.
curl https://api.moda.app/v1/documents/embed/sessions \
-H "Authorization: Bearer $MODA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"editor": "docx",
"file_ref": "file_report_docx",
"allowed_origins": [
"https://app.example.com"
],
"mode": "edit"
}'
{
"id": "emb_example",
"editor": "docx",
"embed_url": "https://transform.moda.app/embed/emb_example?token=SESSION_TOKEN",
"expires_at": "2026-09-08T17:00:00Z"
}
Render in React
export function DocumentEditor({ embedUrl }) {
return (
<iframe
title="Document editor"
src={embedUrl}
style={{ width: "100%", height: 720, border: 0 }}
/>
);
}
Use the URL returned by your backend as embedUrl. Do
not embed your API key in client-side code or construct the session
token yourself.
Fields
editor- Editor type: docx, pdf, pptx, or canvas.
file_ref- The document or canvas resource to open.
allowed_origins- Application origins allowed to host the editor.
mode- Use edit for an editable session.
embed_url- A session URL for the embedded editor. Treat its token as a credential.
expires_at- Session expiration. Create a new session when the previous one expires.
Example workflow
- Choose a PPTX editor for your application.
- Embed it in the page where users work with presentations.
- Let users edit the presentation within that workspace.
Related APIs
Convert changes a document’s format or recovers editable layers. Generate creates a document from structured input. Embed supplies the interactive editing interface.