Bullpaste

Documentazione API

POST/api/secrets

Create a new encrypted secret.

Body

{
  "kind": "'text' | 'file' | 'url'",
  "payload": "string (text / base64 for file / url)",
  "expiresInDays": "number (1-90)",
  "maxViews": "number (1-100)",
  "passphrase": "string (optional)",
  "burnAfterRead": "boolean",
  "deletable": "boolean",
  "filename": "string (file only)",
  "mimeType": "string (file only)"
}

Response

{
  "id": "string",
  "url": "string",
  "deleteToken": "string | null",
  "expiresAt": "ISO date"
}
GET/api/secrets/[id]/preview

Read non-sensitive metadata of a secret.

Response

{
  "exists": "boolean",
  "expired": "boolean",
  "requiresPassphrase": "boolean",
  "kind": "'text' | 'file' | 'url'",
  "filename": "string?",
  "mimeType": "string?",
  "expiresAt": "ISO date",
  "viewsRemaining": "number"
}
POST/api/secrets/[id]/retrieve

Decrypt and retrieve the secret content.

Body

{
  "passphrase": "string (if required)"
}

Response

{
  "kind": "'text' | 'file' | 'url'",
  "content": "string (base64 for file)",
  "filename": "string?",
  "mimeType": "string?"
}
DELETE/api/secrets/[id]

Permanently delete a secret using its delete token.

Body

{
  "deleteToken": "string"
}

Response

{
  "ok": "boolean"
}