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
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
| Tier | Rate Limit | Price |
|---|---|---|
Free | 200 requests/day | $0 |
Pro | 10,000 requests/day | Coming Soon |
Enterprise | Unlimited | Coming 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/apiRate 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
| Tier | Daily Limit | Price |
|---|---|---|
| Free | 100 | $0/month |
| Premium | 500 | $3.99/month |
| Premium Pro | 2,000 | $8.99/month |
| Enterprise | 5,000 | $19.99/month |
| Enterprise Pro | 10,000 | $39.99/month |
| Admin | 100,000 | Admin 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 limitX-RateLimit-RemainingRequests remaining todayX-RateLimit-ResetWhen your limit resets (midnight UTC)Rate Limit Exceeded Response
{
"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
/api/user/usage{
"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 PastePOST
Create a new paste with text, code, or file content
POST /api/pastes| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The paste content (text, code, or base64 for files) |
type | string | No | Type: TEXT, CODE, IMAGE, VIDEO, AUDIO, FILE (default: TEXT) |
title | string | No | Optional title for the paste |
expiresIn | string | No | 1h, 24h, 7d, 30d, never (default: 24h) |
password | string | No | Password to protect the paste |
burnAfterRead | boolean | No | Self-destruct after first view (default: false) |
language | string | 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"
}'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"
}'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
}'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"
}'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 Paste Types
TEXT - Plain text contentCODE - Code with syntax highlightingIMAGE - PNG, JPEG, GIF, WebP, SVGVIDEO - MP4, WebM, MOV, AVIAUDIO - MP3, WAV, OGG, M4AFILE - Any other file typecurl -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 PastesPOST
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 PasteGET
Retrieve a paste by its ID (public or with password verification)
GET /api/pastes/:idcurl -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 PastePUT
Update an existing paste's content, title, language, or type. Only the paste owner can update.
PUT /api/pastes/:idAuthentication & 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 paste404 Not Found - Paste not found400 Bad Request - Content is requiredDelete PasteDELETE
Permanently delete a paste. This action cannot be undone.
DELETE /api/pastes/:idcurl -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.
/api/pastes/mineQuery 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/falsesortBySort field (default: createdAt)sortOrderasc or desc (default: desc)GET /api/pastes/mine?type=CODE&language=javascript&page=1&limit=20
{
"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.
/api/pastes/searchQuery Parameters
qSearch query (min 2 chars) *requiredtypeFilter by typelanguageFilter by languagepagePage numberlimitResults per pageGET /api/pastes/search?q=express&type=CODE&language=javascript
{
"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
💡 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 AnalyticsGET
Get comprehensive analytics and statistics for your pastes including views, storage, and activity timeline.
GET /api/dashboard/statscurl -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 GenerationGET
Generate QR codes for paste URLs. Supports PNG and SVG formats with customizable size and colors.
GET /api/qr/:pasteId| Parameter | Type | Default | Description |
|---|---|---|---|
| format | string | png | Format: "png" or "svg" |
| size | number | 300 | Size in pixels (200-1000) |
| dark | string | #000000 | Dark color (hex format) |
| light | string | #ffffff | Light color (hex format) |
curl https://quickpaste.rescub.com/api/qr/abc123?format=png&size=500 > qrcode.pngcurl https://quickpaste.rescub.com/api/qr/abc123?format=svg&size=400&dark=%232DD4BF&light=%230F172A > qrcode.svgQR 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 ExportGET
Get the raw content of a paste as plain text. Perfect for downloading or piping to other commands.
GET /api/pastes/:id/rawcurl https://quickpaste.rescub.com/api/pastes/abc123/rawcurl https://quickpaste.rescub.com/api/pastes/abc123/raw > file.txtcurl -s https://quickpaste.rescub.com/api/pastes/abc123/raw | python3Content-Type: text/plain; charset=utf-8
Content-Disposition: inline; filename="paste.txt"
Cache-Control: no-cacheRaw 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.
/api/pastes{
"content": "My secret data",
"password": "mySecurePassword123",
"title": "Confidential Info",
"type": "TEXT",
"burnAfterRead": false,
"expiresIn": "24h"
}{
"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.
/api/pastes/[id]/unlock{
"password": "mySecurePassword123"
}{
"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
3. Get Paste Status & Analytics
Retrieve metadata and view statistics without accessing the content. Perfect for tracking and analytics.
/api/pastes/[id]/status{
"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
💡 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
viewscounter - •Updates
lastViewedAttimestamp - •Triggers
paste.viewedwebhook 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.
| Code | Status | Description |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Paste created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Password required or incorrect |
404 | Not Found | Paste not found or expired |
410 | Gone | Paste has been burned (deleted after read) |
429 | Too Many Requests | Rate limit exceeded |
500 | Server Error | Internal server error |
{
"success": false,
"error": "Paste not found",
"code": "PASTE_NOT_FOUND"
}