PasteFox API Reference
Complete reference for the PasteFox REST API. Create, manage, and share code snippets programmatically.
https://api.pastefox.com/v1https://api.pastefox.com/v2Authentication
Include your API key in every authenticated request via one of these headers:
Header (recommended)
X-API-Key: pk_your_api_key_here
Bearer token
Authorization: Bearer pk_your_api_key_here
Anonymous Paste Creation
You can create pastes without an API key, but they are forced PUBLIC, expire in max 7 days, and cannot be edited or deleted.
Get your API key: Dashboard → API Keys
Rate Limiting
Global
200 / 60s
Paste create
30 / 10min
Paste read
120 / min
Response headers on 429 Too Many Requests:
X-RateLimit-RemainingRemaining requests in current windowX-RateLimit-ResetISO 8601 timestamp when window resetsRetry-AfterSeconds until you can retryRepeated violations will auto-revoke your API key.
Response Format
Success (v1)
{
"success": true,
"data": { ... }
}
Error
{
"success": false,
"error": "Validation failed",
"details": [
{ "field": "content", "message": "Required" }
]
}
Pastes
/pastesoptionalCreate a paste
Works with or without an API key. Anonymous pastes are forced PUBLIC and expire in max 7 days.
Request body
contentrequiredPaste content (required, min 1 char)
titlePaste title
languageLanguage for syntax highlighting (auto-detected if omitted)
visibilityPUBLIC, PRIVATE, or UNLISTED
passwordPassword-protect the paste (4–100 chars)
expiresAtExpiration date. Anonymous: max 7 days
maxViewsAuto-delete after N views (min 1)
isOneTimeViewDelete after first view
effectVisual reveal effect
folderIdPlace in a folder (requires API key)
Example
curl -X POST "https://api.pastefox.com/v1/pastes" \
-H "Content-Type: application/json" \
-H "X-API-Key: pk_your_key" \
-d '{"content": "Hello!", "title": "My Paste", "visibility": "PUBLIC"}'
201 — Created
{
"success": true,
"data": {
"slug": "abc123",
"title": "My Paste",
"visibility": "PUBLIC",
"viewCount": 0,
"createdAt": "2026-04-03T12:00:00.000Z"
}
}
400 — Validation error
401 — Auth required (when using folderId)
/pasteskey requiredList your pastes
Returns a paginated list of your own pastes.
Query parameters
pagePage number
limitItems per page (1–100)
searchSearch in title and content
visibilityFilter by PUBLIC, PRIVATE, or UNLISTED
languageFilter by language
folderIdFilter by folder
sortBycreatedAt, viewCount, title, updatedAt
sortOrderasc or desc
200 — Paginated list
{
"success": true,
"data": {
"items": [...],
"total": 42,
"page": 1,
"limit": 20,
"totalPages": 3
}
}
/pastes/{slug}optionalGet paste by slug
Public/unlisted pastes readable without auth. Private pastes require the owner's API key. Password-protected pastes return 423 with partial data.
slugrequiredPaste slug (from URL)
200 — Paste data
403 — Private paste — not your paste
404 — Not found or deleted
410 — Expired or max views reached
423 — Password required
{
"success": true,
"data": {
"slug": "abc123",
"title": "Secret",
"hasPassword": true,
"content": null
}
}
/pastes/{slug}key requiredUpdate a paste
Only the owner can update. Send only the fields you want to change.
titleNew title (max 100 chars)
contentNew content (min 1 char)
languageNew language
visibilityPUBLIC, PRIVATE, or UNLISTED
passwordSet password (4–100 chars) or null to remove
expiresAtSet or remove expiration
maxViewsSet or remove max views
effectChange visual effect
allowCloneAllow other users to clone
200 — Updated paste
403 — Not your paste
404 — Not found
/pastes/{slug}key requiredDelete a paste
Soft-deletes the paste. Only the owner can delete.
200 — Deleted
{
"success": true,
"data": { "slug": "abc123", "deleted": true }
}
403 — Not your paste
404 — Not found
/pastes/{slug}/rawoptionalGet raw content
Returns the paste content as plain text (text/plain). Same access rules as GET /pastes/{slug}.
200 — Raw text content
403 — Private paste
423 — Password required
/pastes/{slug}/verifypublicVerify paste password
Submit the password to unlock a password-protected paste. Returns full paste data on success.
passwordrequiredThe paste password
Example
curl -X POST "https://api.pastefox.com/v1/pastes/abc123/verify" \
-H "Content-Type: application/json" \
-d '{"password": "mysecret"}'
200 — Password correct — full paste data
400 — Password field missing
401 — Wrong password
404 — Not found or no password set
/pastes/{slug}/clonekey requiredClone a paste
Creates a copy of the paste under your account. Cannot clone private pastes from other users or pastes with cloning disabled.
201 — Cloned paste
403 — Cloning not allowed or private paste
/pastes/{slug}/likekey requiredLike or dislike a paste
Toggle like/dislike. Calling again with the same value removes it.
isDislikeSet to true for dislike
200 — Action result
{
"success": true,
"data": { "action": "liked" }
}
Folders
/folderskey requiredList your folders
Returns all folders with paste and children counts, ordered by sortOrder.
200 — Folder list
{
"success": true,
"data": [
{
"id": "clx...",
"name": "JavaScript",
"slug": "javascript-a1b2",
"visibility": "PRIVATE",
"_count": { "pastes": 12, "children": 2 }
}
]
}
/folderskey requiredCreate a folder
Max 50 folders per user.
namerequiredFolder name (1–100 chars)
descriptionDescription (max 500 chars)
colorColor code (max 20 chars)
iconIcon name (max 50 chars)
visibilityPUBLIC or PRIVATE
parentIdParent folder ID for nesting
201 — Folder created
400 — Validation error
403 — Folder limit reached (max 50)
/folders/{id}key requiredGet folder with pastes
Returns the folder details including its pastes and children count.
idrequiredFolder ID
200 — Folder with pastes
404 — Not found
/folders/{id}key requiredUpdate a folder
Only send the fields you want to change.
nameNew name (1–100 chars)
descriptionNew description
colorNew color
iconNew icon
visibilityPUBLIC or PRIVATE
200 — Updated
404 — Not found
/folders/{id}key requiredDelete a folder
Permanently deletes the folder. Pastes inside are not deleted, they become unfoldered.
idrequiredFolder ID
200 — Deleted
404 — Not found
Explore & Public Endpoints
/explorepublicBrowse public pastes
Returns paginated public pastes. Only shows pastes without passwords.
pagePage number
limitItems per page (1–50)
sortnewest, oldest, or popular
languageFilter by language
searchSearch in title
200 — Public paste list
/users/public/{username}publicGet public user profile
Returns public profile info. Only works for users with public profiles enabled.
usernamerequiredUsername
200 — Public profile
{
"success": true,
"data": {
"username": "johndoe",
"name": "John",
"bio": "Developer",
"profileViews": 142,
"_count": { "pastes": 28 }
}
}
404 — Not found or profile is private
/users/public/{username}/pastespublicGet user's public pastes
Paginated list of a user's public pastes.
usernamerequiredUsername
pagePage number
limitItems per page (1–50)
200 — Public paste list
404 — Profile not found
/healthpublicHealth check
200 — Healthy
{
"status": "healthy",
"timestamp": "2026-04-03T12:00:00.000Z"
}
503 — Unhealthy (database down)
/statspublicPlatform statistics
200 — Stats
{
"success": true,
"data": {
"totalPastes": 15420,
"totalUsers": 3200,
"totalViews": 892000,
"languages": 130
}
}
Users
/users/mekey requiredGet your own profile
Returns your full profile including paste, folder, and API key counts.
200 — Your profile
{
"success": true,
"data": {
"id": "clx...",
"email": "[email protected]",
"username": "yourname",
"role": "USER",
"emailVerified": true,
"_count": { "pastes": 42, "folders": 5, "apiKeys": 2 }
}
}
Paste Effects
Set via the effect field when creating or updating a paste.
NONESCRATCHMATRIXGLITCHCONFETTIPUZZLESLOTSSHAKEPASSWORDFIREWORKSTYPEWRITERBLURV2 API Differences
V2 uses the same paths under /api/v2 with these changes:
Response envelope
{ data, meta, error } instead of { success, data, error }
Cursor pagination
Use cursor param for efficient paging. Response includes nextCursor in meta.
Search param
Use q instead of search
Sort param
Use sort with - prefix for desc, e.g. -createdAt (replaces sortBy + sortOrder)
Burn after read
burnAfterRead replaces isOneTimeView
Password paste
423 returns error hint only, no partial data
V2 list response example
{
"data": [...],
"meta": {
"total": 42,
"page": 1,
"limit": 20,
"hasMore": true,
"nextCursor": "clx..."
}
}