Skip to content

Pastes API

Create Paste

POST /api/v1/pastes

Request Body

FieldTypeRequiredDescription
contentstringYesPaste content (max 10 MB)
titlestringNoTitle (max 255 chars)
syntaxstringNoLanguage for highlighting (default: plaintext)
ttlSecondsnumberNoTime-to-live in seconds (max 1 year)
burnAfterReadbooleanNoSelf-destruct after first view (default: false)
isE2eebooleanNoContent 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/:publicId

Returns 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/pastes

Returns pastes created by the authenticated user. Requires X-Api-Key.

Query Parameters

ParameterTypeDescription
limitnumberMax results (default: 20)
offsetnumberSkip N results

Response 200

json
{
  "pastes": [
    {
      "publicId": "...",
      "title": "example.js",
      "syntax": "javascript",
      "createdAt": "..."
    }
  ]
}

Delete Paste

DELETE /api/v1/pastes/:publicId

Response 200

json
{
  "deleted": true
}

Extend TTL

POST /api/v1/pastes/:publicId/extend

Request Body

FieldTypeRequiredDescription
ttlSecondsnumberYesAdditional seconds to add (max 1 year)

Response 200

json
{
  "publicId": "aBcDeFgHiJkLmNoPqRsTuVwX",
  "expiresAt": "2026-02-10T01:00:00.000Z"
}

Self-hosted paste service with E2EE