Overview
This guide helps developers understand the BeatPass technical environment, authentication model, and safe testing practices.Authentication Model
How Auth Works
BeatPass uses Laravel Sanctum for SPA (single-page application) authentication:| Component | Implementation |
|---|---|
| Session auth | Cookie-based sessions |
| API tokens | Not issued (no bearer tokens) |
| Third-party integrations | Not supported |
| CSRF protection | Required for POST/PUT/DELETE |
Cookie + CSRF Flow
For web applications:1
Get CSRF Cookie
XSRF-TOKEN cookie.2
Include CSRF Token
For POST/PUT/DELETE requests, include the token:
3
Authenticate
Submit credentials to the session login route shown in the Auth guide:
4
Make Authenticated Requests
Session cookies are automatically included in subsequent requests by the browser.
Example Request Flow
Send credentials with the CSRF token, then rely on browser-managed cookies for later calls:Environment
No Public Sandbox
This means:| Action | Impact |
|---|---|
| POST/PUT/DELETE requests | Real data is modified |
| Purchases | Real charges occur |
| Uploads | Real content is published |
| Messages | Real users receive messages |
Development Best Practices
| Practice | Why |
|---|---|
| Use personal test accounts | Avoid affecting real users |
| Test with minimal data | Don’t create spam content |
| Clean up test data | Delete test uploads promptly |
| Never test payments with real cards | Use Stripe test mode when available |
Testing Purchases
Stripe Test Mode
Contact your team lead to determine if Stripe test mode is enabled for your environment.
| Environment | Payment Behavior |
|---|---|
| Production | Real charges |
| Test mode (if enabled) | Stripe test cards accepted |
Test Card Numbers (Stripe Test Mode Only)
If test mode is available:| Card Number | Behavior |
|---|---|
4242 4242 4242 4242 | Succeeds |
4000 0000 0000 0002 | Declines |
4000 0000 0000 9995 | Insufficient funds |
Using Placeholder IDs
When developing or documenting:Recommended Placeholders
| Entity | Placeholder Format | Example |
|---|---|---|
| Track ID | {track_id} | /tracks/{track_id} |
| User ID | {user_id} | /users/{user_id} |
| Artist ID | {artist_id} | /artists/{artist_id} |
| Album ID | {album_id} | /albums/{album_id} |
In Code Examples
In Documentation
Restricted Access
The API only documents endpoints available to regular authenticated users. If you encounter a 403 Forbidden response, the endpoint requires permissions you don’t have.Safe API Usage
Do
- Use documented endpoints only
- Respect rate limits
- Handle errors gracefully
- Clean up test data
- Log responsibly (no sensitive data)
Don’t
- Scrape or crawl the platform
- Hammer endpoints with excessive requests
- Store user credentials
- Bypass authentication
- Share API tokens
Error Handling
Standard Error Format
HTTP Status Codes
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Process response |
| 201 | Created | Resource created |
| 400 | Bad Request | Fix request format |
| 401 | Unauthorized | Re-authenticate |
| 403 | Forbidden | Check permissions |
| 404 | Not Found | Resource doesn’t exist |
| 422 | Validation Error | Fix input data |
| 429 | Rate Limited | Back off and retry |
| 500 | Server Error | Report to support |
Getting Help
| Topic | Contact |
|---|---|
| API questions | [email protected] |
| Security concerns | [email protected] |
| Partnership inquiries | [email protected] |
Documentation
| Topic | Location |
|---|---|
| API Overview | /developers/overview |
| API Reference | /developers/api-reference/overview |
| Authentication | /developers/auth |
| Rate Limits | /developers/rate-limits |
| Error Catalog | /developers/error-catalog |
Checklist for New Developers
1
Get Access
- Obtain development account credentials
- Set up local environment
- Understand the session-based auth flow
2
Understand the Stack
- Laravel backend
- React frontend
- Laravel Sanctum auth
- Stripe for payments
3
Review Documentation
- Read API Overview
- Understand auth flow
- Note rate limits
- Review off-limits routes
4
Set Up Safe Testing
- Create test account(s)
- Use placeholder IDs in code
- Confirm test mode status for payments
- Plan for cleanup
5
Start Building
- Begin with read-only endpoints
- Test auth flow first
- Add mutations carefully
- Monitor rate limit headers