API Documentation

Integrate QuickPaste into your applications

Introduction

The QuickPaste API allows you to programmatically create, retrieve, and manage pastes. Our RESTful API accepts JSON requests and returns JSON responses.

Key Features:

  • •Create text, code, and file-based pastes
  • •Set expiration times (from 1 hour to never)
  • •Password protection for sensitive content
  • •Burn-after-read for self-destructing pastes
  • •Support for multiple media types (images, videos, audio, files)

API Keys & Authentication

All API requests require authentication using an API key

Authentication Required

As of now, all API requests must be authenticated with a valid API key. Guest users cannot make API requests.

You need to create a free account to generate your API key.

1How to Get Your API Key

  1. 1.Sign up for a free QuickPaste account
  2. 2.Go to your Dashboard
  3. 3.Navigate to API Keys section
  4. 4.Click "Generate New API Key"
  5. 5.Copy your API key and store it securely

2Using Your API Key

Include your API key in the X-API-Key header for all requests:

curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "content": "Hello, World!",
    "type": "TEXT"
  }'

Rate Limits

TierRate LimitPrice
Free
200 requests/day$0
Pro
10,000 requests/dayComing Soon
Enterprise
UnlimitedComing Soon

Rate limits reset daily at midnight UTC. Exceeding your limit will result in 429 (Too Many Requests) errors.

Security Best Practices

  • •Never share your API key publicly
  • •Never commit API keys to version control
  • •Store API keys in environment variables
  • •Rotate your API keys regularly
  • •Revoke compromised keys immediately

Base URL

https://quickpaste.rescub.com/api

Rate Limiting

Tier-based request limits to ensure fair usage

Request Limits

All API requests are rate-limited based on your account tier. Limits reset daily at midnight UTC.

Daily Request Limits by Tier

TierDaily LimitPrice
Free100$0/month
Premium500$3.99/month
Premium Pro2,000$8.99/month
Enterprise5,000$19.99/month
Enterprise Pro10,000$39.99/month
Admin100,000Admin only

Rate Limit Headers

Every API response includes rate limit information in the headers:

X-RateLimit-Limit: 500
X-RateLimit-Remaining: 347
X-RateLimit-Reset: 2025-10-28T00:00:00.000Z
X-RateLimit-LimitYour daily request limit
X-RateLimit-RemainingRequests remaining today
X-RateLimit-ResetWhen your limit resets (midnight UTC)

Rate Limit Exceeded Response

Response
429 Too Many Requests
{
  "error": "Rate limit exceeded",
  "message": "You have exceeded your PREMIUM tier limit of 500 requests per day",
  "limit": 500,
  "remaining": 0,
  "reset": "2025-10-28T00:00:00.000Z"
}

Retry-After Header

The response includes a Retry-After header indicating seconds until limit reset.

Check Your Usage

GET
/api/user/usage
Response
200 OK
{
  "success": true,
  "tier": "PREMIUM",
  "usage": {
    "limit": 500,
    "used": 127,
    "remaining": 373,
    "percentUsed": 25.4,
    "reset": "2025-10-28T00:00:00.000Z"
  },
  "apiKeys": [
    {
      "id": "key_123",
      "name": "Production API",
      "requests": 89,
      "lastUsedAt": "2025-10-27T16:45:00Z",
      "keyPreview": "qp_prod_..."
    }
  ]
}

Create Paste
POST

Create a new paste with text, code, or file content

POST /api/pastes
ParameterTypeRequiredDescription
contentstring
Yes
The paste content (text, code, or base64 for files)
typestring
No
Type: TEXT, CODE, IMAGE, VIDEO, AUDIO, FILE (default: TEXT)
titlestring
No
Optional title for the paste
expiresInstring
No
1h, 24h, 7d, 30d, never (default: 24h)
passwordstring
No
Password to protect the paste
burnAfterReadboolean
No
Self-destruct after first view (default: false)
languagestring
No
Syntax highlighting language for CODE type
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "content": "Hello, World!",
    "type": "TEXT",
    "title": "My First Paste"
  }'
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "This paste expires in 1 hour",
    "type": "TEXT",
    "expiresIn": "1h"
  }'
