API Documentation
Create and manage pastes straight from your scripts, terminal, or application.
Base URL
https://pastemu.io/api/v1Authentication
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_TOKENTokens can be created in your account settings. Treat a token like a password — never commit it to a public repository.
Endpoints
/api/v1/pastesOptionalCreate a new paste. Returns its slug and URL.
/api/v1/pastesRequiredList the token holder's pastes, with pagination (?page=1&limit=20).
/api/v1/pastes/{slug}OptionalFetch a single paste including its content. Password-protected pastes need ?password=…
/api/v1/pastes/{slug}RequiredPermanently delete one of your own pastes.
Paste creation parameters
| Field | Type | Description |
|---|---|---|
content | string | Required. The paste body, up to 1 MB. |
title | string | Paste title. Defaults to Untitled. |
language | string | Language code, e.g. python. Defaults to plaintext. |
visibility | string | PUBLIC, UNLISTED, or PRIVATE. Defaults to UNLISTED. |
expiry | string | never, 10m, 1h, 1d, 1w, 1m, 1y. |
password | string | If set, readers must enter this password. |
burnAfterRead | boolean | Delete automatically after a single read. |
tags | array/string | Up 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:
| Code | Meaning |
|---|---|
401 | API token missing or invalid. |
403 | No access to this resource. |
404 | Paste not found. |
410 | Paste has expired or burned. |
422 | Invalid data — see the issues array. |
429 | Too 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.