API

API routes

REST endpoints are defined in api/src/routes/ and mounted under /api. On Vercel, the frontend calls same-origin paths; locally, Nuxt devProxy forwards to the Express server.

Conventions

  • JSON request/response bodies
  • Auth via Authorization: Bearer <jwt>
  • Errors return JSON with appropriate HTTP status codes
  • Producer-only routes require PRODUCER role
  • Static media at /storage/* and /audio/* (not under /api)

Health

MethodPathDescriptionAuth
GET/health

API liveness check

API liveness checkPublic
GET/health/ffmpeg

ffmpeg/ffprobe availability for audio processing

ffmpeg/ffprobe availability for audio processingPublic

Auth

MethodPathDescriptionAuth
POST/api/auth/register

Register with email and password

Register with email and passwordPublic
POST/api/auth/login

Login with email and password

Login with email and passwordPublic
GET/api/auth/me

Current authenticated user

Current authenticated userUser
PUT/api/auth/profile

Update profile fields

Update profile fieldsUser
POST/api/auth/forgot-password

Request password reset email

Request password reset emailPublic
POST/api/auth/reset-password

Reset password with token

Reset password with tokenPublic
GET/api/auth/google

Start Google OAuth flow

Start Google OAuth flowPublic
GET/api/auth/google/callback

Google OAuth callback

Google OAuth callbackPublic

Beats

MethodPathDescriptionAuth
GET/api/beats

List beats with filters, search, pagination

List beats with filters, search, paginationPublic
GET/api/beats/stats

Aggregate marketplace stats

Aggregate marketplace statsPublic
GET/api/beats/:slugOrId

Beat detail by slug or ID

Beat detail by slug or IDPublic
POST/api/beats

Create beat draft

Create beat draftProducer
POST/api/beats/upload

Upload beat files (audio + cover)

Upload beat files (audio + cover)Producer
PUT/api/beats/:id

Update beat metadata

Update beat metadataUser
POST/api/beats/:id/publish

Publish beat

Publish beatProducer
POST/api/beats/:id/like

Like beat

Like beatUser
POST/api/beats/:id/favorite

Toggle favorite

Toggle favoriteUser
GET/api/beats/:id/download

Download purchased or free beat

Download purchased or free beatPublic
DELETE/api/beats/:id

Delete beat

Delete beatUser

Users & producers

MethodPathDescriptionAuth
GET/api/users/producers

List producers

List producersPublic
GET/api/users/:identifier

Public producer profile

Public producer profilePublic
GET/api/users/:identifier/beats

Beats by producer

Beats by producerPublic
PUT/api/users/me

Update account (avatar upload)

Update account (avatar upload)User
GET/api/users/me/beats

Current user beats

Current user beatsUser
GET/api/users/me/favorites

Current user favorites

Current user favoritesUser
GET/api/users/me/analytics

Producer analytics

Producer analyticsUser
POST/api/users/:identifier/follow

Follow producer

Follow producerUser

Purchases

MethodPathDescriptionAuth
GET/api/purchases/:purchaseId/download

Download purchased beat files

Download purchased beat filesUser
GET/api/users/me/purchases

Current user purchase history

Current user purchase historyUser

Messages

MethodPathDescriptionAuth
GET/api/messages/conversations

List conversations

List conversationsUser
GET/api/messages/conversations/:userId

Messages with a user

Messages with a userUser
POST/api/messages/send

Send message

Send messageUser
PUT/api/messages/:messageId/read

Mark message read

Mark message readUser
GET/api/messages/notifications

Notification feed

Notification feedUser

Comments

MethodPathDescriptionAuth
GET/api/comments/beats/:beatId

Comments on a beat

Comments on a beatPublic
POST/api/comments/beats/:beatId

Post comment

Post commentUser
DELETE/api/comments/:id

Delete comment

Delete commentUser

Admin

MethodPathDescriptionAuth
GET/api/admin/stats

Platform statistics

Platform statisticsAdmin
GET/api/admin/users

List users

List usersAdmin
GET/api/admin/beats

List beats (moderation)

List beats (moderation)Admin
GET/api/admin/settings

Platform settings

Platform settingsAdmin
PUT/api/admin/settings

Update platform settings

Update platform settingsAdmin