Authentication
All API requests require an API key passed via the X-Api-Key header.
curl -H "X-Api-Key: sk_live_your_key" \
https://sponzar.africa/api/v1/content
Get your API key from the admin panel → API Keys.
Webhooks
Register endpoints to receive real-time notifications:
payment.completed — A payment was processed
subscription.created — A new subscription started
content.published — New content was posted
campaign.completed — A campaign finished
Webhooks include an X-Sponzar-Signature header (HMAC-SHA256) for verification.
Inline Purchase Flow (No Redirect!)
Purchases happen entirely on your website via API calls — users never leave your site. Here's the full flow:
Step 1: Fetch content and check lock status
GET /api/v1/content/{id}
// Response includes: "locked": "yes", "price": 25.00
Step 2: Show paywall on your site if locked: "yes"
// Your frontend shows a "Buy" button with the price
Step 3: User clicks Buy → your backend calls the purchase API
POST /api/v1/payments
{ "user_id": 42, "amount": 25.00, "type": "ppv", "target_id": 99 }
Step 4: On success, fetch the stream URL
GET /api/v1/content/99/stream?user_id=42
// Returns: { "video_url": "https://...", "hls_url": "https://..." }
Step 5: Display the unlocked content on your site
The same flow works for episodes:
// Check episode lock status
GET /api/v1/series/42/episodes?user_id=123
// Episode shows "is_unlocked": false, "price": 15.00
// Purchase episode
POST /api/v1/series/42/episodes/99/purchase
{ "user_id": 123, "purchase_type": "episode" }
// Or buy the full season pass
POST /api/v1/series/42/episodes/99/purchase
{ "user_id": 123, "purchase_type": "series_pass" }
// Stream the unlocked episode
GET /api/v1/series/42/episodes/99/stream?user_id=123
Subscriptions also work inline:
POST /api/v1/subscriptions
{ "user_id": 42, "creator_id": 7, "plan_interval": "monthly" }
💡 Key point: All payments are processed through the user's Sponzar wallet. No payment gateway integration needed on your site — Sponzar handles all the payment processing.
Rate Limiting
Each API key has a per-minute rate limit (default: 60 req/min). Exceeding it returns 429 Too Many Requests.