Available values: 1h, 24h, 7d, 30d, never
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Sensitive information here",
    "type": "TEXT",
    "title": "Secret Document",
    "password": "mySecretPassword123",
    "expiresIn": "7d"
  }'

Note: Passwords are hashed using bcrypt. Viewers will need to enter the password to access the paste.

curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "This message will self-destruct after being viewed once",
    "type": "TEXT",
    "title": "One-Time Secret",
    "burnAfterRead": true,
    "expiresIn": "24h"
  }'

Warning: Once viewed, the paste is permanently deleted and cannot be recovered. Perfect for sharing sensitive information like passwords or API keys.

curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "API Key: sk-abc123xyz789...",
    "type": "TEXT",
    "title": "Production API Key",
    "password": "ultra-secure-password",
    "burnAfterRead": true,
    "expiresIn": "1h"
  }'

Ultra Secure: Combines password protection with burn-after-read. Requires password to view AND self-destructs after first view.

curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...",
    "type": "IMAGE",
    "title": "Screenshot 2025",
    "fileName": "screenshot.png",
    "mimeType": "image/png",
    "fileSize": 12345,
    "expiresIn": "7d"
  }'
Supported formats: PNG, JPEG, GIF, WebP, SVG
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21...",
    "type": "VIDEO",
    "title": "Demo Video",
    "fileName": "demo.mp4",
    "mimeType": "video/mp4",
    "fileSize": 2048000,
    "burnAfterRead": true
  }'
Supported formats: MP4, WebM, MOV, AVI
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAAD...",
    "type": "AUDIO",
    "title": "Voice Memo",
    "fileName": "recording.mp3",
    "mimeType": "audio/mpeg",
    "fileSize": 512000,
    "expiresIn": "24h"
  }'
Supported formats: MP3, WAV, OGG, M4A
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "data:application/pdf;base64,JVBERi0xLjcKCjEgMCBvYmo...",
    "type": "FILE",
    "title": "Important Document",
    "fileName": "document.pdf",
    "mimeType": "application/pdf",
    "fileSize": 1024000,
    "password": "secure123",
    "burnAfterRead": true
  }'
Supported formats: PDF, ZIP, DOC, XLS, TXT, CSV, JSON, XML, and more

Supported Paste Types

TEXT - Plain text content
CODE - Code with syntax highlighting
IMAGE - PNG, JPEG, GIF, WebP, SVG
VIDEO - MP4, WebM, MOV, AVI
AUDIO - MP3, WAV, OGG, M4A
FILE - Any other file type
curl -X POST https://quickpaste.rescub.com/api/pastes \
  -H "Content-Type: application/json" \
  -d '{
    "content": "function hello() {\n  console.log(\"Hello, World!\");\n}",
    "type": "CODE",
    "language": "javascript",
    "title": "JavaScript Function",
    "expiresIn": "24h"
  }'
{
  "success": true,
  "paste": {
    "id": "abc123xyz",
    "url": "https://quickpaste.rescub.com/abc123xyz",
    "type": "TEXT",
    "expiresAt": "2025-10-27T12:00:00.000Z",
    "burnAfterRead": false,
    "hasBeenRead": false,
    "createdAt": "2025-10-26T12:00:00.000Z"
  }
}

Batch Create Pastes
POST

Create multiple pastes in a single request. Maximum 50 pastes per batch.

POST /api/pastes/batch
{
  "pastes": [
    {
      "content": "First paste content",
      "type": "TEXT",
      "title": "First paste",
      "expiresIn": "24h"
    },
    {
      "content": "function hello() { console.log('Hello'); }",
      "type": "CODE",
      "language": "javascript",
      "title": "JS Function"
    },
    {
      "content": "Secret message",
      "type": "TEXT",
      "password": "secret123",
      "burnAfterRead": true
    }
  ]
}
{
  "success": true,
  "summary": {
    "total": 3,
    "successful": 3,
    "failed": 0
  },
  "results": [
    {
      "success": true,
      "id": "abc123",
      "title": "First paste",
      "url": "https://quickpaste.rescub.com/abc123"
    },
    {
      "success": true,
      "id": "def456",
      "title": "JS Function",
      "url": "https://quickpaste.rescub.com/def456"
    },
    {
      "success": true,
      "id": "ghi789",
      "title": "Secret message",
      "url": "https://quickpaste.rescub.com/ghi789"
    }
  ]
}

