Skip to content

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).


Request body

FieldTypeDefaultDescription
namestringrequiredIdentifier (max 100 chars)
datastringrequiredContent payload (max 1 MB)
expirestring (ISO)Auto-delete after this date
burnAfterViewbooleanfalseDelete on first read
passwordHashstringSHA-256 hash for password protection

curl

Terminal window
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];
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
});

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

Terminal window
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);

Returns metadata only (no data field) — useful for building dashboards or searching your store.

Query params

ParamTypeDefaultDescription
namestringPartial name search (case-insensitive)
limitnumber20Max results (max 100)
offsetnumber0Pagination offset

curl

Terminal window
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 });

curl

Terminal window
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');

StatusReasonDescription
400name and data are requiredMissing required fields
400Data is too long, max 1MBPayload exceeds limit
401password_requiredPaste needs a password
401password_incorrectWrong password provided
403Access deniedPaste belongs to another account
404Paste not foundNo paste with that ref (or already burned)