Pastes API
Create Paste
POST /api/v1/pastesRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Paste content (max 10 MB) |
title | string | No | Title (max 255 chars) |
syntax | string | No | Language for highlighting (default: plaintext) |
ttlSeconds | number | No | Time-to-live in seconds (max 1 year) |
burnAfterRead | boolean | No | Self-destruct after first view (default: false) |
isE2ee | boolean | No | Content is client-side encrypted (default: false) |
Example
bash
curl -X POST https://paste.example.com/api/v1/pastes \
-H "Content-Type: application/json" \
-d '{
"content": "console.log(\"hello\")",
"title": "example.js",
"syntax": "javascript",
"ttlSeconds": 3600
}'Response 201
json
{
"publicId": "aBcDeFgHiJkLmNoPqRsTuVwX",
"url": "https://paste.example.com/view/aBcDeFgHiJkLmNoPqRsTuVwX",
"rawUrl": "https://paste.example.com/raw/aBcDeFgHiJkLmNoPqRsTuVwX",
"expiresAt": "2026-02-09T01:00:00.000Z",
"isE2ee": false
}Get Paste
GET /api/v1/pastes/:publicIdReturns the paste content. For Mode A (server-side encryption), content is decrypted automatically. For Mode B (E2EE), content is returned as the encrypted ciphertext.
Response 200
json
{
"publicId": "aBcDeFgHiJkLmNoPqRsTuVwX",
"title": "example.js",
"syntax": "javascript",
"content": "console.log(\"hello\")",
"isE2ee": false,
"burnAfterRead": false,
"viewCount": 3,
"expiresAt": "2026-02-09T01:00:00.000Z",
"createdAt": "2026-02-09T00:00:00.000Z"
}List Pastes
GET /api/v1/pastesReturns pastes created by the authenticated user. Requires X-Api-Key.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | number | Max results (default: 20) |
offset | number | Skip N results |
Response 200
json
{
"pastes": [
{
"publicId": "...",
"title": "example.js",
"syntax": "javascript",
"createdAt": "..."
}
]
}Delete Paste
DELETE /api/v1/pastes/:publicIdResponse 200
json
{
"deleted": true
}Extend TTL
POST /api/v1/pastes/:publicId/extendRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
ttlSeconds | number | Yes | Additional seconds to add (max 1 year) |
Response 200
json
{
"publicId": "aBcDeFgHiJkLmNoPqRsTuVwX",
"expiresAt": "2026-02-10T01:00:00.000Z"
}