Batch Upload Notes

  • •Maximum 50 pastes per batch request
  • •Individual errors won't fail the entire batch
  • •Each paste is created independently with its own ID
  • •All paste properties (password, burn, expiration) are supported

Retrieve Paste
GET

Retrieve a paste by its ID (public or with password verification)

GET /api/pastes/:id
curl -X GET https://quickpaste.rescub.com/api/pastes/abc123xyz
{
  "success": true,
  "paste": {
    "id": "abc123xyz",
    "content": "Hello, World!",
    "type": "TEXT",
    "title": "My First Paste",
    "views": 5,
    "expiresAt": "2025-10-27T12:00:00.000Z",
    "burnAfterRead": false,
    "hasBeenRead": false,
    "createdAt": "2025-10-26T12:00:00.000Z"
  }
}

Password Protected Pastes

For password-protected pastes, you need to verify the password first using a two-step process:

1Verify Password
curl -X POST https://quickpaste.rescub.com/api/pastes/abc123xyz/verify \
  -H "Content-Type: application/json" \
  -d '{"password": "mySecretPassword123"}'

Response: {"success": true, "message": "Password verified"}

2Fetch Paste Content
curl -X POST https://quickpaste.rescub.com/api/pastes/abc123xyz \
  -H "Content-Type: application/json" \
  -d '{"password": "mySecretPassword123"}'

Returns the full paste content if password matches

Update Paste
PUT

Update an existing paste's content, title, language, or type. Only the paste owner can update.

PUT /api/pastes/:id

Authentication & Authorization

This endpoint requires API key authentication AND ownership verification. You can only update pastes that you created.

{
  "content": "Updated paste content",  // Required
  "title": "Updated Title",           // Optional
  "language": "javascript",           // Optional
  "type": "CODE"                      // Optional
}
{
  "success": true,
  "paste": {
    "id": "abc123",
    "content": "Updated content",
    "title": "New Title",
    "language": "javascript",
    "type": "CODE",
    "updatedAt": "2025-10-27T12:00:00.000Z"
  }
}
403 Forbidden - You are not the owner of this paste
404 Not Found - Paste not found
400 Bad Request - Content is required

Delete Paste
DELETE

Permanently delete a paste. This action cannot be undone.

DELETE /api/pastes/:id
curl -X DELETE https://quickpaste.rescub.com/api/pastes/abc123 \
  -H "X-API-Key: your_api_key_here"
{
  "success": true,
  "message": "Paste deleted successfully"
}

Permanent Deletion

Once deleted, a paste cannot be recovered. Make sure you want to permanently delete the paste before calling this endpoint.

User Pastes & Search

List, search, and manage your pastes

Manage Your Content

Authenticated users can list all their pastes, search through them, and filter by type, language, or status.

1. List Your Pastes

Retrieve all pastes created by your account with pagination, filtering, and sorting options.

