Paste Lite API
PasteLites are simple, lightweight storage entries — think of them as schemaless key/value records. They’re ideal for:
- Ephemeral config blobs
- One-time tokens or secrets (with burn-after-view)
- Small JSON payloads under 1 MB
- Any text that doesn’t need the full paste feature set
PasteLite endpoints are available on all tiers (including Free).
Create a PasteLite
Section titled “Create a PasteLite”POST /api/dev/paste-lite/create
Section titled “POST /api/dev/paste-lite/create”Request body
| Field | Type | Default | Description |
|---|---|---|---|
name | string | required | Identifier (max 100 chars) |
data | string | required | Content payload (max 1 MB) |
expire | string (ISO) | – | Auto-delete after this date |
burnAfterView | boolean | false | Delete on first read |
passwordHash | string | – | SHA-256 hash for password protection |
curl
curl -X POST https://api.anonpaste.com/api/dev/paste-lite/create \ -H "x-api-key: your_api_key" \ -H "Content-Type: application/json" \ -d '{ "name": "app-config", "data": "{\"theme\":\"dark\",\"lang\":\"en\"}", "burnAfterView": false }'Response
{ "success": true, "id": "abc:token123abc456", "remaining": 99}The id is a composite string ref:token. The ref is the short identifier used to retrieve the paste. The token is your private management token — store it if you need to reference this paste later.
SDK
const { id } = await anonpaste.pasteLite.create({ name: 'app-config', data: JSON.stringify({ theme: 'dark', lang: 'en' }),});const ref = id.split(':')[0];Burn-after-view example
Section titled “Burn-after-view example”const { id } = await anonpaste.pasteLite.create({ name: 'one-time-token', data: 'super-secret-token-abc', burnAfterView: true, expire: new Date(Date.now() + 15 * 60 * 1000), // 15 minutes});Get a PasteLite
Section titled “Get a PasteLite”GET /api/dev/paste-lite/get/:ref
Section titled “GET /api/dev/paste-lite/get/:ref”If the paste has burnAfterView: true, it is permanently deleted after this call returns.
If the paste was created with passwordHash, pass the matching hash as a query param.
curl
curl "https://api.anonpaste.com/api/dev/paste-lite/get/abc123?password=myhashhere" \ -H "x-api-key: your_api_key"Response
{ "success": true, "paste": { "ref": "abc123", "name": "app-config", "data": "{\"theme\":\"dark\",\"lang\":\"en\"}", "date": "2026-04-12T10:00:00.000Z", "expire": null, "burnAfterView": false }, "remaining": 499}SDK
const paste = await anonpaste.pasteLite.get('abc123');const config = JSON.parse(paste.data);List PasteLites
Section titled “List PasteLites”GET /api/dev/paste-lite/list
Section titled “GET /api/dev/paste-lite/list”Returns metadata only (no data field) — useful for building dashboards or searching your store.
Query params
| Param | Type | Default | Description |
|---|---|---|---|
name | string | – | Partial name search (case-insensitive) |
limit | number | 20 | Max results (max 100) |
offset | number | 0 | Pagination offset |
curl
curl "https://api.anonpaste.com/api/dev/paste-lite/list?name=config&limit=10" \ -H "x-api-key: your_api_key"Response
{ "success": true, "items": [ { "ref": "abc123", "name": "app-config", "date": "2026-04-12T10:00:00.000Z", "expire": null, "burnAfterView": false, "hasPassword": false } ], "total": 1, "limit": 10, "offset": 0}SDK
const { items, total } = await anonpaste.pasteLite.list({ name: 'config', limit: 10 });Delete a PasteLite
Section titled “Delete a PasteLite”DELETE /api/dev/paste-lite/delete/:ref
Section titled “DELETE /api/dev/paste-lite/delete/:ref”curl
curl -X DELETE https://api.anonpaste.com/api/dev/paste-lite/delete/abc123 \ -H "x-api-key: your_api_key"Response
{ "success": true, "remaining": 49 }SDK
await anonpaste.pasteLite.delete('abc123');Error codes
Section titled “Error codes”| Status | Reason | Description |
|---|---|---|
400 | name and data are required | Missing required fields |
400 | Data is too long, max 1MB | Payload exceeds limit |
401 | password_required | Paste needs a password |
401 | password_incorrect | Wrong password provided |
403 | Access denied | Paste belongs to another account |
404 | Paste not found | No paste with that ref (or already burned) |