REST API
The Pasten API lets you create, retrieve, and delete pastes programmatically. All API requests require a Bearer token (your API key) in the Authorization header.
Create a free account to generate API keys.
Authentication
Generate API keys from Settings → API Keys. Include the key in every request:
Authorization: Bearer pv_your_api_key_here
Base URL
https://pasten.cc/api/v1
Endpoints
GET
/api/v1/pastesList public pastes. With auth, lists your own pastes. Supports ?page, ?limit, ?language, ?tag.
POST
/api/v1/pastesCreate a new paste. Requires authentication.
GET
/api/v1/pastes/:slugGet a single paste by slug. Private pastes require authentication.
DELETE
/api/v1/pastes/:slugDelete a paste. Must be the owner.
Create a Paste
POST /api/v1/pastes
curl -X POST https://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"]
}'Request body:
| Field | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The paste content (max 512KB) |
| title | string | No | Optional title |
| language | string | No | Syntax language (default: plaintext) |
| visibility | string | No | public | private | unlisted (default: public) |
| burn_after_read | boolean | No | Auto-delete after first view |
| tags | string[] | No | Up to 10 tags |
Rate Limits
API requests are limited to 100 requests per minute per API key. Exceeding this returns a 429 Too Many Requests response.