GET
/api/pastes/mine
Query Parameters
pagePage number (default: 1)
limitItems per page (default: 20, max: 100)
typeFilter by type: TEXT, CODE, IMAGE, etc.
languageFilter by language: javascript, python, etc.
isLockedFilter locked pastes: true/false
sortBySort field (default: createdAt)
sortOrderasc or desc (default: desc)
Example Request
GET /api/pastes/mine?type=CODE&language=javascript&page=1&limit=20
Response
200 OK
{
  "success": true,
  "pastes": [
    {
      "id": "abc123xyz",
      "type": "CODE",
      "language": "javascript",
      "title": "Express Server",
      "views": 42,
      "lastViewedAt": "2025-10-27T15:30:00Z",
      "createdAt": "2025-10-25T10:00:00Z",
      "expiresAt": null,
      "isLocked": false,
      "isExpired": false,
      "isBurned": false,
      "available": true
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156,
    "totalPages": 8,
    "hasNext": true,
    "hasPrev": false
  }
}

2. Search Your Pastes

Full-text search across your paste titles, content, and filenames. Minimum 2 characters required.

GET
/api/pastes/search
Query Parameters
qSearch query (min 2 chars) *required
typeFilter by type
languageFilter by language
pagePage number
limitResults per page
Example Request
GET /api/pastes/search?q=express&type=CODE&language=javascript
Response
200 OK
{
  "success": true,
  "query": "express",
  "results": [
    {
      "id": "def456",
      "type": "CODE",
      "language": "javascript",
      "title": "Express Server Setup",
      "preview": "const express = require('express');\nconst app = express();\n\napp.get('/', (req, res) => {\n  res.send('Hello World');\n});\n\napp.listen(3000, () => {\n  console.log('Server running...",
      "views": 15,
      "createdAt": "2025-10-26T12:00:00Z",
      "available": true
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 5,
    "totalPages": 1,
    "hasNext": false,
    "hasPrev": false
  }
}
💡 Search Tips
  • •Search is case-insensitive
  • •Searches title, content, and filename fields
  • •Content preview limited to 200 characters
  • •Only searches your own pastes

Response Fields

isExpiredPaste has passed expiration date
isBurnedBurn-after-read was triggered
availableCan still be accessed (not expired/burned)
previewFirst 200 chars (search only)

💡 Use Cases

📋 Content Management

View all your pastes in one place with pagination

🔍 Quick Retrieval

Find specific code snippets or notes instantly

📊 Organization

Filter by type, language, or locked status

🔐 Security Audit

Review locked pastes and expiration dates

Dashboard Analytics
GET

Get comprehensive analytics and statistics for your pastes including views, storage, and activity timeline.

GET /api/dashboard/stats
curl -X GET https://quickpaste.rescub.com/api/dashboard/stats \
  -H "X-API-Key: your_api_key_here"
{
  "overview": {
    "totalPastes": 150,
    "totalViews": 3240,
    "storageUsed": "12.5 MB",
    "storageBytes": 13107200,
    "averageViews": 21.6
  },
  "recentActivity": [
    {
      "id": "abc123",
      "type": "CODE",
      "title": "My Function",
      "language": "javascript",
      "views": 45,
      "createdAt": "2025-10-27T10:00:00.000Z",
      "expiresAt": "2025-11-27T10:00:00.000Z",
      "isExpired": false
    }
  ],
  "topPastes": [
    {
      "id": "xyz789",
      "type": "TEXT",
      "title": "Popular Post",
      "views": 523,
      "createdAt": "2025-10-20T10:00:00.000Z"
    }
  ],
  "distribution": {
    "byType": [
      { "type": "TEXT", "count": 50 },
      { "type": "CODE", "count": 35 },
      { "type": "IMAGE", "count": 20 }
    ]
  },
  "timeline": [
    {
      "date": "2025-10-27",
      "pastes": 5,
      "views": 120
    }
  ]
}

Analytics Features

  • •Overview: Total pastes, views, storage usage, and averages
  • •Recent Activity: Last 10 pastes with expiration status
  • •Top Pastes: 10 most viewed pastes
  • •Distribution: Paste count grouped by type
  • •Timeline: 30-day activity history with daily paste creation and views

QR Code Generation
GET

Generate QR codes for paste URLs. Supports PNG and SVG formats with customizable size and colors.

GET /api/qr/:pasteId
ParameterTypeDefaultDescription
formatstringpngFormat: "png" or "svg"
sizenumber300Size in pixels (200-1000)
darkstring#000000Dark color (hex format)
lightstring#ffffffLight color (hex format)
curl https://quickpaste.rescub.com/api/qr/abc123?format=png&size=500 > qrcode.png
curl https://quickpaste.rescub.com/api/qr/abc123?format=svg&size=400&dark=%232DD4BF&light=%230F172A > qrcode.svg

QR Code Features

  • •Cached with 1-year expiration for performance
  • •Medium error correction level (can recover from ~15% damage)
  • •Supports both PNG (raster) and SVG (vector) formats
  • •Customizable size (200-1000px) and colors

Raw Content Export
GET

Get the raw content of a paste as plain text. Perfect for downloading or piping to other commands.

GET /api/pastes/:id/raw
curl https://quickpaste.rescub.com/api/pastes/abc123/raw
curl https://quickpaste.rescub.com/api/pastes/abc123/raw > file.txt
curl -s https://quickpaste.rescub.com/api/pastes/abc123/raw | python3
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline; filename="paste.txt"
Cache-Control: no-cache

Raw Content Notes

  • •Returns plain text without HTML formatting
  • •Perfect for automation and command-line usage
  • •Respects expiration, burn-after-read, and password protection
  • •Returns 401 for password-protected pastes (use main API endpoint)

Locked Pastes & Status Tracking

Password-protected pastes and view analytics

Protected Content

Secure your pastes with password protection and track views, last accessed time, and availability status.

1. Create Locked Paste

Add a password field when creating a paste to automatically lock it.

POST
/api/pastes
Request Body
{
  "content": "My secret data",
  "password": "mySecurePassword123",
  "title": "Confidential Info",
  "type": "TEXT",
  "burnAfterRead": false,
  "expiresIn": "24h"
}
Response
200 OK
{
  "success": true,
  "paste": {
    "id": "abc123xyz",
    "url": "https://quickpaste.rescub.com/abc123xyz",
    "isLocked": true,
    "createdAt": "2025-10-27T14:30:00.000Z"
  }
}

2. Unlock Password-Protected Paste

Use this endpoint to unlock and retrieve the content of a locked paste by providing the correct password.

POST
/api/pastes/[id]/unlock
Request Body
{
  "password": "mySecurePassword123"
}
Success Response
200 OK
{
  "success": true,
  "paste": {
    "id": "abc123xyz",
    "content": "My secret data",
    "type": "TEXT",
    "title": "Confidential Info",
    "views": 5,
    "createdAt": "2025-10-27T14:30:00.000Z",
    "expiresAt": "2025-10-28T14:30:00.000Z",
    "burnAfterRead": false,
    "hasBeenRead": false
  }
}
Error Responses
401
Invalid password provided
410
Paste has expired or been burned

3. Get Paste Status & Analytics

Retrieve metadata and view statistics without accessing the content. Perfect for tracking and analytics.

GET
/api/pastes/[id]/status
Response
200 OK
{
  "success": true,
  "status": {
    "id": "abc123xyz",
    "type": "TEXT",
    "title": "Confidential Info",
    "views": 12,
    "lastViewedAt": "2025-10-27T16:45:30.000Z",
    "createdAt": "2025-10-27T14:30:00.000Z",
    "expiresAt": "2025-10-28T14:30:00.000Z",
    "isLocked": true,
    "isExpired": false,
    "isBurned": false,
    "available": true
  }
}
Status Fields
viewsTotal number of views
lastViewedAtTimestamp of last view
isLockedPassword protected
isExpiredPast expiration date
isBurnedBurn-after-read triggered
availableCan be accessed

💡 Use Cases

🔐 Secure File Sharing

Share sensitive data with password protection and expiration

📊 Analytics & Monitoring

Track how many times your paste has been viewed

🔥 One-Time Secrets

Combine password + burn-after-read for maximum security

⏰ Time-Limited Access

Set expiration with status tracking to monitor availability

Automatic View Tracking

Every time a paste is accessed (via GET or unlock), the system automatically:

  • •Increments the views counter
  • •Updates lastViewedAt timestamp
  • •Triggers paste.viewed webhook event

Authentication & Security

Security Measures

Password Hashing

All passwords are hashed using bcrypt with a cost factor of 10. Passwords are never stored or transmitted in plaintext.

Burn After Read

Pastes with burnAfterRead: true are automatically deleted after the first successful read. This is irreversible.

Warning: Once read, the paste is permanently deleted. There is no recovery option.

Rate Limiting

Password verification attempts are rate-limited to prevent brute-force attacks:

  • Maximum 5 attempts per IP per paste per hour
  • Exponential backoff after failed attempts
  • Automatic IP blocking after 10 failed attempts
🔒 Security Best Practices
  • Always use HTTPS for API requests
  • Use strong, unique passwords for sensitive pastes
  • Enable burn-after-read for highly sensitive content
  • Set appropriate expiration times
  • Never share paste URLs with passwords in query parameters

Error Handling

The API uses conventional HTTP response codes to indicate success or failure.

CodeStatusDescription
200OKRequest succeeded
201CreatedPaste created successfully
400Bad RequestInvalid request parameters
401UnauthorizedPassword required or incorrect
404Not FoundPaste not found or expired
410GonePaste has been burned (deleted after read)
429Too Many RequestsRate limit exceeded
500Server ErrorInternal server error
{
  "success": false,
  "error": "Paste not found",
  "code": "PASTE_NOT_FOUND"
}