Document API
The Document API allows you to manage all your Markdown documents programmatically, without having to log in to your Super Markdown space via the web interface.
This API exposes a set of essential operations for manipulating your documents remotely:
| Operation |
Description |
| Create |
Add a new document to the location of your choice
|
| Edit & Update |
Update the properties of an existing document
|
| Archive |
Move the document to the Recycle Bin with the option to restore it if needed
|
| Delete |
Remove a document (with or without its contents, depending on settings)
|
| Get Document |
Retrieve data about a specific document
|
The main objective of this API is to offer developers complete automation of the lifecycle of their Markdown documents, from creation to publication, without manual intervention on the platform.
Examples of use cases
Here are some concrete examples of automation made possible by these APIs:
-
Automatic documentation generation: From code comments, GitHub issues, or configuration files, the API continuously creates and updates technical documentation.
-
Periodic reports: A script extracts data from a database, generates a structured Markdown report, and publishes it via the API nightly.
-
AI-generated content: A language model produces raw Markdown; the API transforms and enriches it with Super Markdown components.
-
Cross-platform synchronization: Your documents are kept up-to-date simultaneously across multiple systems via automated API calls.
-
There are countless use cases for you to leverage our APIs in your workflow.
Create New Document
Here is a concrete example of an API call to create a new document:
curl -X POST "https://api.super-markdown.com/api/space/app/save-document/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"title": "Document API",
"description": "Description of Document API Documentation",
"type" : "publication",
"mode": "light-mode",
"parent" : "{UID_FOLDER_PARENT}",
"convert" : true,
"data": "# title of section\n\ncontent of section\n\n## sub-section title\n\ncontent of sub-section\n\n### sub-sub-section title\n\ncontent of sub-sub-section"
}'
The option (convert = true) means that the system will convert standard markdown to Super Markdown before creating the necessary UI before storing the document.
Expected response:
If successful, the API returns a JSON response structured as follows:
{
"status": "success",
"code": 200,
"message": "Success!",
"data": {
"uid": "UID_OF_DOCUMENT_CREATED",
"message": "ok"
}
}
Each transaction is recorded as an activity that you can retrieve for auditing if needed.
Create New Document with Super Markdown Syntax
Here is a concrete example of an API call to create a new document with Super Markdown syntax :
curl -X POST "https://api.super-markdown.com/api/space/app/save-document/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"title": "Super Markdown Document API",
"description": "Description of Super Markdown Document API Documentation",
"type" : "article",
"mode": "dark-mode",
"parent" : "{UID_FOLDER_PARENT}",
"convert" : false,
"data": ":: title{id="" box_type="container-view" version="mode-classic" theme="orange-theme" font="sans-serif-font-heading" align="left-align" title="Title of document"} :: title\n\n: content{id="" theme="orange-theme" mode="mode-simple" font="sans-serif-font-heading" align="align-left" box_type="container-view"}\n# title of section\n\nLorem ipsum dolor sit amet.\n\n:: content"
}'
Edit & Update existing Document
curl -X POST "https://api.super-markdown.com/api/space/app/edit-document/{UID_DOCUMENT}/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"title": "Super Markdown Document API Update",
"description": "Description of Super Markdown Document API Documentation Update",
"type" : "page",
"mode": "dark-mode",
"parent" : "{UID_FOLDER_PARENT}",
"convert" : false,
"data": ":: title{id="" box_type="container-view" version="mode-classic" theme="orange-theme" font="sans-serif-font-heading" align="left-align" title="Title of document updated"} :: title\n\n: content{id="" theme="orange-theme" mode="mode-simple" font="sans-serif-font-heading" align="align-left" box_type="container-view"}\n# title of section\n\nLorem ipsum dolor sit amet.\n\n:: content"
}'
Get The Data of a specific Document
curl -X GET "https://api.super-markdown.com/api/space/app/get-document/{UID_DOCUMENT}/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json"
The data in the obtained file contains the parent folder informations and the target document data; take this information into consideration when processing them.
Archive existing Document
curl -X GET "https://api.super-markdown.com/api/space/app/archive-element/document/{UID_FOLDER}/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json"
Restores archived Document
curl -X GET "https://api.super-markdown.com/api/space/app/restaure-element/document/{UID_FOLDER}/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json"
Delete permanently existing Document
curl -X GET "https://api.super-markdown.com/api/space/app/delete-element/document/{UID_FOLDER}/" \
-H "app_auth: YOUR_KEY_HERE" \
-H "Content-Type: application/json"
Please take into consideration the handling of errors that occur at the validation level, non-compliant data sent, data not found or other.
What's Next ?
Need help ? Our team is here to support you. Contact us or check our FAQ.