API
Publish HTML as a link — from your code
One POST turns an HTML document into a hosted link that opens in one tap, previews as a card in WhatsApp, Slack and email, and exports to PNG, PDF or Word. A plain REST API with a Bearer key — no SDK, no browser to run. It's the same engine behind the website and the MCP server.
Quickstart
1. Get an API key
Generate one below. It is shown once — store it as a server-side secret and never ship it to a browser.
Your API key
No signup. The key is tied to this browser — keep it somewhere safe.
Then run this once:
claude mcp add --transport http sendpage https://sendpageapp.com/api/v1 \ --header "Authorization: Bearer YOUR_KEY"
2. Publish a document
curl -X POST https://sendpageapp.com/api/v1/documents \
-H "Authorization: Bearer sp_live_..." \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Q3 Proposal</h1><p>Hello!</p>","title":"Q3 Proposal"}'3. Get back a link
{
"id": "ab12cd34",
"url": "https://sendpageapp.com/d/ab12cd34",
"edit_token": "…",
"is_pro": false
}Send that url to anyone. Keep the edit_token secret — it authorizes updates.
Authentication
Every request needs Authorization: Bearer <key>. Keys look like sp_live_…, are stored only as a hash, and can be revoked at any time. A missing or invalid key returns 401.
Endpoints
Base URL: https://sendpageapp.com/api/v1
- POST /documents — publish HTML. Body { html, title?, sender_name? } → returns { id, url, edit_token, is_pro }.
- GET /documents — list the documents created with your key.
- GET /documents/{id} — metadata; add ?include=html for the source.
- PATCH /documents/{id} — update html and/or title. The link never changes.
- POST /documents/{id}/export — body { format: "png" | "pdf" | "docx" } → a file URL. PNG/PDF free, Word is Pro.
- GET /documents/{id}/comments — reader feedback left on the document.
Full machine-readable schema: OpenAPI 3.1 spec.
Export to PDF / PNG / Word
curl -X POST https://sendpageapp.com/api/v1/documents/ab12cd34/export \
-H "Authorization: Bearer sp_live_..." \
-H "Content-Type: application/json" \
-d '{"format":"pdf"}'
# → { "id": "ab12cd34", "format": "pdf", "url": "…/export?format=pdf" }
# then GET that url to download the fileIn your language
JavaScript (fetch)
const res = await fetch("https://sendpageapp.com/api/v1/documents", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SENDPAGE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ html: "<h1>Hello</h1>", title: "Hello" }),
});
const { url } = await res.json();Python (requests)
import os, requests
r = requests.post(
"https://sendpageapp.com/api/v1/documents",
headers={"Authorization": f"Bearer {os.environ['SENDPAGE_API_KEY']}"},
json={"html": "<h1>Hello</h1>", "title": "Hello"},
)
print(r.json()["url"])Errors
Errors return { "error": { "code", "message" } }:
- 401 unauthorized — missing/invalid key.
- 402 pro_required — Word export needs Pro.
- 404 not_found — no such document, or not yours.
- 413 too_large — over the 2 MB per-document limit.
- 422 invalid_request — bad or missing fields.
- 429 quota_exceeded / rate_limited — free monthly cap or burst limit.
Limits
- 3 documents a monthon the free tier, each with a small “Made with SendPage” footer. Pro removes the footer and the limit and unlocks Word export.
- 2 MB per document, including inlined images.
- Links are unlisted, not secret — anyone with the URL can read it. Use password protection for anything confidential.
Prefer no HTTP calls?
If you drive an AI assistant, the same actions are available over MCP — see the MCP docs. The REST API and MCP share one engine, so documents you publish either way behave identically.