API Reference

REST API

The DroppedNeedle web app runs on this API, and your scripts can use it too. Endpoints are grouped by tag below. Everything on these pages comes from the OpenAPI document in the v3.1.0 release.

OAS 3.1.0 v3.1.0 29b411371 606 endpoints 25 tags

Base path and sign-in

Apart from /health and /openapi.json, every endpoint sits under /api/v3 on your server. Most need a session: send its token as Authorization: Bearer <token>. The web app sends the same session as the droppedneedle_sid cookie, or __Secure-droppedneedle_sid.

To get a token for a script, call POST /api/v3/auth/login with your username, password and "transport": "bearer". The response carries the token once and sets no cookie. Signing out with POST /api/v3/auth/logout ends that session.

Who can call what

Each endpoint has a badge for the access it needs. User, Curator and Admin are scopes of the normal session. The upgrade session and the Wrapped key are separate credentials, and no normal session can stand in for them.

  • Public No sign-in needed.
  • User Any signed-in account.
  • Curator A Trusted or Admin account.
  • Admin An Admin account only.
  • Upgrade session The upgrade page's own sign-in. No normal session works.
  • Wrapped key The Wrapped API key in the X-Wrapped-API-Key header. No session works.

Errors

Errors come back in one envelope, whatever the status:

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Not found",
    "details": null
  }
}

Write your code against code, which is always in SCREAMING_SNAKE_CASE. A 4xx message is written for people and safe to show. A 5xx message is a fixed sentence that never names the cause. details holds extra data or is null. Common codes:

CodeWhen
INVALID_INPUT400. Something in the request is wrong; the message says what.
UNAUTHORIZED401. No credential, or one that is not valid.
FORBIDDEN403. Signed in, but not allowed to do this.
NOT_FOUND404. No such route or resource.
CONFLICT409. The request clashes with the current state.
RATE_LIMITED429. Too many requests. The Retry-After header says when to try again.
PROVIDER_UNAVAILABLE503. An outside service such as MusicBrainz is down or limiting requests. details.provider names it.
INTERNAL_ERROR500. A fault on the server. details.error_id is the request id it was logged under.

One endpoint answers differently: POST /api/v3/auth/app-connect/token follows OAuth and refuses with a bare code, as in {"error": "invalid_grant"}.

The OpenAPI document

Your server serves its own copy at /openapi.json, and it always matches the version you run. The copy behind these pages is from the v3.1.0 release and gets refreshed when a new release comes out. Either copy works with OpenAPI code generators.

DroppedNeedle also speaks the Subsonic and Jellyfin APIs for music apps. Those are not in this document. To set up an app, see Connect your music app.

Download openapi.json (v3.1.0)

Endpoints

Docs