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/pastes

List public pastes. With auth, lists your own pastes. Supports ?page, ?limit, ?language, ?tag.

POST
/api/v1/pastes

Create a new paste. Requires authentication.

GET
/api/v1/pastes/:slug

Get a single paste by slug. Private pastes require authentication.

DELETE
/api/v1/pastes/:slug

Delete 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:

FieldTypeRequiredDescription
contentstringYesThe paste content (max 512KB)
titlestringNoOptional title
languagestringNoSyntax language (default: plaintext)
visibilitystringNopublic | private | unlisted (default: public)
burn_after_readbooleanNoAuto-delete after first view
tagsstring[]NoUp 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.