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/pastesCreate a paste. JSON body, returns id + deleteToken. -
GET
/api/pastesPaginated public listing (?page, ?syntax, ?category). -
GET
/api/pastes/:idFetch a paste. 401 if password protected unless ?password= matches. -
DELETE
/api/pastes/:idDelete a paste. Requires the delete token header. -
POST
/api/pastes/:id/forkCopy a paste into a new one, returns the new paste. -
GET
/raw/:idPlain text content, no HTML. -
GET
/download/:idContent as a file download. -
GET
/pastesHTML listing of public pastes. -
GET
/search?q=Search titles, tags and content. -
GET
/diff?a=&b=Side-by-side comparison of two pastes. -
GET
/healthzLiveness probe.
Create payload
content— required, up to 781.25 KB.title— optional, max 200 chars.syntax— optional language id, see Tools.format—plainormarkdown.category,tags,folder— optional metadata.expiry— minutes until expiry,0or omitted for never.exposure—public,unlistedorprivate.password— optional, protects reads behind a password.burnAfterRead— boolean, destroys the paste after the first view.vanity— optional custom id (3–64 chars).