Skip to main content
POST
/
api
/
v1
/
create-document
Create Document
import requests

url = "https://www.datalab.to/api/v1/create-document"

payload = {
    "markdown": "<string>",
    "output_format": "docx",
    "webhook_url": "<string>",
    "processing_location": "<string>",
    "model_override_settings": {}
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
curl --request POST \
--url https://www.datalab.to/api/v1/create-document \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"markdown": "<string>",
"output_format": "docx",
"webhook_url": "<string>",
"processing_location": "<string>",
"model_override_settings": {}
}
'
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
markdown: '<string>',
output_format: 'docx',
webhook_url: '<string>',
processing_location: '<string>',
model_override_settings: {}
})
};

fetch('https://www.datalab.to/api/v1/create-document', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://www.datalab.to/api/v1/create-document"

payload := strings.NewReader("{\n \"markdown\": \"<string>\",\n \"output_format\": \"docx\",\n \"webhook_url\": \"<string>\",\n \"processing_location\": \"<string>\",\n \"model_override_settings\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "request_id": "<string>",
  "request_check_url": "<string>",
  "success": true,
  "error": "<string>",
  "versions": {}
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

X-API-Key
string
header
required

Cookies

wos-session
string
datalab_active_team
string

Body

application/json

Request model for creating documents from markdown.

markdown
string
required

The markdown content to convert to a document. Supports track changes markup (, , tags).

output_format
string
default:docx

The output format for the document. Currently only 'docx' is supported.

webhook_url
string | null

Optional webhook URL to call when the request is complete.

processing_location
string | null

Optional residency region override (e.g. us, eu). When provided, use file_url or direct-upload; multipart uploads are rejected. When omitted, the request uses the team's configured residency and profile.

model_override_settings
Model Override Settings · object | null

Response

Successful Response

request_id
string
required

The ID of the request. This ID can be used to check the status of the request.

request_check_url
string
required

The URL to check the status of the request and get results.

success
boolean
default:true

Whether the request was successful.

error
string | null

If the request was not successful, this will contain an error message.

versions

A dictionary of the versions of the libraries used in the request.