Skip to content

API Documentation

Create and manage pastes straight from your scripts, terminal, or application.

Base URL

https://pastemu.io/api/v1

Authentication

Creating public or unlisted pastes works without authentication. For private pastes, listing your pastes, or deleting a paste, include your API token:

Authorization: Bearer YOUR_TOKEN

Tokens can be created in your account settings. Treat a token like a password — never commit it to a public repository.

Endpoints

POST/api/v1/pastesOptional

Create a new paste. Returns its slug and URL.

GET/api/v1/pastesRequired

List the token holder's pastes, with pagination (?page=1&limit=20).

GET/api/v1/pastes/{slug}Optional

Fetch a single paste including its content. Password-protected pastes need ?password=…

DELETE/api/v1/pastes/{slug}Required

Permanently delete one of your own pastes.

Paste creation parameters

FieldTypeDescription
contentstringRequired. The paste body, up to 1 MB.
titlestringPaste title. Defaults to Untitled.
languagestringLanguage code, e.g. python. Defaults to plaintext.
visibilitystringPUBLIC, UNLISTED, or PRIVATE. Defaults to UNLISTED.
expirystringnever, 10m, 1h, 1d, 1w, 1m, 1y.
passwordstringIf set, readers must enter this password.
burnAfterReadbooleanDelete automatically after a single read.
tagsarray/stringUp to 8 tags.

Example: creating a paste

curl -X POST https://pastemu.io/api/v1/pastes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "title": "nginx config",
    "content": "server {\n  listen 80;\n}",
    "language": "nginx",
    "visibility": "UNLISTED",
    "expiry": "1w",
    "tags": ["nginx", "config"]
  }'

Example: piping file contents

# Send a file's contents straight from your terminal
cat error.log | jq -Rs '{content: ., language: "plaintext"}' \
  | curl -X POST https://pastemu.io/api/v1/pastes \
      -H "Content-Type: application/json" -d @-

Success response

{
  "ok": true,
  "paste": {
    "slug": "kQ7x2mAe",
    "title": "nginx config",
    "language": "nginx",
    "visibility": "UNLISTED",
    "url": "https://pastemu.io/p/kQ7x2mAe",
    "rawUrl": "https://pastemu.io/p/kQ7x2mAe/raw"
  }
}

Error handling

Errors come back with ok: false and a matching HTTP status code:

CodeMeaning
401API token missing or invalid.
403No access to this resource.
404Paste not found.
410Paste has expired or burned.
422Invalid data — see the issues array.
429Too many requests; slow down.

Rate limits

API endpoints are limited to roughly 2 requests per second per IP address, with a short burst allowance. If you need a larger quota, get in touch.