Pasten REST API
Create, query, and delete pastes programmatically from scripts, CI pipelines, and developer tools. Authenticated endpoints accept a Bearer API key in the Authorization header.
Create a free account to generate up to 10 API keys from Settings.
Authentication
Generate keys in Settings → API Keys and send your key as a Bearer token:
Authorization: Bearer pv_your_api_key_here
Base URL
https://www.pasten.cc/api/v1
Endpoints
/api/v1/pastesList public pastes, or your own pastes when authenticated. Supports ?page, ?limit (max 50), ?language, and ?tag.
/api/v1/pastesCreate a new paste. Requires a valid Bearer API key.
/api/v1/pastes/:slugFetch a single paste by slug. Private pastes require owner authentication; password-protected and burn-after-read pastes must be opened in the browser.
/api/v1/pastes/:slugSoft-delete a paste you own. Requires authentication.
Create a Paste
POST /api/v1/pastes
curl -X POST https://www.pasten.cc/api/v1/pastes \
-H "Authorization: Bearer pv_your_key" \
-H "Content-Type: application/json" \
-d '{
"content": "console.log(\"hello world\")",
"title": "Hello World",
"language": "javascript",
"visibility": "public",
"tags": ["js", "example"]
}'| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | Paste text or code (max 512 KB) |
| title | string | No | Optional title (max 150 chars) |
| language | string | No | Syntax language (default: plaintext) |
| visibility | string | No | public | private | unlisted (default: public) |
| burn_after_read | boolean | No | Permanently delete after first confirmed reveal |
| tags | string[] | No | Up to 10 short tags |
Rate Limits
Authenticated requests are limited to 100 requests per minute per API key (anonymous reads: 60 req/min per IP). Exceeding the limit returns 429 Too Many Requests with a Retry-After header.