API

All endpoints return JSON unless noted. Rate limits apply per IP.

Create a paste

curl -X POST https://pragalbha.xyz/api/pastes \
  -H 'content-type: application/json' \
  -d '{
    "content": "hello world",
    "title": "My paste",
    "syntax": "text",
    "expiry": 60,
    "exposure": "public"
  }'

Response: { "id": "...", "url": "...", "deleteToken": "..." }. Keep the token — it is the only way to delete the paste.

Endpoints

  • POST /api/pastes Create a paste. JSON body, returns id + deleteToken.
  • GET /api/pastes Paginated public listing (?page, ?syntax, ?category).
  • GET /api/pastes/:id Fetch a paste. 401 if password protected unless ?password= matches.
  • DELETE /api/pastes/:id Delete a paste. Requires the delete token header.
  • POST /api/pastes/:id/fork Copy a paste into a new one, returns the new paste.
  • GET /raw/:id Plain text content, no HTML.
  • GET /download/:id Content as a file download.
  • GET /pastes HTML listing of public pastes.
  • GET /search?q= Search titles, tags and content.
  • GET /diff?a=&b= Side-by-side comparison of two pastes.
  • GET /healthz Liveness probe.

Create payload

  • content — required, up to 781.25 KB.
  • title — optional, max 200 chars.
  • syntax — optional language id, see Tools.
  • format — plain or markdown.
  • category, tags, folder — optional metadata.
  • expiry — minutes until expiry, 0 or omitted for never.
  • exposure — public, unlisted or private.
  • password — optional, protects reads behind a password.
  • burnAfterRead — boolean, destroys the paste after the first view.
  • vanity — optional custom id (3–64 chars).