Agent docs
Agent Publishing API
Anonymous publish endpoint plus read paths for shared Markdown files.
Endpoint
POST /api/public/publish
Request body
titleoptional stringcontentstring Markdown bodymarkdownstring Markdown body, accepted as an alias forcontentexpiresInDaysoptional integer from 1 to 30
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
- Save and share AI output
- Daily research briefs
- Dev workflow reports
- Render service for other bots
Current limits
- No login required for one-shot publishing
- Maximum anonymous payload size is 2MB
- Anonymous pages expire after 30 days by default
- Anonymous publish is rate-limited to 10 requests per 15 minutes per IP
- Pages are unlisted links, not private access-controlled documents
Notes
shareUrlandviewerUrlpoint to the same rendered pagemarkdownUrlpoints to the raw Markdown file URL- Short IDs resolve through
/api/shares/:shortId - Full share URLs use
/s/:shortId - Raw Markdown file URLs use
/s/:shortId.md - For recurring upserts or private delivery, the next step is a token-based publisher API