🚀 API Documentation
PasteBin.site offers a powerful REST API to create, retrieve, and manage pastes programmatically.
🔑 Authentication
All API requests require an API Key. You can generate one in your Dashboard.
Pass your key in the header:
X-API-Key: YOUR_API_KEY_HERE
1. Create a Paste
POST /api/v1/pastes
curl -X POST https://pastebin.site/api/v1/pastes \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_KEY" \
-d '{
"title": "My Script",
"content": "echo Hello World",
"language": "bash",
"expiry": "7d"
}'
Expiry Options: 1h, 1d, 7d, 30d, 1y. (Admins can use 0 for Never).
2. Retrieve a Paste
GET /api/v1/pastes/{id}
curl https://pastebin.site/api/v1/pastes/abc123
3. Delete a Paste
DELETE /api/v1/pastes/{id} (Owner or Admin only)
curl -X DELETE https://pastebin.site/api/v1/pastes/abc123 \ -H "X-API-Key: YOUR_KEY"
⚡ Features
- ✅ Rate Limited: 60 requests per hour per key.
- ✅ JSON Responses: Clean, predictable data structures.
- ✅ Secure: Keys are hashed in our database; you only see them once.