API Reference
Base URL: https://api.soldi.dev
Authentication
- JWT: Dashboard endpoints.
Authorization: Bearer <jwt> - API Key: Middleware endpoints.
X-API-Key: sk_live_...
Endpoints
| Method | Path | Auth | Description |
|---|
| POST | /api/auth/magic-link | None | Send magic link email |
| POST | /api/auth/verify | None | Verify magic link token, return JWT |
| GET | /api/auth/me | JWT | Get current publisher |
| GET | /api/publishers/me | JWT | Get publisher profile |
| PUT | /api/publishers/me | JWT | Update publisher profile |
| PUT | /api/publishers/me/wallet | JWT | Update wallet address |
| POST | /api/publishers/me/api-key | JWT | Regenerate API key |
| GET | /api/publishers/me/config | API Key | Get publisher config (middleware) |
| GET | /api/pricing/rules | JWT | List pricing rules |
| POST | /api/pricing/rules | JWT | Create pricing rule |
| PUT | /api/pricing/rules/:id | JWT | Update pricing rule |
| DELETE | /api/pricing/rules/:id | JWT | Delete pricing rule |
| GET | /api/pricing/resolve | API Key | Resolve price for path |
| POST | /api/payments/initiate | API Key | Record agent visit |
| POST | /api/payments/verify | API Key | Verify payment + record transaction |
| GET | /api/payments/history | JWT | Transaction history (paginated) |
| GET | /api/analytics/overview | JWT | Today's key metrics |
| GET | /api/analytics/revenue | JWT | Daily revenue time series |
| GET | /api/analytics/top-pages | JWT | Top earning pages |
| GET | /api/analytics/agents | JWT | Agent type breakdown |
Error Format
{
"error": "Human-readable error message",
"code": "MACHINE_READABLE_CODE"
}
Rate Limits
- Authenticated: 100 requests/minute
- Unauthenticated: 20 requests/minute
- Response headers:
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset