Open a prefilled editor with the API
Use POST /editor-sessions to send Markdown and conversion settings. The response contains an edit_url; open it in a new browser tab to review, edit, convert, and compile the document.
1. Create an editor session
POST /editor-sessions
Content-Type: application/json
{
"markdown": "# Launch report\n\nReady to review.",
"title": "Launch report",
"author": "Jane Doe",
"date": "2026-08-30",
"documentId": "RPT-42",
"template": "space-race",
"footerText": "Internal",
"lineNumbersEnabled": false,
"images": [
{
"path": "/general/rocket.png",
"content": "iVBORw0KGgoAAAANSUhEUg..."
}
]
}
2. Read the response
{
"session_id": "2ec6b13f-a7c2-465f-920c-b674884b193b",
"edit_url": "/edit?session_id=2ec6b13f-a7c2-465f-920c-b674884b193b"
}
3. Open the editor
Combine the API host with edit_url, then open it in a new tab. For example, when running locally: http://127.0.0.1:8000/edit?session_id=….
The Markdown is stored server-side for 24 hours. Only the random session ID is included in the URL, avoiding URL-length limits and exposing document content in browser history or logs.
Wiki.js images
Send each image directly in the images array, using the image source path from the Markdown and base64-encoded content. The service packages the supplied images directly, so it does not need a Wiki.js access token to download them.
Browser integration
After receiving the response in browser JavaScript, call window.open(response.edit_url, "_blank") from a user-initiated action. Browsers can block new tabs that are not opened from a click or similar interaction.