Skip to main content

POST /api/v1/publish

Publish a Markdown file and receive a stable URL.

Auth

API key or session auth.

Request body

{
"markdown": "# Launch note\n\nShip it.",
"title": "Launch note",
"slug": "launch-note",
"visibility": "workspace",
"workspaceId": "ws_123",
"tags": ["launch", "release"],
"sourcePath": "launch-note.md",
"confirmPublic": false
}

Fields

FieldTypeRequiredNotes
markdownstringYesThe raw Markdown content
titlestringNoOverrides inferred title
slugstringNoPreferred URL slug
visibilitystringYesUse private, workspace, or public in the normal external workflow
workspaceIdstringYesMust belong to the authenticated user
tagsstring[]NoUp to 20 tags
sourcePathstringNoHelpful source metadata
confirmPublicbooleanNoMust be true when visibility is public

Example request

curl https://api.opendocs.cc/api/v1/publish \
-X POST \
-H "Authorization: Bearer od_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"markdown": "# Checkout API reference\n\nEndpoint summary.",
"visibility": "workspace",
"workspaceId": "ws_123",
"tags": ["api", "checkout"]
}'

Success response

{
"postId": "post_123",
"slug": "checkout-api-reference",
"url": "/yourteam/checkout-api-reference",
"title": "Checkout API reference",
"tags": ["api", "checkout"]
}

Public publishing

This fails:

{
"visibility": "public",
"confirmPublic": false
}

Use:

{
"visibility": "public",
"confirmPublic": true
}

Errors

Common application-level failures are returned as:

{
"error": "publish_failed",
"message": "Workspace not found."
}