VillifeDocs 55 endpoints

Villife API

The Villife REST API powers the web player, the desktop and iOS apps and Studio. It speaks JSON over HTTPS. This reference documents every endpoint of api.villife.org, plus the search host source.villife.org and the media host cdn.villife.org.

Base URL

HostPurpose
https://api.villife.orgAccounts, catalog, library sync, Studio and moderation.
https://source.villife.orgSearch, HLS streaming and artwork proxy.
https://cdn.villife.orgUploaded audio and covers.

Requests and responses are application/json; charset=utf-8 unless noted. Send Content-Type: application/json with a body.

Authentication

Signing in (/auth/login, /auth/email/verify, /auth/social or an approved QR session) creates a signed token valid for 30 days. You can present it in either way:

  • Cookie — session is set automatically (HttpOnly; Secure; SameSite=None). Browser clients must use credentials: "include".
  • Bearer token — send Authorization: Bearer <token>. Native apps and scripts should use this; the token is returned in the sign-in response body.

Signing out, changing the password or changing the email invalidates every token of the account at once.

Roles are user, artist, moderator and admin. Server-to-server tools may use X-Studio-Key or X-Admin-Key instead of a user session.

Auth badges. Each endpoint is tagged Public Session Studio or Admin.

CSRF protection

For browser requests (those with an Origin header or a session cookie), every POST, PUT, PATCH and DELETE must include an X-CSRF-Token header equal to the csrf cookie, or the API answers 403 invalid csrf token. Get one from GET /auth/csrf. Requests that carry a Bearer token, X-Admin-Key or X-Studio-Key skip this check.

JavaScript
const API = "https://api.villife.org";
const { token } = await (await fetch(API + "/auth/csrf", { credentials: "include" })).json();

await fetch(API + "/auth/email/request", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json", "X-CSRF-Token": token },
  body: JSON.stringify({ email: "[email protected]" })
});

Errors

Errors use a non-2xx status and a JSON body with a short machine-readable message:

401
{ "error": "unauthorized" }
StatusMeaning
400Invalid JSON, missing or malformed fields.
401Not signed in, bad token, wrong credentials or code.
403Signed in but not allowed, or invalid CSRF token.
404Unknown route or object.
409Conflict, such as an email that is already registered.
410A one-time code has expired.
429Rate limit exceeded.
503A required service (auth, email delivery) is not configured or is unavailable.

Rate limits

