Dropembed

API Documentation

Dropembed provides a REST API for integrating video hosting capabilities into your applications. All endpoints return JSON.

Authentication

Authentication uses JWT tokens stored in httpOnly cookies. First obtain a CSRF token, then include it in all state-changing requests.

GET/api/csrf

Get CSRF token required for state-changing requests.

{"success": true, "token": "abc123..."}
POST/api/auth/register

Create a new user account.

{"username": "string", "email": "string", "password": "string", "referral_code": "string (optional)"}
{"success": true, "referral_code": "ABC12345"}
POST/api/auth/login

Authenticate a user. Returns JWT cookie or 2FA challenge.

{"success": true} // or {"requires_2fa": true, "temp_token": "..."}
POST/api/auth/logout

Clear authentication cookie.

Videos

POST/api/videos/upload

Upload a video file. Send as multipart/form-data. Field name: video. Max 10GB.

{"success": true, "video_id": "uuid", "url": "/v/uuid"}
GET/api/videos?page=1&limit=20(auth)

List authenticated user's videos with pagination.

{"success": true, "videos": [...], "pagination": {"page": 1, "total": 50}}
GET/api/videos/:id

Get video details for a specific video.

POST/api/videos/:id/view

Record a video view. Max 4 views/IP/24h. Used for earnings calculation.

DELETE/api/videos/:id(auth)

Delete a video (owner only). Removes files from storage.

Earnings (requires auth)

GET/api/earnings

Get earnings summary: balance, total earned, withdrawals, transaction history.

{"success": true, "balance": 25.50, "total_earned": 100.00, "transactions": [...]}
POST/api/earnings/withdraw

Request a withdrawal. Minimum $15.00. Body: {"amount": 25.00, "address": "crypto_address"}.

Rate Limits

Register5 requests/hour per IP
Login10 requests/15min per IP
View tracking30 requests/min per IP+video
General API300 requests/15min per IP