API
JSON envelope (CURRENT): { success, code, message, data, errors, meta }.
Host: https://pastes.reversal.org/api/v1/
Human copy-paste docs: https://pastes.reversal.org/docs/
CURRENT endpoints
| Method | Path | Auth | Behavior |
|---|---|---|---|
| GET | /pastes/ | pvsk_ | Your pastes only (no body). 401 without a key. Query q, limit, page, visibility, source, mine_key, label |
| GET | /pastes/{id}/ | none; private needs access_key or owner key | Full content |
| POST | /pastes/ | pvsk_ or session | Create. Key default unlisted. external_id idempotent per key |
| GET | /notes/ | pvsk_ | This key's notes. ?id= returns full body |
| POST | /notes/ | pvsk_ | Create unlisted note |
| GET | /docs/ | none | Machine catalog of these endpoints |
| GET | /labels/ | none; pvsk_ for ?slug= | Popular label names. ?slug= lists your pastes for that label |
| GET | /keys/ | session + CSRF on write | List prefixes |
| POST | /keys/ | session + CSRF | Mint pvsk_, shown once |
| PATCH | /keys/ | session + CSRF | Revoke |
Headers: X-Api-Key: pvsk_... or Authorization: Bearer pvsk_....
View page (CURRENT): category=mermaid or wireframe (or Markdown fences) renders Preview on /p/{id}/. API GET still returns raw content.
Command (different host): POST https://projectcommand.reversal.org/api/v1/pastes/ with cpcl_ (action=note) or staff session (action=bind|unbind).
PLANNED experiment endpoints
These do not exist yet. Proposed contract:
| Method | Path | Purpose |
|---|---|---|
| POST | /pastes/{id}/versions | Immutable revision |
| GET | /pastes/{id}/versions | Version list |
| POST | /experiments | Open an experiment |
| POST | /experiments/{id}/runs | Attach a run |
| POST | /runs/{id}/evaluations | Machine or human eval |
| POST | /runs/{id}/assets | Screenshot / sidecar |
| POST | /runs/{id}/ratings | Thumbs / 1-10 / A-B |
| GET | /experiments/{id}/leaderboard | Ranked candidates |
| POST | /experiments/{id}/promote | Mark winner / deployment |
| GET | /models/performance | Aggregates |
| GET | /models/recommend | Router hint |
| GET | /projects/{id}/best-configurations | Frozen winners |
REST first. Webhooks (HMAC) and SDKs are Phase 8.
Last updated: Sep 9, 2026
Design rules
- Idempotency keys on create (CURRENT
external_idon notes; extend to runs). - Never return raw
pvsk_after mint. - Version POST is append-only.
- Promote is an explicit write with audit (PLANNED).
GET /pastes/requirespvsk_and lists the key owner's pastes only. Do not add an anonymous catalog dump. Keep unlisted notes off the human Browse grid.
