Authentication
Every write endpoint requires authentication. There are two options:
- API key — create one on your dashboard. Pass it as a
Authorization: Bearer rpg_…header. - Session cookie — if you're making requests from a signed-in browser the cookie is sent automatically.
curl https://www.repage.app/api/documents \
-X POST \
-H "Authorization: Bearer rpg_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello</h1>","title":"My report"}'Base URL
https://www.repage.appAlways use www.repage.app. Requests to the bare domain are 308-redirected and the Authorization header is stripped by the redirect.
Publish a new HTML document. Returns the document ID, shareable URL, and initial version number.
Request body
| Field | Type | Description | |
|---|---|---|---|
html | string | required | The full HTML to publish. Max 10 MB. |
title | string | optional | Human-friendly title used for the URL slug. Max 200 chars. |
password | string | optional | Viewer password. When set, visitors must enter this to view the document. Ignored when private is true. |
private | boolean | optional | If true, only the owner can view the document (no sharing). Overrides password. |
Response 200
{
"id": "abc123",
"url": "https://www.repage.app/d/abc123",
"slug": "my-report-xyz",
"versionNumber": 1
}Fetch the current version's HTML source for a document you own. (Viewers access the rendered page at /d/:id.)
Response 200
{
"html": "<!DOCTYPE html>...",
"currentVersionId": "v_abc",
"visibility": "public"
}Publish new HTML as a new version of an existing document. The URL stays the same; the old version is kept and can be reverted to.
Request body
| Field | Type | Description | |
|---|---|---|---|
html | string | required | The new full HTML. Max 10 MB. |
Response 200
{
"id": "abc123",
"versionNumber": 2
}List the version history of a document. Accessible to anyone who can view the document (not owner-only).
Response 200
{
"currentVersionId": "v_xyz",
"versions": [
{
"id": "v_abc",
"versionNumber": 1,
"byteSize": 4820,
"createdAt": "2025-01-15T10:30:00.000Z"
},
{
"id": "v_xyz",
"versionNumber": 2,
"byteSize": 5100,
"createdAt": "2025-01-16T09:00:00.000Z"
}
]
}Make an existing version the current one. Owner only.
Request body
| Field | Type | Description | |
|---|---|---|---|
versionId | string | required | ID of the version to restore. |
Response 200
{
"id": "abc123",
"currentVersionId": "v_abc"
}Error responses
All errors return JSON with an error string and the appropriate HTTP status:
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key / session. |
| 403 | Authenticated but not the document owner. |
| 404 | Document or version not found. |
| 413 | HTML payload exceeds the 10 MB limit. |
| 429 | Free-tier document limit reached. |
Rate limits
There are no hard rate limits currently, but each free account can publish up to 10 documents in total. Updating existing documents does not count toward this limit.
Prefer MCP?
If you're using Claude, Cursor, or another MCP-compatible AI assistant, the MCP server is easier — you don't write any code, just describe what you want.