{"openapi":"3.0.3","info":{"title":"reweb","description":"The retweet for the web. Public API for reading reweb data.","version":"1.0.0"},"servers":[{"url":"https://reweb.rewildtheweb.org"}],"paths":{"/api/feed/{site_url}":{"get":{"summary":"Get a user's rewebs as JSON","parameters":[{"name":"site_url","in":"path","required":true,"schema":{"type":"string"},"example":"alice.github.io"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"User's rewebs","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"site_url":{"type":"string","description":"The user's domain"},"feed_url":{"type":"string","description":"URL to the RSS feed for this user"},"items":{"type":"array","items":{"$ref":"#/components/schemas/FeedItem"}}}}}}},"404":{"description":"User not found"}}}},"/api/url/info":{"get":{"summary":"Look up who rewebbed a URL","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"},"example":"https://example.com/some-page"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"Reweb info for the URL","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"type":"string","description":"Canonical (normalized) URL"},"count":{"type":"integer","description":"Total number of users who rewebbed this URL"},"rewebbed_by":{"type":"array","items":{"type":"object","properties":{"site_url":{"type":"string","description":"Domain of the user who rewebbed"},"at":{"type":"string","description":"When they rewebbed it (UTC)"}}}}}}}}}}}},"/feed/{site_url}":{"get":{"summary":"Get a user's rewebs as RSS 2.0","description":"Standard RSS 2.0 feed with reweb namespace extensions (xmlns:reweb). See the landing page for namespace docs.","parameters":[{"name":"site_url","in":"path","required":true,"schema":{"type":"string"},"example":"alice.github.io"},{"name":"limit","in":"query","schema":{"type":"integer","default":50,"minimum":1,"maximum":200}}],"responses":{"200":{"description":"RSS 2.0 XML feed","content":{"application/rss+xml":{"schema":{"type":"string"}}}},"404":{"description":"User not found"}}}},"/url":{"get":{"summary":"Lookup page for a URL (HTML)","description":"Human-readable page showing all users who rewebbed a given URL.","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"HTML page","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/auth/register":{"post":{"summary":"Register a site URL","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site_url"],"properties":{"site_url":{"type":"string","example":"yoursite.com"}}}}}},"responses":{"201":{"description":"Registration successful. Returns a verification token.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"site_url":{"type":"string"},"verification_token":{"type":"string"},"instructions":{"type":"string"}}}}}}}}},"/api/auth/verify":{"post":{"summary":"Verify site ownership and receive an API key","description":"Call after placing the verification token on your site.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["site_url"],"properties":{"site_url":{"type":"string","example":"yoursite.com"}}}}}},"responses":{"200":{"description":"Verification successful. Returns an API key (shown once).","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"site_url":{"type":"string"},"api_key":{"type":"string"},"message":{"type":"string"}}}}}}}}},"/api/reweb":{"post":{"summary":"Reweb a URL","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"URL to reweb","example":"https://example.com/great-post"},"title":{"type":"string","description":"Page title (optional)"},"note":{"type":"string","description":"Your note (optional, max 5000 chars)"}}}}}},"responses":{"201":{"description":"Rewebbed successfully"},"409":{"description":"Already rewebbed this URL"}}},"patch":{"summary":"Update the note on an existing reweb","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"},"note":{"type":"string"}}}}}},"responses":{"200":{"description":"Note updated"},"404":{"description":"Reweb not found"}}},"delete":{"summary":"Un-reweb a URL","security":[{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string"}}}}}},"responses":{"200":{"description":"Un-rewebbed"},"404":{"description":"Reweb not found"}}},"get":{"summary":"Get your own reweb for a URL","security":[{"apiKey":[]}],"parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Your reweb data, or rewebbed: false if not rewebbed","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"rewebbed":{"type":"boolean"},"reweb":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"created_at":{"type":"string"}}}}}}}}}}}},"components":{"schemas":{"FeedItem":{"type":"object","properties":{"url":{"type":"string","description":"Canonical URL that was rewebbed"},"title":{"type":"string","nullable":true,"description":"Page title at time of rewebbing"},"note":{"type":"string","nullable":true,"description":"User's comment"},"created_at":{"type":"string","description":"When rewebbed (UTC, YYYY-MM-DD HH:MM:SS)"},"count":{"type":"integer","description":"Total rewebs for this URL across the network"},"page":{"type":"string","description":"Link to the reweb lookup page for this URL"},"rewebbed_by":{"type":"array","description":"Other users who rewebbed this URL (max 5 most recent)","items":{"type":"object","properties":{"site_url":{"type":"string","description":"Domain of the user"}}}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key obtained via /api/auth/verify"}}}}