API reference

Afterglow Platform API

Version 1 · A production-shaped contract for the mocked local data layer.

Introduction

The API uses predictable resource URLs, JSON request bodies, standard HTTP response codes, and cursor-based pagination. These contracts document intended behavior without sending network requests.

Base URL
https://api.afterglow.local/v1

Authentication

Pass a scoped bearer token with each request.

Authorization: Bearer ag_live_••••••••
Content-Type: application/json

Audio endpoints

GET/v1/tracksList visible audio releases
POST/v1/tracksCreate an audio record
PATCH/v1/tracks/:idUpdate metadata or status
DELETE/v1/tracks/:idRemove a catalog record
GET/v1/analytics/listeningRetrieve listening totals
Create a track
{
  "title": "Satellites at 2AM",
  "kind": "unreleased",
  "status": "published"
}
200 response
{
  "id": "trk_01J9P",
  "title": "Satellites at 2AM",
  "visibility": "members",
  "created_at": "2026-08-25T09:30:00Z"
}

Errors

Errors use a stable shape with a machine-readable code, human-readable message, and request identifier for support.

{
  "error": {
    "code": "invalid_status_transition",
    "message": "A published track cannot return to scheduled.",
    "request_id": "req_8d12f"
  }
}