API Reference

Create, read, list and delete pastes over JSON under /api/v1.

The PasteBox API is a small JSON API under https://paste.65-75-202-18.sslip.io/api/v1. Use it to create pastes, read them back, list your own pastes and delete them. Every endpoint answers with JSON except /api/v1/raw/<slug>, which returns the paste body as text/plain.

The API is CSRF-exempt and authenticated with an API key - it does not use session cookies. JSON bodies and form-encoded bodies are both accepted where fields are sent.

Authentication

Send your API key in the X-API-Key request header, or - for form-encoded requests - as an api_dev_key field. Keys belong to an account and are managed on the account page. Treat a key like a password and do not share it.

Sign in to get your API key

API keys are issued per account. Sign in to view your key, or create an account first.

Reading public and unlisted pastes - GET /api/v1/paste/<slug> and GET /api/v1/raw/<slug> - works without a key. Everything else requires one, and guest API use is not allowed.

Endpoints

Method Path Purpose
POST /api/v1/paste Create a paste
GET /api/v1/paste/<slug> Read a paste's metadata
GET /api/v1/raw/<slug> Read a paste's content as plain text
GET /api/v1/mine List your own pastes (all exposures)
DELETE /api/v1/paste/<slug> Delete one of your pastes

Create a paste

POST /api/v1/paste

Creates a paste and returns its slug and URLs.

Field Required Description
content Yes The paste body. Must not be empty or whitespace-only. Carriage returns are stripped; the maximum size is 512 KB.
title No Optional title, up to 160 characters (longer titles are truncated). The alias name is also accepted.
syntax No One of the syntax slugs listed below; defaults to text.
exposure No public, unlisted or private; defaults to public.
expires No An expiry code (see below); defaults to N (never).
password No Optional password of at least four characters; readers must unlock the paste before it is shown.
burn No 1 enables burn after read, 0 (default) does not.
format No Response format: json (default) or text. Can also be sent as the query parameter ?format=text.

Expiry codes: N, 10M, 1H, 1D, 1W, 2W, 1M, 6M, 1Y.

Syntax slugs: textbashccppcsharpcssdiffdockerfilegohtmlinijavajavascriptjsonkotlinluamarkdownnginxperlphppowershellpythonrubyrustsqlswifttypescriptyaml

Example - JSON body

curl -s -X POST "https://paste.65-75-202-18.sslip.io/api/v1/paste" \
  -H "X-API-Key: $PASTEBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "server { listen 8080; }",
    "title": "Reverse proxy snippet",
    "syntax": "nginx",
    "exposure": "unlisted",
    "expires": "1W"
  }'

Response (HTTP 200):

{
  "ok": true,
  "slug": "k3f9x2qa",
  "url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa",
  "raw_url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa/raw",
  "syntax": "nginx",
  "exposure": "unlisted",
  "expires_at": "2026-09-19T22:00:00+00:00",
  "created_at": "2026-09-12T22:00:00+00:00",
  "size_bytes": 22,
  "line_count": 1
}

Example - form-encoded with api_dev_key

curl -s -X POST "https://paste.65-75-202-18.sslip.io/api/v1/paste" \
  -d "api_dev_key=$PASTEBOX_API_KEY" \
  --data-urlencode 'content=<div class="notice">Hello</div>' \
  --data-urlencode "syntax=html"

With format=text the response body is text/plain and contains just the paste URL.

Read paste metadata

GET /api/v1/paste/<slug>

Returns metadata for a public or unlisted paste. Private pastes answer 403, and unknown or expired slugs answer 404. No API key is required.

Example

curl -s "https://paste.65-75-202-18.sslip.io/api/v1/paste/k3f9x2qa"

Response (HTTP 200):

{
  "slug": "k3f9x2qa",
  "title": "Reverse proxy snippet",
  "syntax": "nginx",
  "exposure": "unlisted",
  "views": 12,
  "size_bytes": 22,
  "line_count": 1,
  "created_at": "2026-09-12T22:00:00+00:00",
  "expires_at": "2026-09-19T22:00:00+00:00",
  "url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa",
  "raw_url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa/raw"
}

expires_at is null for pastes that never expire.

Read raw content

GET /api/v1/raw/<slug>

Returns the paste body as text/plain; charset=utf-8 under the same access rules as the web view: public and unlisted pastes are readable without a key, private pastes answer 403 and unknown or expired slugs answer 404. A password-protected paste answers 401 until it has been unlocked through the web page; the API itself has no unlock endpoint.

Example

curl -s "https://paste.65-75-202-18.sslip.io/api/v1/raw/k3f9x2qa"

Response (HTTP 200, text/plain):

server { listen 8080; }

List your pastes

GET /api/v1/mine

Returns your pastes - all exposure levels, newest first. Requires an API key. Paginated with the query parameters page (default 1) and limit (items per page, maximum 100).

Query parameter Description
pagePage number; defaults to 1.
limitItems per page; must be at most 100.

Example

curl -s -H "X-API-Key: $PASTEBOX_API_KEY" \
  "https://paste.65-75-202-18.sslip.io/api/v1/mine?page=1&limit=20"

Response (HTTP 200):

{
  "ok": true,
  "items": [
    {
      "slug": "k3f9x2qa",
      "title": "Reverse proxy snippet",
      "syntax": "nginx",
      "exposure": "unlisted",
      "views": 12,
      "size_bytes": 22,
      "line_count": 1,
      "created_at": "2026-09-12T22:00:00+00:00",
      "expires_at": "2026-09-19T22:00:00+00:00",
      "url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa",
      "raw_url": "https://paste.65-75-202-18.sslip.io/k3f9x2qa/raw"
    }
  ],
  "total": 42,
  "page": 1,
  "pages": 3
}

Each item uses the same fields as the metadata endpoint above.

Delete a paste

DELETE /api/v1/paste/<slug>

Deletes one of your pastes. Only the owner may delete: other accounts receive 403, and unknown or expired slugs receive 404.

Example

curl -s -X DELETE -H "X-API-Key: $PASTEBOX_API_KEY" \
  "https://paste.65-75-202-18.sslip.io/api/v1/paste/k3f9x2qa"

Response (HTTP 200):

{
  "ok": true,
  "deleted": "k3f9x2qa"
}

Errors

Error responses are JSON with ok set to false, a human-readable error message and a machine-readable code:

{
  "ok": false,
  "error": "human-readable message",
  "code": "missing_content"
}
Code HTTP status Meaning
missing_content 400 content is missing, empty or whitespace-only.
invalid_syntax 400 syntax is not one of the supported slugs.
invalid_exposure 400 exposure is not public, unlisted or private.
invalid_expiry 400 expires is not a valid expiry code.
too_large 400 Content exceeds the maximum paste size (512 KB). A request body above the server's request limit is rejected with 413 and the same code.
invalid_api_key 401 The API key is missing, unknown, or belongs to no account. Guest API use is not allowed.
rate_limited 429 Too many pastes in the current window; the response includes a retry_after hint.
forbidden 403 The paste is private, or (when deleting) it is not yours.
not_found 404 The slug is unknown, expired or already deleted.
server_error 500 Unexpected server-side failure.

Rate limits apply per account (or per IP address for anonymous actions); see the About page for the currently configured limits.