Export documents and Spaces
Download a page as Markdown or PDF, or a whole Space as a single PDF. These routes use numeric Space and menu-item IDs.
{
"title": "Export a document as Markdown",
"description": "",
"method": "POST",
"baseUrl": "https://app.docuwriter.ai",
"endpoint": "/api/spaces/{space}/menu-items/{spaceMenuItem}/export/markdown",
"headers": [
{
"key": "Authorization",
"value": "Bearer YOUR_API_TOKEN",
"type": "string",
"required": true
},
{
"key": "Accept",
"value": "application/json",
"type": "string",
"required": true
}
],
"queryParams": [],
"pathParams": [
{
"key": "space",
"value": "Numeric Space ID.",
"type": "integer",
"required": true
},
{
"key": "spaceMenuItem",
"value": "Numeric document/menu-item ID belonging to the Space.",
"type": "integer",
"required": true
}
],
"bodyType": "none",
"requestBody": "",
"formData": [],
"rawBody": "",
"responses": {
"200": {
"description": "Markdown file attachment, not a JSON data envelope.",
"body": ""
},
"401": {
"description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
"body": "{\n \"message\": \"Unauthenticated.\"\n}"
}
}
}
{
"title": "Export a document as PDF",
"description": "",
"method": "POST",
"baseUrl": "https://app.docuwriter.ai",
"endpoint": "/api/spaces/{space}/menu-items/{spaceMenuItem}/export/pdf",
"headers": [
{
"key": "Authorization",
"value": "Bearer YOUR_API_TOKEN",
"type": "string",
"required": true
},
{
"key": "Accept",
"value": "application/json",
"type": "string",
"required": true
}
],
"queryParams": [],
"pathParams": [
{
"key": "space",
"value": "Numeric Space ID.",
"type": "integer",
"required": true
},
{
"key": "spaceMenuItem",
"value": "Numeric document/menu-item ID belonging to the Space.",
"type": "integer",
"required": true
}
],
"bodyType": "none",
"requestBody": "",
"formData": [],
"rawBody": "",
"responses": {
"200": {
"description": "PDF file attachment, not a JSON data envelope.",
"body": ""
},
"401": {
"description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
"body": "{\n \"message\": \"Unauthenticated.\"\n}"
}
}
}
{
"title": "Export a Space as PDF",
"description": "",
"method": "POST",
"baseUrl": "https://app.docuwriter.ai",
"endpoint": "/api/spaces/{space}/export/pdf",
"headers": [
{
"key": "Authorization",
"value": "Bearer YOUR_API_TOKEN",
"type": "string",
"required": true
},
{
"key": "Accept",
"value": "application/json",
"type": "string",
"required": true
}
],
"queryParams": [],
"pathParams": [
{
"key": "space",
"value": "Numeric Space ID.",
"type": "integer",
"required": true
}
],
"bodyType": "none",
"requestBody": "",
"formData": [],
"rawBody": "",
"responses": {
"200": {
"description": "Whole-Space PDF attachment, not a JSON data envelope.",
"body": ""
},
"401": {
"description": "Missing or invalid account API token.Missing or invalid account API token. Example JSON response.",
"body": "{\n \"message\": \"Unauthenticated.\"\n}"
}
}
}
- No JSON body is required.
- For example:
Permissions and results
- The account must be able to view the Space.
- A document must belong to the specified Space.
- Repository-documentation export may require an active subscription: a 403 JSON response can include
subscription_required: trueandupgrade_url. - A successful response is a download, not a
dataenvelope. - Inspect status and Content-Type before treating bytes as a finished file.
- Markdown is produced from the current document content.
- PDF generation can fail separately from reading a document and may return 500.
- Use Read a document if your integration needs JSON containing the Markdown rather than an attachment.
- Do not use these paths as permanent unauthenticated download links.
Updated