Limits are counted per client IP in a one-minute window: 30 requests to /auth/* and 60 to every other api.villife.org path. Some actions have tighter per-address limits (email codes: 3 requests and 5 verification attempts per minute). The search host allows 180 searches, 120 stream requests, 300 HLS requests and 240 image requests per minute. Exceeding a limit returns 429 {"error": "too many requests"}; wait a minute and retry.

Pagination and sorting

List endpoints accept limit (1–100, default 24) and offset. Where supported, sort selects one of the documented fields and order is asc or desc. Responses are plain JSON arrays.

CORS

Browsers may call the API from villife.org, web.villife.org, status.villife.org, docs.villife.org, source.villife.org, cdn.villife.org and from localhost. Allowed headers: Content-Type, Authorization, X-Admin-Key, X-Studio-Key, X-CSRF-Token. Credentials are allowed. Other origins can use the API with a Bearer token from non-browser clients.

Release status values

draft, pending review, approved, published, rejected.

System

#Service health

GET/healthPublic

Reports whether the API is up and whether its bindings (database and object storage) are available. The status page uses this endpoint.

Example

curl \
  'https://api.villife.org/health'

Response

200
{
  "ready": true,
  "r2": true,
  "db": true
}

Status codes

CodeDescription
200The worker is running. r2 and db are false when the binding is missing.

Authentication

Villife supports email codes, passwords and Microsoft. A successful sign-in sets the session cookie and returns the same token in the body.

#Get a CSRF token

GET/auth/csrfPublic

Returns a random token and sets it in the csrf cookie (24 h, Secure; SameSite=None). Browsers must echo the token in the X-CSRF-Token header on every POST, PUT, PATCH and DELETE. Requests that carry Authorization: Bearer, X-Admin-Key or X-Studio-Key are exempt.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Example

curl \
  'https://api.villife.org/auth/csrf'

Response

200
{
  "token": "9f2c…"
}

Status codes

CodeDescription
200Token issued.

#Get Microsoft sign-in configuration

GET/auth/configPublic

Returns the public Microsoft application settings used to start the OAuth (PKCE) flow in the browser.

Example

curl \
  'https://api.villife.org/auth/config'

Response

200
{
  "clientId": "00000000-0000-0000-0000-000000000000",
  "tenant": "common"
}

Status codes

CodeDescription
200Configuration returned. Values are empty strings when Microsoft sign-in is not configured.

#Register with a password

POST/auth/registerPublic

Creates an unverified account and emails a 6-digit code. Verify it with POST /auth/email/verify before signing in with a password.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
emailrequiredstringA valid email address. Stored lower-case.
passwordrequiredstring8–128 characters.
displayNamestringUp to 80 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/register' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]", "password": "correct horse battery"}'

Response

200
{
  "id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "email": "[email protected]",
  "displayName": "You",
  "needsVerification": true,
  "sent": true
}

Status codes

CodeDescription
200Account created.
400Invalid email or password length (invalid credentials) or invalid JSON.
409email already registered.
503auth unavailable.

#Sign in with a password

POST/auth/loginPublic

Signs in and sets the session cookie (HttpOnly, 30 days). The same token is returned in the body so native clients can use it as a Bearer token. The email field also accepts a display name or a user id.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
emailrequiredstringEmail, display name or user id.
passwordrequiredstringThe account password.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/login' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]", "password": "correct horse battery"}'

Response

200
{
  "id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "email": "[email protected]",
  "displayName": "You",
  "role": "user",
  "token": "eyJzdWIiOi…<signature>"
}

Status codes

CodeDescription
200Signed in. Set-Cookie: session=….
401invalid credentials.
403email not verified — the body also contains email.
429Rate limit.
503auth unavailable.

#Request a sign-in code

POST/auth/email/requestPublic

Emails a 6-digit one-time code, valid for 10 minutes. Works for new and existing addresses — verifying a code for an unknown email creates the account. Limited to 3 requests per minute per address and IP.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
emailrequiredstringA valid email address.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/email/request' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]"}'

Response

200
{
  "sent": true
}

Status codes

CodeDescription
200Code sent.
400invalid email.
429too many requests.
503email delivery unavailable.

#Verify a sign-in code

POST/auth/email/verifyPublic

Exchanges the emailed code for a session. Creates the account on first use and marks the email as verified. The code is single-use. Limited to 5 attempts per minute per address and IP.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
emailrequiredstringThe address the code was sent to.
coderequiredstringThe 6-digit code.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/email/verify' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]", "code": "123456"}'

Response

200
{
  "id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "email": "[email protected]",
  "displayName": "You",
  "role": "user",
  "token": "eyJzdWIiOi…<signature>"
}

Status codes

CodeDescription
200Signed in. Set-Cookie: session=….
401invalid code.
410code expired.
429too many attempts.

#Sign in with Microsoft

POST/auth/socialPublic

Accepts a Microsoft id_token obtained through the PKCE flow, verifies its signature, audience, tenant, issuer and expiry, creates the account if needed and signs in.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
idTokenrequiredstringThe Microsoft ID token (JWT, RS256).

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/social' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"idToken": "<id_token>"}'

Response

200
{
  "id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "email": "[email protected]",
  "displayName": "You",
  "role": "user",
  "token": "eyJzdWIiOi…<signature>"
}

Status codes

CodeDescription
200Signed in.
401invalid token.
503auth unavailable.

#Get the signed-in user

GET/auth/meSession

Returns the account for the current session cookie or Bearer token.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Example

curl \
  'https://api.villife.org/auth/me' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
{
  "id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "email": "[email protected]",
  "displayName": "You",
  "role": "user"
}

Status codes

CodeDescription
200The current user.
401unauthorized — no session, an invalid token or a signed-out token.

#Sign out

POST/auth/logoutPublic

Invalidates every token of the account (the user's token_version is incremented) and clears the session and csrf cookies.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/logout'

Response

200
{
  "signedOut": true
}

Status codes

CodeDescription
200Signed out.

#Request a password reset code

POST/auth/password/reset/requestPublic

Emails a 6-digit code valid for 10 minutes. The response does not reveal whether the address has an account. Limited to 3 requests per minute.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
emailrequiredstringA valid email address.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/password/reset/request' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]"}'

Response

200
{
  "sent": true
}

Status codes

CodeDescription
200sent is false if the email could not be delivered.
400invalid email.
429too many requests.

#Reset the password

POST/auth/password/reset/confirmPublic

Sets a new password using the emailed code and invalidates all existing sessions.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
emailrequiredstringThe account email.
coderequiredstringThe 6-digit code.
passwordrequiredstringThe new password, 8–128 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/password/reset/confirm' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]", "code": "123456", "password": "correct horse battery"}'

Response

200
{
  "reset": true
}

Status codes

CodeDescription
200Password changed.
400invalid credentials — bad password length.
401invalid code.
404not found.
410code expired.
429too many attempts.

QR sign-in

QR sign-in lets a desktop or browser sign in by scanning a code with a phone that is already signed in. Flow: create → show QR → poll status → the phone calls approve → the next poll returns approved and sets the cookie.

#Create a QR sign-in session

POST/auth/qr/createPublic

Starts a sign-in session for a device that wants to be approved from a phone. The session lives for 5 minutes. Encode https://villife.org/qr/?session=<session>&device=<device> in the QR code.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
devicestringHuman-readable device name, up to 120 characters. Default Unknown device.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/qr/create' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{}'

Response

200
{
  "session": "4f1b…e2",
  "device": "Windows 11",
  "expires": 1796040000000
}

Status codes

CodeDescription
200expires is a Unix timestamp in milliseconds.

#Poll a QR session

GET/auth/qr/statusPublic

Returns the state of a QR session. When it becomes approved, the response also sets the session cookie on the polling device — poll with credentials: "include" and then call GET /auth/me. The token is never placed in the body. Poll roughly once a second.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Query parameters

NameTypeDescription
sessionrequiredstringThe session value from /auth/qr/create.

Example

curl \
  'https://api.villife.org/auth/qr/status?session=<session>'

Response

200
{
  "status": "pending",
  "device": "Windows 11"
}

status is one of pending, approved, denied or expired.

Status codes

CodeDescription
200Current state.
404not found.

#Approve or deny a QR session

POST/auth/qr/approveSession

Called from the phone that scanned the code and is already signed in. Approving mints a 30-day session for the waiting device.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
sessionrequiredstringThe session id from the QR code.
decisionrequiredstringapprove or deny.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/qr/approve' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"session": "<session>", "decision": "approve"}'

Response

200
{
  "status": "approved"
}

Status codes

CodeDescription
200Decision stored.
400invalid decision.
401unauthorized.
404not found.
409session unavailable — expired or already decided.

Account

#Change the password

POST/auth/password/changeSession

Changes the password and signs out every device (the session cookie is cleared; sign in again).

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
currentPasswordrequiredstringThe current password.
newPasswordrequiredstring8–128 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/password/change' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"currentPassword": "old", "newPassword": "new password"}'

Response

200
{
  "changed": true
}

Status codes

CodeDescription
200Password changed.
400invalid credentials — bad length.
401unauthorized or wrong current password.

#Request an email change

POST/auth/email/change/requestSession

Sends a 6-digit code to the new address. Limited to 3 requests per minute.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
emailrequiredstringThe new email address.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/email/change/request' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"email": "[email protected]"}'

Response

200
{
  "sent": true
}

Status codes

CodeDescription
200Code sent.
400invalid email.
401unauthorized.
409email already registered.
429too many requests.

#Confirm an email change

POST/auth/email/change/confirmSession

Applies the new address and invalidates all sessions.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
coderequiredstringThe 6-digit code sent to the new address.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/auth/email/change/confirm' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"code": "123456"}'

Response

200
{
  "email": "[email protected]",
  "changed": true
}

Status codes

CodeDescription
200Email changed.
401unauthorized or invalid code.
409email already registered.
410code expired.
429too many attempts.

Library & history

#Record a play

POST/historySession

Adds a track to the listening history.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
trackIdrequiredstringTrack id, up to 128 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/history' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"trackId": "tr-…"}'

Response

200
{
  "recorded": true
}

Status codes

CodeDescription
200Recorded.
400missing trackId.
401unauthorized.

#List listening history

GET/historySession

Most recent plays first.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Query parameters

NameTypeDescription
limitintegerPage size, 1–100. Default 24.

Example

curl \
  'https://api.villife.org/history?' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
[
  {
    "track_id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
    "played_at": "2026-11-29 12:04:11",
    "title": "Night Drive",
    "artwork_url": "https://cdn.villife.org/covers/….webp"
  }
]

Status codes

CodeDescription
200Array of plays.
401unauthorized.

#Get recommendations

GET/recommendationsSession

Published tracks by artists the user already listens to, excluding tracks already played, ranked by score (the number of plays of that artist). Admins may pass another user.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Query parameters

NameTypeDescription
userstringUser id. Ignored unless it is your own id or you are an admin.
limitinteger1–50. Default 12.

Example

curl \
  'https://api.villife.org/recommendations?' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
[
  {
    "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
    "title": "Night Drive",
    "duration": 214,
    "artwork_url": "https://cdn.villife.org/covers/….webp",
    "artist": "Nova",
    "album": "Neon",
    "score": 7
  }
]

Status codes

CodeDescription
200Array of tracks.
401unauthorized.

#Follow an artist

POST/users/{artistId}/followSession

The path segment is the artist id.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
artistIdrequiredstringArtist id.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/users/<artistId>/follow' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
{
  "followerId": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "artistId": "ar-5b7e2a90-61c4-4a3d-b2f1-7e8d9c0a1b23",
  "following": true
}

Status codes

CodeDescription
200Now following (idempotent).
401unauthorized.

#Unfollow an artist

DELETE/users/{artistId}/followSession

Removes the follow.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
artistIdrequiredstringArtist id.

Example

curl \
  -X \
  DELETE \
  'https://api.villife.org/users/<artistId>/follow' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
{
  "following": false
}

Status codes

CodeDescription
200Done.
401unauthorized.

#List followed artists

GET/users/{userId}/followingSession · self or admin

Only the user themself or an admin may read this list.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
userIdrequiredstringUser id.

Query parameters

NameTypeDescription
limitintegerPage size, 1–100. Default 24.

Example

curl \
  'https://api.villife.org/users/<userId>/following?' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
[
  {
    "artist_id": "ar-5b7e2a90-61c4-4a3d-b2f1-7e8d9c0a1b23",
    "created_at": "2026-11-20 09:12:00"
  }
]

Status codes

CodeDescription
200Array of follows.
403forbidden.

#Get synced data

GET/sync/{userId}Session · self or admin

Returns the JSON document the apps use to sync settings, library and playlists.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
userIdrequiredstringUser id.

Example

curl \
  'https://api.villife.org/sync/<userId>' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN'

Response

200
{
  "data": {
    "playlists": [],
    "favorites": []
  },
  "updatedAt": "2026-11-29 12:00:00"
}

Returns { "data": null } if nothing was stored yet.

Status codes

CodeDescription
200Stored document.
403forbidden.

#Store synced data

PUT/sync/{userId}Session · self or admin

Replaces the stored document. The serialized JSON must be at most 1 MiB.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
userIdrequiredstringUser id.

Body parameters

NameTypeDescription
datarequiredanyAny JSON value. If data is omitted the whole body is stored.

Example

curl \
  -X \
  PUT \
  'https://api.villife.org/sync/<userId>' \
  -H \
  'Authorization: Bearer $VILLIFE_TOKEN' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"data": {"favorites": []}}'

Response

200
{
  "ownerId": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
  "updated": true
}

Status codes

CodeDescription
200Stored.
400invalid json or too large.
403forbidden.

#Report content

POST/reportsPublic

Files a moderation report. It appears in the moderation log as pending review.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
targetTyperequiredstringWhat is reported, for example track, release or lyrics.
targetIdrequiredstringId of the reported object.
reasonrequiredstringUp to 2000 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/reports' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"targetType": "track", "targetId": "tr-…", "reason": "Copyright claim"}'

Response

200
{
  "id": "b7f0…",
  "status": "pending review"
}

Status codes

CodeDescription
200Report stored.
400missing fields.

Catalog

Catalog endpoints return only published content and are public.

#List artists

GET/artistsPublic

Searches artists by name.

Query parameters

NameTypeDescription
qstringSubstring of the name.
limitintegerPage size, 1–100. Default 24.
offsetintegerNumber of rows to skip. Default 0.
sortstringOne of name, created_at. Default name.
orderstringasc (default) or desc.

Example

curl \
  'https://api.villife.org/artists?'

Response

200
[
  {
    "id": "ar-5b7e2a90-61c4-4a3d-b2f1-7e8d9c0a1b23",
    "name": "Nova",
    "avatar_url": ""
  }
]

Status codes

CodeDescription
200Array of artists.

#List albums

GET/albumsPublic

Only albums with a published release are returned.

Query parameters

NameTypeDescription
qstringSubstring of the album title or artist name.
artiststringFilter by artist id.
limitintegerPage size, 1–100. Default 24.
offsetintegerNumber of rows to skip. Default 0.
sortstringOne of title, release_date. Default release_date.
orderstringasc (default) or desc.

Example

curl \
  'https://api.villife.org/albums?'

Response

200
[
  {
    "id": "al-1",
    "title": "Neon",
    "artwork_url": "",
    "release_date": "2026-10-01",
    "artist": "Nova"
  }
]

Status codes

CodeDescription
200Array of albums.

#List tracks

GET/tracksPublic

Only published tracks are returned.

Query parameters

NameTypeDescription
qstringSubstring of the title or artist name.
albumstringFilter by album id.
artiststringFilter by artist id.
limitintegerPage size, 1–100. Default 24.
offsetintegerNumber of rows to skip. Default 0.
sortstringOne of title, duration. Default title.
orderstringasc (default) or desc.

Example

curl \
  'https://api.villife.org/tracks?'

Response

200
[
  {
    "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
    "title": "Night Drive",
    "duration": 214,
    "artwork_url": "https://cdn.villife.org/covers/….webp",
    "artist": "Nova",
    "album": "Neon"
  }
]

Status codes

CodeDescription
200Array of tracks.

#Get a track

GET/tracks/{id}Public

Returns a published track.

Path parameters

NameTypeDescription
idrequiredstringTrack id.

Example

curl \
  'https://api.villife.org/tracks/<id>'

Response

200
{
  "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
  "title": "Night Drive",
  "duration": 214,
  "artwork_url": "https://cdn.villife.org/covers/….webp",
  "artist": "Nova",
  "album": "Neon"
}

Status codes

CodeDescription
200The track.
404not found — unknown or unpublished.

#Get lyrics

GET/lyrics/{trackId}Public

Returns published lyrics for a published track.

Path parameters

NameTypeDescription
trackIdrequiredstringTrack id.

Example

curl \
  'https://api.villife.org/lyrics/<trackId>'

Response

200
{
  "language": "en",
  "text": "…"
}

Status codes

CodeDescription
200Lyrics.
404not found.

#Check offline eligibility

GET/offline/eligible/{trackId}Public

Tells whether the latest release of the track is published, allows offline playback and has not expired.

Path parameters

NameTypeDescription
trackIdrequiredstringTrack id.

Example

curl \
  'https://api.villife.org/offline/eligible/<trackId>'

Response

200
{
  "trackId": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
  "allowed": true
}

Status codes

CodeDescription
200Always 200; read allowed.

#Get artist statistics

GET/analytics/artist/{id}Public

Total plays, distinct listeners and track count for an artist.

Path parameters

NameTypeDescription
idrequiredstringArtist id.

Example

curl \
  'https://api.villife.org/analytics/artist/<id>'

Response

200
{
  "artistId": "ar-5b7e2a90-61c4-4a3d-b2f1-7e8d9c0a1b23",
  "plays": 1280,
  "listeners": 342,
  "tracks": 9
}

Status codes

CodeDescription
200Statistics.

Studio

Studio endpoints are for artists and moderators. Authenticate with a user whose role is artist, moderator or admin (session cookie or Bearer token), or with the X-Studio-Key header. A release moves through draft → pending review → approved → published, or to rejected with a reason; rejected releases can be edited and resubmitted.

#List your releases

GET/studio/releasesStudio

Releases owned by owner. Non-admins can only list their own.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Query parameters

NameTypeDescription
ownerrequiredstringOwner user id.
limitintegerPage size, 1–100. Default 24.
offsetintegerNumber of rows to skip. Default 0.

Example

curl \
  'https://api.villife.org/studio/releases?owner=<user-id>' \
  -H \
  'X-Studio-Key: $STUDIO_KEY'

Response

200
[
  {
    "id": "rel-1a2b3c4d-5e6f-4789-9abc-def012345678",
    "album_id": null,
    "track_id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
    "owner_id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
    "status": "draft",
    "reason": null,
    "updated_at": "2026-11-29 12:00:00"
  }
]

Status codes

CodeDescription
200Array of releases.
403forbidden.

#Upload audio

POST/studio/uploadStudio

Uploads an audio file to object storage. The file type is detected from its bytes: MP3 (ID3), Ogg, FLAC, MP4/M4A and WAV. Maximum 50 MiB.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
filerequiredfileThe audio file (multipart/form-data).

Example

curl \
  -X \
  POST \
  'https://api.villife.org/studio/upload' \
  -H \
  'X-Studio-Key: $STUDIO_KEY' \
  -F \
  'file=@./track.mp3'

Response

200
{
  "key": "audio/0c4e…-….mp3",
  "sha256": "e3b0c442…"
}

Status codes

CodeDescription
200Stored. Pass key to POST /studio/tracks.
400no file, file too large, invalid type or invalid form.
403forbidden.

#Upload a cover

POST/studio/upload-coverStudio

Uploads a JPEG, PNG or WebP image. Maximum 10 MiB.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
filerequiredfileThe image (multipart/form-data).

Example

curl \
  -X \
  POST \
  'https://api.villife.org/studio/upload-cover' \
  -H \
  'X-Studio-Key: $STUDIO_KEY' \
  -F \
  'file=@./track.mp3'

Response

200
{
  "key": "covers/7a1d…-….webp"
}

Status codes

CodeDescription
200Stored. The public URL is https://cdn.villife.org/<key>.
400no file, file too large or invalid type.
403forbidden.

#Create an artist

POST/studio/artistsStudio

Creates an artist profile owned by the caller.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
namerequiredstringUp to 120 characters.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/studio/artists' \
  -H \
  'X-Studio-Key: $STUDIO_KEY' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"name": "Nova"}'

Response

200
{
  "id": "ar-5b7e2a90-61c4-4a3d-b2f1-7e8d9c0a1b23",
  "name": "Nova",
  "ownerId": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b"
}

Status codes

CodeDescription
200Created.
400missing name.
403forbidden.

#Create a track draft

POST/studio/tracksStudio

Creates a track and a draft release. Non-admins must own the artist; an unowned artist without tracks is claimed on first use.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Body parameters

NameTypeDescription
titlerequiredstringTrack title.
artistIdrequiredstringArtist id.
ownerIdrequiredstringYour user id.
audioKeyrequiredstringkey from /studio/upload.
durationnumberLength in seconds.
artworkUrlstringCover URL.
territorystringRelease territory.
licenseTypestringLicense type.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/studio/tracks' \
  -H \
  'X-Studio-Key: $STUDIO_KEY' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"title": "Night Drive", "artistId": "ar-…", "ownerId": "usr-…", "audioKey": "audio/….mp3"}'

Response

200
{
  "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
  "releaseId": "rel-1a2b3c4d-5e6f-4789-9abc-def012345678",
  "status": "draft"
}

Status codes

CodeDescription
200Draft created.
400missing fields.
403forbidden or artist owned by another account.
404unknown artist.

#Get a track and its status

GET/studio/tracks/{id}Studio

Returns the track with its release status and moderation reason.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
idrequiredstringTrack id.

Example

curl \
  'https://api.villife.org/studio/tracks/<id>' \
  -H \
  'X-Studio-Key: $STUDIO_KEY'

Response

200
{
  "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
  "title": "Night Drive",
  "duration": 214,
  "artwork_url": "",
  "status": "rejected",
  "reason": "Cover contains a watermark"
}

Status codes

CodeDescription
200The track.
403forbidden.
404not found.

#Edit a track

PATCH/studio/tracks/{id}Studio

Allowed only while the release is draft or rejected. Editing a rejected release returns it to draft.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
idrequiredstringTrack id.

Body parameters

NameTypeDescription
titlerequiredstringNew title.
durationnumberLength in seconds.
artworkUrlstringCover URL.

Example

curl \
  -X \
  PATCH \
  'https://api.villife.org/studio/tracks/<id>' \
  -H \
  'X-Studio-Key: $STUDIO_KEY' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"title": "Night Drive"}'

Response

200
{
  "id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
  "title": "Night Drive",
  "duration": 214,
  "artworkUrl": ""
}

Status codes

CodeDescription
200Updated.
403forbidden.
404not found.
409not editable.

#Submit a release for review

POST/studio/releases/{id}/submitStudio

Moves a draft or rejected release to pending review.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Browser calls need credentials: "include" so the session cookie is sent or stored.

Path parameters

NameTypeDescription
idrequiredstringRelease id (rel-…).

Example

curl \
  -X \
  POST \
  'https://api.villife.org/studio/releases/<id>/submit' \
  -H \
  'X-Studio-Key: $STUDIO_KEY'

Response

200
{
  "id": "rel-1a2b3c4d-5e6f-4789-9abc-def012345678",
  "status": "pending review"
}

Status codes

CodeDescription
200Submitted.
400invalid status.
403forbidden.
404not found.

Admin

Admin endpoints require X-Admin-Key. If two-factor is enabled on the server, also send the current TOTP code in X-Admin-Code. These endpoints are not meant for browsers.

#List releases

GET/releasesAdmin

Moderation queue across all owners.

Query parameters

NameTypeDescription
statusstringOne of draft, pending review, approved, published, rejected.
limitintegerPage size, 1–100. Default 24.
offsetintegerNumber of rows to skip. Default 0.
sortstringOne of updated_at, status. Default updated_at.
orderstringasc (default) or desc.

Example

curl \
  'https://api.villife.org/releases?' \
  -H \
  'X-Admin-Key: $ADMIN_KEY'

Response

200
[
  {
    "id": "rel-1a2b3c4d-5e6f-4789-9abc-def012345678",
    "album_id": null,
    "track_id": "tr-9d1c1c5e-2f0a-4b8e-8f6e-0b7d5f1a2c34",
    "owner_id": "usr-3f2b9c1e-7a54-4d0e-9a6b-1c2d3e4f5a6b",
    "status": "pending review",
    "reason": null,
    "territory": "",
    "license_type": "",
    "updated_at": "2026-11-29 12:00:00"
  }
]

Status codes

CodeDescription
200Array of releases.
403forbidden.

#Moderate a release or lyrics

POST/releases/{id}/statusAdmin

Also available as POST /lyrics/{id}/status for lyrics. The change is written to the moderation log.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Path parameters

NameTypeDescription
idrequiredstringRelease or lyrics id.

Body parameters

NameTypeDescription
statusrequiredstringOne of draft, pending review, approved, published, rejected.
reasonstringShown to the owner.
actorstringModerator name for the log. Default admin.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/releases/<id>/status' \
  -H \
  'X-Admin-Key: $ADMIN_KEY' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"status": "published"}'

Response

200
{
  "id": "rel-1a2b3c4d-5e6f-4789-9abc-def012345678",
  "status": "published"
}

Status codes

CodeDescription
200Updated.
400invalid status.
403forbidden.
404not found.

#Import tracks

POST/catalog/importAdmin

Bulk-inserts track metadata. Existing ids are skipped. id must match ^[a-zA-Z0-9:_-]{1,128}$.

Browsers must send X-CSRF-Token (see CSRF). Not needed with a Bearer token or API key.

Body parameters

NameTypeDescription
itemsrequiredarrayObjects with id, title, artistId, and optionally albumId, duration, artworkUrl. A bare array body is also accepted.

Example

curl \
  -X \
  POST \
  'https://api.villife.org/catalog/import' \
  -H \
  'X-Admin-Key: $ADMIN_KEY' \
  -H \
  'Content-Type: application/json' \
  -d \
  '{"items": [{"id": "tr-1", "title": "…", "artistId": "ar-1"}]}'

Response

200
{
  "imported": 2,
  "skipped": 1,
  "errors": [
    {
      "id": null,
      "error": "invalid metadata"
    }
  ]
}

Status codes

CodeDescription
200Result per batch.
403forbidden.

#Find duplicate tracks

GET/catalog/duplicatesAdmin

Tracks that share a title and artist (up to 100 groups).

Example

curl \
  'https://api.villife.org/catalog/duplicates' \
  -H \
  'X-Admin-Key: $ADMIN_KEY'

Response

200
[
  {
    "title_key": "night drive",
    "artist": "Nova",
    "copies": 2,
    "ids": "tr-1,tr-2"
  }
]

Status codes

CodeDescription
200Groups of duplicates.
403forbidden.

#Get catalog totals

GET/analyticsAdmin

Row counts for the main tables.

Example

curl \
  'https://api.villife.org/analytics' \
  -H \
  'X-Admin-Key: $ADMIN_KEY'

Response

200
{
  "artists": 120,
  "albums": 80,
  "tracks": 940,
  "releases": 960,
  "lyrics": 310,
  "rights": 0,
  "users": 2100,
  "playlists": 420,
  "listening_history": 58000,
  "moderation_actions": 77
}

Status codes

CodeDescription
200Totals.
403forbidden.

Search & streaming

Search and streaming live on a separate host, https://source.villife.org. These endpoints need no authentication and no CSRF token. Responses use the same JSON error shape: {"error": "…"}.

#Search playlists

GET/search/playlistsPublic

Up to 12 playlists. Limited to 180 requests per minute.

Query parameters

NameTypeDescription
qrequiredstringSearch text.

Example

curl \
  'https://source.villife.org/search/playlists?q=night'

Response

200
[
  {
    "id": "sc-set:987",
    "title": "Night mix",
    "artist": "Nova",
    "artistId": "sc:1234",
    "artwork": "https://source.villife.org/image?url=…",
    "trackCount": 12,
    "year": "2026",
    "type": "playlist"
  }
]

type is album or playlist.

Status codes

CodeDescription
200Array of playlists.
400no query.

#Get an HLS stream

GET/streamPublic

Returns an HLS master playlist (application/vnd.apple.mpegurl) whose segments are proxied through /hls. Limited to 120 requests per minute.

Query parameters

NameTypeDescription
idrequiredstringTrack id such as sc:123456789.

Example

curl \
  'https://source.villife.org/stream?id=sc:123456789'

Response

200
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=128000
https://source.villife.org/hls?url=…

Status codes

CodeDescription
200HLS playlist.
400invalid id.
502track unavailable or stream unavailable.

#Find an artist by name

GET/artistPublic

Up to 5 matching users.

Query parameters

NameTypeDescription
namerequiredstringArtist name.

Example

curl \
  'https://source.villife.org/artist?name=Nova'

Response

200
[
  {
    "id": "sc:1234",
    "name": "Nova"
  }
]

Status codes

CodeDescription
200Array of matches; empty without name.

#Proxy an image

GET/imagePublic

Fetches and caches artwork from soundcloud.com and sndcdn.com only. Limited to 240 requests per minute.

Query parameters

NameTypeDescription
urlrequiredstringAbsolute image URL.

Example

curl \
  'https://source.villife.org/image?url=<image-url>'

Response

200
(binary image)

Status codes

CodeDescription
200The image.
400invalid url.
403forbidden — host not allowed.
502image unavailable.

#Warm-up / health

GET/warmPublic

Lightweight readiness probe used by the status page.

Example

curl \
  'https://source.villife.org/warm'

Response

200
{
  "ready": true
}

Status codes

CodeDescription
200Ready.

CDN

Media is served from https://cdn.villife.org. Keys come from the Studio upload endpoints.

#Download an object

GET/{key}Public

Serves objects uploaded through Studio, for example audio/<uuid>.mp3 or covers/<uuid>.webp. Supports Range requests (206 Partial Content), HEAD and CORS for any origin. Only GET, HEAD and OPTIONS are allowed.

Path parameters

NameTypeDescription
keyrequiredstringObject key, up to 512 characters.

Example

curl \
  'https://cdn.villife.org/<key>'

Response

200
(object bytes)

Status codes

CodeDescription
200Whole object.
206Requested byte range.
404Object not found.
405Method not allowed.