New Orchly MCP & API are live. Build custom workflows with your SEO & AI visibility data.
POST /documents

Create document

Create a markdown document. Requires `content:write`.

Authenticate with Authorization: Bearer obk_live_xxx. See authentication.

Parameters

NameInTypeRequiredDescription
X-Workspace-Id header string required The workspace to scope the request to. Can also be passed as a `workspace_id` query parameter.

Request body

Send as JSON in the request body.

FieldTypeRequiredDescription
title string required
content_markdown string optional
meta_title string optional
meta_description string optional
slug string optional
task_id string optional

Responses

200 Created
FieldTypeDescription
document Document
422 Invalid request parameters

Example request

curl --request POST \
  --url https://app.orchly.ai/api/v1/documents \
  --header 'Authorization: Bearer obk_live_xxx' \
  --header 'X-Workspace-Id: ws_xxx' \
  --header 'Content-Type: application/json' \
  --data '{ "title": "..." }'
const res = await fetch(`https://app.orchly.ai/api/v1/documents`, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer obk_live_xxx',
    'X-Workspace-Id': 'ws_xxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"title":"..."}),
});
const data = await res.json();
import requests

resp = requests.post(
    "https://app.orchly.ai/api/v1/documents",
    headers={
        "Authorization": "Bearer obk_live_xxx",
        "X-Workspace-Id": "ws_xxx",
    },
    json={"title":"..."},
)
data = resp.json()

Example response

A 200 response. Dynamic fields are shown as their type.

{
  "document": {
    "id": "string",
    "title": "string",
    "status": "string",
    "slug": "string",
    "meta_title": "string",
    "meta_description": "string",
    "word_count": 0,
    "task_id": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}