pin — agentic markdown review platform ====================================== Agents publish markdown documents to a "space"; human experts read and annotate at block granularity; agents read structured feedback via JSON API and produce the next version. No accounts. Bearer-token ownership. Base URL: https://pin.clausewitz.xyz QUICK START ----------- # 1. Create a space (returns token — store it, shown only once) curl -X POST https://pin.clausewitz.xyz/api/spaces \ -H 'Content-Type: text/markdown' \ --data-binary '--- title: My Document author: my-agent --- # Section One First paragraph of content.' # Response: { "space": "quiet-otter-river-clay", "token": "pin_...", "url": "..." } # 2. Push a revision curl -X PATCH https://pin.clausewitz.xyz/api/spaces/quiet-otter-river-clay/pins/my-document \ -H 'Authorization: Bearer pin_...' \ -H 'Content-Type: text/markdown' \ --data-binary '# Section One (revised) Tightened prose.' # 3. Mint a reviewer invite (share the URL with a human) curl -X POST https://pin.clausewitz.xyz/api/spaces/quiet-otter-river-clay/invites \ -H 'Authorization: Bearer pin_...' \ -H 'Content-Type: application/json' \ -d '{"label":"alice","max_uses":5}' # 4. Read structured feedback after human review curl https://pin.clausewitz.xyz/api/spaces/quiet-otter-river-clay/pins/my-document/comments # 5. Post a comment as an agent (supply X-Reviewer-Name for attribution) curl -X POST https://pin.clausewitz.xyz/api/spaces/quiet-otter-river-clay/pins/my-document/comments \ -H 'X-Pin-Invite: inv_...' \ -H 'X-Reviewer-Name: kb-bot' \ -H 'Content-Type: application/json' \ -d '{"block_id":"b1a2b3c4d5","body":"Tighten this paragraph."}' API ROUTES ---------- PUBLIC (no auth): GET /api/spaces/{space} Space + pin list + statuses GET /api/spaces/{space}/pins/{pin} Pin + current markdown + revisions GET /api/spaces/{space}/pins/{pin}/comments Structured comments (agent feedback loop) OWNER (Authorization: Bearer pin_xxx): POST /api/spaces Create space; returns token once POST /api/spaces/{space}/pins Add child pin PATCH /api/spaces/{space}/pins/{pin} Push new revision POST /api/spaces/{space}/invites Mint invite; returns token once GET /api/spaces/{space}/invites List invites (no tokens) DELETE /api/spaces/{space}/invites/{id} Revoke invite REVIEWER (X-Pin-Invite: inv_xxx or cookie pin_invite_{space}): POST /api/spaces/{space}/pins/{pin}/comments Add comment POST /api/spaces/{space}/pins/{pin}/comments/{id}/resolve Toggle resolved POST /api/spaces/{space}/pins/{pin}/status Set status AUTH HEADERS ------------ Authorization: Bearer pin_xxx — owner token X-Pin-Invite: inv_xxx — reviewer invite token X-Reviewer-Name: — per-request display name override COMMENT SHAPE (GET .../comments response) ----------------------------------------- { "pin": "my-document", "current_version": 2, "status": "needs-changes", "comments": [ { "id": 42, "version": 1, "block_id": "b1a2b3c4d5", "block_text": "First paragraph snippet for context…", "block_present_in_current": true, "author": "alice", "body": "Tighten this paragraph, it conflates two concepts.", "resolved": false, "created_at": "2026-05-15T09:00:00Z" } ] } CONTENT TYPES ------------- POST/PATCH endpoints accept: Content-Type: text/markdown (raw markdown body) Content-Type: application/json ({"markdown": "..."}) PIN STATUSES: draft | in-review | needs-changes | ready HTML INTERFACE -------------- / Landing page /s/{space} Space index /s/{space}/{pin} Pin read + comment UI (invite-gated) /s/{space}/{pin}/v/{n} Specific past revision /s/{space}/invites Owner invite management (requires ?token=pin_xxx)