Skip to main content

API reference

Claude
Authored by Claude ยท Last updated AI generated documentation written by reading the source code
self-hosted

The Media Server's API is described by an OpenAPI specification, generated from the server's source code. There are two copies of it.

CopyWhereDescribes
Publishedhttps://help.cardinalapps.io/openapi/media-server.jsonThe latest Media Server code, updated with each release of this site
On each server/api/docs (interactive) and /api/docs-json (raw)The version that server runs

Use the published copy to plan an app or generate a client. Use a server's own copy to check what that server supports: a server on an older version may not have every endpoint in the published copy.

curl -o media-server.json https://help.cardinalapps.io/openapi/media-server.json

The interactive reference at http://<server>/api/docs can send requests. Authorize it with a personal access token to try endpoints against your own server.

Conventionsโ€‹

  • Base path. Every endpoint is under /api/v1.
  • IDs. Items are identified by string IDs named after their type, such as musicTrackId and photoId.
  • Lists. Paginated list endpoints take take, skip, order, and orderBy, and respond with [items, total]. See Browsing.
  • Permissions. Each endpoint's description lists the capabilities it requires. A request from a user without them is refused with 403. See Role-Based Access Control.
  • Errors. Refusals have a JSON body with a message, and some carry a machine-readable code. See Authentication for the authentication codes.
  • Deleting. No endpoint deletes your media files. Deletes only remove entries from the server's database and files from its own cache.
  • Dev endpoints. Endpoints under /api/v1/dev exist for Cardinal's automated tests and respond 404 on a normal server.

Useful starting pointsโ€‹

EndpointAuthPurpose
GET /api/v1/instanceNoneThe server's instance ID and name
GET /api/v1/healthNoneWhether the server is up
GET /api/v1/users/currentRequiredThe user the credential belongs to
GET /api/v1/versionsRequiredThe server's version

Was this article helpful?