Import A Page
POST
/imports/markdown
const url = 'https://markdawn.space/api/v1/imports/markdown';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://markdawn.space/api/v1/imports/markdown \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@fileAccepts one .md file and creates a page at the Markdawn root. Local image references that cannot be uploaded are returned as warnings.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
required
string format: binary
Responses
Section titled “Responses”The imported page and any local-image warnings.
Media typeapplication/json
object
page
required
object
id
required
string format: uuid
title
required
string
warnings
required
Array<object>
object
code
required
string
count
required
integer
message
required
string
Example
{ "warnings": [ { "code": "LOCAL_IMAGES_NOT_IMPORTED" } ]}The API token is missing a required scope: pages:write.
Media typeapplication/json
Structured error returned when the request cannot be completed.
object
error
required
Error details for programmatic handling.
object
code
required
Stable error code.
string
message
required
Human-readable explanation.
string
Examplegenerated
{ "error": { "code": "example", "message": "example" }}