Developer API

API Documentation

Integrate with WISP programmatically. All endpoints return JSON.

Authentication: Most endpoints require a valid session cookie. API endpoints marked Auth require login. Send Accept: application/json header for JSON responses.

Pastes

POST /create Optional Auth
Create a new paste. Send as form POST or JSON with Accept: application/json.
Request body
{ "title": "My Paste", "content": "Hello world", "language": "plaintext", "visibility": "Public", "security_mode": "none", "expiration": "forever", "burn_after_read": 0 }
Response
{ "success": true, "id": "aBcDeFgH", "url": "https://wisp.cx/p/aBcDeFgH" }

User Profile

GET /api/user/profile Auth
Get current authenticated user's profile.
Response
{ "success": true, "user": { "id": 1, "username": "alice", "vip_plan": "premium", ... } }
GET /api/profile/{username}
Get public profile by username.
GET /api/user/contacts Auth
Get current user's contact information.
POST /api/user/contacts Auth
Update contact information.

Customizations

GET /api/user/customizations Auth
Get current user's VIP customization settings.
POST /api/user/customizations Auth
Save customization settings (nickname color, glow, badge, etc).
POST /api/user/customizations/reset Auth
Reset customizations to defaults.

Favorites

GET /api/favorites Auth
Get list of favorited pastes for current user.
POST /api/favorites/toggle Auth
Add or remove a paste from favorites.
Request body
{ "paste_id": "aBcDeFgH" }
Response
{ "success": true, "favorited": true }

VIP

POST /api/vip/activate Auth
Activate a VIP code for the current user.
Request body
{ "code": "WISP-XXXX-XXXX" }
Response
{ "success": true, "expires_at": "2025-06-01 00:00:00", "days": 30 }

Admin

POST /api/admin/vip-codes/generate Admin
Generate new VIP activation codes.
Request body
{ "plan": "premium", "duration_days": 30, "quantity": 5 }
GET /api/admin/vip-codes Admin
List all generated VIP codes.