Agent docs

Agent Publishing API

Anonymous publish endpoint plus read paths for shared Markdown files.

Raw Markdown Viewer Changelog

Endpoint

POST /api/public/publish

Request body

cURL

curl -X POST https://mdview.io/api/public/publish \
  -H 'Content-Type: application/json' \
  --data '{
    "title": "Daily agent brief",
    "content": "# Summary\n\n- Ship the feature\n- Share the result",
    "expiresInDays": 7
  }'

JavaScript

const response = await fetch("https://mdview.io/api/public/publish", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    title: "CI release report",
    markdown: "# Release\n\n- Version: v1.2.3\n- Status: green"
  })
});

const data = await response.json();
console.log(data.shareUrl);

Response

{
  "documentId": "c9e5c027db978262",
  "shortId": "p343cf7b0",
  "title": "Daily agent brief",
  "viewerUrl": "https://mdview.io/s/p343cf7b0",
  "shareUrl": "https://mdview.io/s/p343cf7b0",
  "markdownUrl": "https://mdview.io/s/p343cf7b0.md",
  "expiresAt": "2026-04-04T12:10:00.442Z",
  "contentSize": 32
}

Read a shared Markdown file as .md

GET /s/:shortId.md

Use this when the agent wants the shared document as raw Markdown text.

curl https://mdview.io/s/p343cf7b0.md

Read a shared Markdown file as JSON

GET /api/shares/:shortId

Use this when the agent needs the Markdown content itself.

curl https://mdview.io/api/shares/p343cf7b0
{
  "title": "Daily agent brief",
  "content": "# Summary\n\n- Ship the feature\n- Share the result"
}

Show the rendered shared file

GET /s/:shortId

Use this when the agent wants the human-readable rendered HTML page.

open https://mdview.io/s/p343cf7b0

Good fits

Current limits

Notes