Skip to main content

API Overview

BandMate exposes a RESTful API from the Express backend. All endpoints are prefixed with /api.

Base URL

http://localhost:3000/api

In production, replace with your configured APP_URL.

Authentication

Most endpoints require authentication. BandMate uses JWT tokens:

  • Access Token -- Short-lived token sent in the Authorization header
  • Refresh Token -- Long-lived token used to obtain new access tokens
  • Cookies -- Used for WebSocket authentication

Headers

Authorization: Bearer <access_token>
Content-Type: application/json

Token Refresh

When an access token expires, the client automatically requests a new one using the refresh token. This happens transparently via an Axios interceptor.

Response Format

Successful responses return JSON:

{
"data": { ... },
"message": "Success"
}

Error responses:

{
"error": "Error description",
"statusCode": 400
}

Rate Limiting

API endpoints are rate-limited to prevent abuse. If you exceed the limit, you'll receive a 429 Too Many Requests response.

Core API Groups

GroupBase PathDescription
Authentication/api/authLogin, register, refresh tokens, OAuth
Projects/api/projectsCRUD operations on projects, vibes, cuts
Files/api/filesUpload, download, share, storage info
Comments/api/commentsTimestamped comments and replies
Real-timeWebSocketSocket.io events and channels

Common Status Codes

CodeMeaning
200Success
201Created
400Bad request (validation error)
401Unauthorized (missing or invalid token)
403Forbidden (insufficient permissions)
404Not found
429Rate limited
500Server error