Partner API · v1
StakTunes developers
Metadata discovery and reviewed distributor delivery. Base path: /api/public/v1 on your StakTunes host. Use an administrator-issued key for partner integration.
Authentication
Authorization: Bearer $STAKTUNES_API_KEYAn administrator creates a key with read and/or write scopes. The full key appears once; only its SHA-256 hash is stored. Write keys are limited to administrator-approved artist IDs. Revoked keys cannot make new requests. Keep keys on your server, not in browser apps or public repositories.
Endpoints
GET /api/public/v1/tracks
Scope: read
Published tracks. Optional q (title, artist or genre), genre, limit (1–100, default 25), offset (default 0).
GET /api/public/v1/tracks/{id}
Scope: read
One published track by UUID. Unpublished and missing tracks return 404.
GET /api/public/v1/artists/{id}
Scope: read
Artist ID, display name, bio and published tracks. Optional limit and offset. Artists without published releases return 404.
POST /api/public/v1/releases
Scope: write
Multipart metadata, audio and cover. Existing non-demo, authorized artist required. Always pending review.
Catalog responses include per-song play_count (full measured listens; previews, seeks, self-plays and rapid repeats excluded) and download_count (verified MP3 deliveries since November 26, 2026). Historical play totals may include the earlier partial-listen rule; prior downloads cannot be attributed per song. A download means delivery by StakTunes, not proof of saving to a device. Responses contain metadata only: no MP3 paths, cover paths or private storage URLs. Lists return data and pagination with limit, offset and total.
Read example
curl "$STAKTUNES_HOST/api/public/v1/tracks?q=jazz&limit=10" \
-H "Authorization: Bearer $STAKTUNES_API_KEY"Submit a release
MP3 maximum: 20 MB. JPEG, PNG or WebP cover maximum: 5 MB. Total multipart submission: 26 MB. Metadata must be a JSON string under 8 KB. Both files are required. Artist and files are validated before storage.
curl -X POST "$STAKTUNES_HOST/api/public/v1/releases" \
-H "Authorization: Bearer $STAKTUNES_API_KEY" \
-F 'metadata={"artist_id":"YOUR_ARTIST_UUID","title":"New release","genre":"Jazz","price_cents":99,"allow_download":true,"preview_enabled":true,"rights_confirmed":true,"policies_accepted":true,"legal_responsibility_confirmed":true,"disclosure":{"usedAi":false,"aiParts":[],"isRealVoice":true,"wroteLyrics":true,"releasedElsewhere":false,"externalReleaseUrl":"","recordingType":"home"}}' \
-F 'audio=@release.mp3;type=audio/mpeg' \
-F 'cover=@cover.jpg;type=image/jpeg'Optional fields: duration_seconds (1–86,400), external_release_id (up to 200 characters) and isrc (12-character ISRC). Price defaults to 99 US cents. Rights, legal responsibility and policy confirmations must be true. The disclosure object is required on every submission; AI use needs at least one of vocals, instrumental or lyrics, and an elsewhere release needs its URL. review the Terms and Copyright policy. A 201 response returns the ID, title, artist ID and status: "pending_review". An administrator approves it in Administration; it is stored as hidden until approval. Do not retry a successful submission; v1 does not deduplicate deliveries.
Errors and limits
{"error":{"code":"insufficient_scope","message":"This endpoint requires the write scope."}}400 invalid fields · 401 missing, invalid or revoked key · 403 scope or artist denial · 404 unpublished or missing resource · 405 method not allowed · 413 oversized upload · 415 unsupported file · 429 rate limit exceeded · 500/503 temporary failure. Authenticated responses are not cached. OPTIONS supports cross-origin preflight.
Each valid key allows 60 requests per 60-second window, shared across endpoints and servers. Scope-denied requests count; invalid or revoked keys and OPTIONS preflight do not. Excess requests return 429 with error code rate_limit_exceeded and a Retry-After header in seconds. Wait that long before retrying. If the counter is unavailable, requests return 503 rather than bypassing the limit.