API Reference
Complete reference for the Trenches API.
Available Endpoints
- Authentication - Learn how to authenticate with the API
- Endpoints - Full list of API endpoints
- Webhooks - Real-time event notifications
Quick Start
Authentication
> The Spray and Play API uses session-based authentication for most endpoints,
> with API key support for metrics and admin operations. JWT token authentication is planned for v2.
Authentication Methods
1. Session-Based Authentication (Default)
Most API endpoints use cookie-based sessions via Supabase Auth. The browser handles this automatically:
// Include credentials for all authenticated requests
const response = await fetch('/api/user', {
cred...