← pastesite.com — free paste sharing, no signup

pastesite API and CLI

API keys are part of Plus, $5 USD/month, because a key replaces the browser captcha and turns an account into a script. Reading a normal paste needs no key at all: /raw/<id> returns plain text on both plans. Abuse limits apply to both. Manage subscriptions in Dashboard → Billing.

By · Developer guide · updated October 2026 · 8 min read

The pastesite API lets you create and read pastes from a terminal, script, or CI job. It is the same API the website uses. Browser paste creation is protected by Cloudflare Turnstile; for scripts, create a personal API key instead.

Short answer: create a Plus API key in Dashboard → Account, send JSON to POST /api/pastes with Authorization: Bearer ps_…, and read any normal paste as plain text from /raw/<id> without a key.

1. Create an API key

API keys need a Plus account. A Free account sees the same section, explains what Plus adds, and links to Billing — nothing is hidden.

  1. Sign in, open Dashboard → Billing, and subscribe to Plus.
  2. Open the Account tab, find API keys, and click Create key.
  3. Give it a label, choose its permissions and expiry, then copy the key when it appears. It is shown only once.

Keys act as your account, so scope them narrowly. Plus allows up to 100 keys; a new key defaults to create and read, and manage is only worth adding when a script needs to edit or delete pastes. If the subscription ends, its keys stop working — they are kept, not deleted, and work again after resubscribing. The dashboard offers an expiry of 30 days, 90 days, one year, or never, and the API accepts any whole number from 1 to 3,650 days. An expired key stops working and is deleted the first time it is presented.

PermissionAllows
createPOST /api/pastes
readRead your own pastes, revisions, folders and profile
manageEdit and delete your own pastes, folders and profile (also grants read)

Do not commit keys to a repository or paste them into a public chat. Revoke a single key, or use Revoke all after a suspected leak.

2. Create a paste with curl

curl -s https://pastesite.com/api/pastes \
  -H "Authorization: Bearer ps_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "hello from the terminal",
    "title": "Terminal test",
    "language": "plaintext",
    "visibility": "unlisted"
  }'

The response includes the paste ID and shareable links:

{
  "ok": true,
  "paste": {
    "id": "x7Km2Qp9aL",
    "title": "Terminal test",
    "language": "plaintext",
    "visibility": "unlisted",
    "created_at": "2026-10-17T08:30:00.000Z",
    "views": 0,
    "url": "https://pastesite.com/#/p/x7Km2Qp9aL",
    "rawUrl": "https://pastesite.com/raw/x7Km2Qp9aL"
  }
}

Extract the link with jq:

curl -s https://pastesite.com/api/pastes \
  -H "Authorization: Bearer ps_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"content":"hello","language":"plaintext","visibility":"unlisted"}' \
  | jq -r '.paste.url'

3. Pipe command output into a paste

content is a normal JSON string. Use jq -Rs to wrap stdin as a string:

./deploy.sh 2>&1 \
  | jq -Rs '{content: ., title: "deploy log", language: "bash", visibility: "unlisted"}' \
  | curl -s https://pastesite.com/api/pastes \
      -H "Authorization: Bearer ps_your_api_key" \
      -H "Content-Type: application/json" \
      -d @- \
  | jq -r '.paste.url'

4. Read a paste as plain text

Use the friendly raw URL for pipes and downloads:

curl -s https://pastesite.com/raw/x7Km2Qp9aL

For a normal paste it returns text/plain with no HTML. A password-protected paste needs the password in a header — a ?password= query parameter is deliberately not accepted, because URLs are logged by every proxy between you and the server:

curl -s https://pastesite.com/raw/x7Km2Qp9aL \
  -H "x-paste-password: your-password"

Burn-after-read pastes are deleted after the first successful read — whether that read came from the browser or this endpoint. Expired pastes return a 410; unknown IDs return 404.

Endpoints

MethodPathAuthPurpose
POST/api/pastesAPI key or TurnstileCreate a paste
GET/raw/<id>None (password if set)Plain-text paste
GET/api/pastes/<id>/rawNone (password if set)Same as above
POST/api/pastes/<id>/viewNone (password if set)JSON view used by the site
GET/api/pastes/<id>Session or key (read)Your own paste, unlisted included
PATCH/api/pastes/<id>Session or key (manage)Edit your own paste
DELETE/api/pastes/<id>Session or key (manage)Delete your own paste
GET/api/pastes/<id>/revisionsSession or key (read)Edit-history summaries (id, title, language, created_at, content_length); bodies are loaded individually
GET/api/pastes/<id>/revisions/<revision-id>Session or key (read)One full revision of your own unexpired paste
GET/api/pastes/recentNoneRecent public pastes
GET/api/pastes/trendingNoneTrending public pastes from the last 30 days
GET/api/me/pastesSession or key (read)Your pastes
GET/api/me/usageSession or key (read)Your plan, rolling daily create usage and remaining budget
GET/api/me/profileSession or key (read)Your profile, plus isAdmin
PUT/api/me/profileSession or key (manage)Change your username or display name
GET/api/me/api-keysSessionList keys and your plan
POST/api/me/api-keysSession (Plus)Create a key — 403 on Free
DELETE/api/me/api-keys/<id>SessionRevoke one key
DELETE/api/me/api-keysSessionRevoke every key
GET/POST/api/foldersKey: read / manageList or create folders
PATCH/DELETE/api/folders/<id>Key: manageRename or delete a folder
GET/api/profiles/<username>NonePublic profile and its public pastes
GET/api/import/pastebin?id=<id>None (rate limited)Read a public Pastebin paste for import
POST/api/reportsNone (Turnstile)Report a paste for abuse
GET/api/reportsAdmin (manage)List abuse reports
PATCH/api/reports/<id>Admin (manage)Resolve or dismiss a report

Admin routes additionally require the caller's address to be listed in the server's ADMIN_EMAILS variable; the same allowlist decides the isAdmin flag on GET /api/me/profile. API keys cannot manage other API keys — that needs a browser session.

GET /api/me/usage returns { "plan": "plus", "dailyLimit": 2000, "used": 2, "remaining": 1998, "windowHours": 24 }. The counter is the same rolling 24-hour account bucket that creation enforces. Each creation returns to the budget exactly 24 hours after it was made, not at midnight. Every registered account, including admins, has its own allowance; browser and API requests, plain and encrypted pastes share it. Failed submissions do not spend the daily budget, and deleting a paste does not refund a creation. A daily-quota refusal returns 429 with code: "daily_limit" and upgrade: true only for signed-in Free accounts; other abuse limits do not signal an upgrade. Upgrading raises the allowance without clearing usage.

The import endpoint accepts a bare Pastebin id or a pastebin.com link, fetches the public raw text on the server (a browser cannot read pastebin.com directly, because it sends no CORS headers), and returns { "ok": true, "text": "…", "chars": 1234, "source": "AbC123xY" }. Only public and unlisted pastes are readable; private or password-protected pastes come back as HTML from Pastebin and are rejected with 422. Limits are 10 imports per hour per network and 100,000 characters. Nothing is stored — creating the paste is a separate POST /api/pastes.

Fields for creating a paste

FieldTypeNotes
contentstringRequired. Up to 250,000 characters for a key, because keys are a Plus feature; an encrypted payload has a bounded wire size allowing UTF-8, base64 and authentication-tag overhead. The server cannot inspect encrypted plaintext, so API clients must enforce the plaintext character limit before encryption. Client plan flags cannot upgrade access.
titlestringOptional, up to 200 characters.
languagestringOptional. One of the supported language IDs; defaults to plaintext.
visibilitystringpublic or unlisted; defaults to public.
passwordstringOptional. Readers must supply it.
expiryMinutesnumberOptional. 1 to 525,600 (one year).
burnAfterReadbooleanOptional. Deletes on first read.
encryptedbooleanOptional. Treats content as a v1 AES-256-GCM payload encrypted by the client. Forces visibility: "unlisted"; a password is ignored and an attached image is refused.
customSlugstringOptional. 3–30 lowercase letters, numbers, hyphens. Reserved words are refused: raw, embed, edit, report, admin, recent, trending, mine, account, verify, u, terms, api, p.
screenshotsstring[]Optional. Up to 3 base64 data URLs, max 500,000 characters each and at most 1.4 MB together. Only png, jpeg, gif and webp are accepted — SVG is refused with a 400 because a data URL can carry active content. The older single screenshot field is still accepted.
forkedFromstringOptional source paste ID.

Encrypted payloads. With "encrypted": true, send content in the form enc1: + standard-base64(12-byte IV) + . + standard-base64(ciphertext), where the ciphertext is AES-256-GCM over the UTF-8 text with the 256-bit key the client generated. Padding is optional. This is standard base64 (+, /, optional =), not base64url: the payload travels in a JSON body, not a URL. The server validates the shape and stores it verbatim; it has no key. Such a paste is unlisted-only, never appears in a feed, is skipped by the automatic abuse checks, and cannot be edited. GET /raw/<id> returns 409 because there is nothing readable to serve, and the embed page shows a notice instead of ciphertext. POST /api/pastes/<id>/view returns the ciphertext to a reader with the link; GET /api/pastes/<id> returns it only to the owner. A client that holds the key can decrypt it; the browser app never sends that key, and removes it from the address bar before analytics scripts load. Metadata — title, language, size, dates, and any custom URL — is stored in the clear, because only the text is encrypted.

Rate limits and errors

Burst limits are per identity: anonymous creation has a per-network burst and a per-browser daily allowance, while a signed-in account has its own attempt budget. The daily creation quota follows the signed-in account and applies to API-key requests too:

During a sustained flood, creation can pause site-wide for a short period; reading and existing links keep working, and the counter resets on its own. The plain-language version of these limits, including what a shared network or VPN changes, is limits and refusals.

Repeated reads from the same network count as one view for 24 hours, so view counts and the trending list cannot be pumped from one machine. Errors are JSON for API routes and plain text for raw routes:

Security notes

Frequently asked questions

How do I create an API key?

Subscribe to Plus in Dashboard → Billing, then open the Account tab, find the API keys section, and click Create key. Copy the key when it appears — it is shown only once. Revoke it from the same section if it leaks.

Can I create a paste with curl?

Yes, with a Plus account. Send a POST request to /api/pastes with an Authorization: Bearer ps_... header and a JSON body containing content. The response includes a shareable url and rawUrl. A key whose account is on Free is refused with 403.

Does the raw endpoint work without JavaScript?

Yes. GET /raw/<id> returns text/plain from the server, so curl, wget, and shell pipes work without a browser.

Can I limit what an API key can do?

Yes. Keys carry permissions: create, read, and manage. New keys can create pastes and read your own data; add manage only when a script needs to edit or delete. Keys can expire after 30 days, 90 days, a year, or never, and you can revoke all keys at once if one leaks.

Do API keys bypass the captcha?

Yes. A key replaces the browser Turnstile challenge for scripted creation, which is why it is the paid capability. Paste creation is still rate-limited by IP.

Why do I get a 401 from /raw/<id>?

The paste is password-protected. Send the password in an x-paste-password header. A ?password= query parameter returns 401 as well — request lines are logged, so a password in the URL leaks into logs, shell history and any bookmark or referrer that carries the link.