Constructor
new ApiClient() → {ApiClient}
- Source
- Type:
- ApiClient
Methods
AuthenticateByName(username, password) → {dynamic}
Authenticate user by username and password
| Name | Type | Description |
|---|---|---|
username | string | User's username |
password | string | User's password |
- Source
API response with auth token or invalid on error
- Type:
- dynamic
BuildAuthenticateWithQuickConnectRequest(secret) → {dynamic}
Build a request AA to exchange an APPROVED Quick Connect secret for an auth token, for use with fetchAsync() / fetchRes().
The body's field name changed at 10.8.0 — a FINER boundary than the V1/V2 apiVersion split, so it reads the server version directly rather than m.getApiVersion(): 10.7.x: { "Token": secret } (QuickConnectDto.Token, required) 10.8.0+: { "Secret": secret } (QuickConnectDto.Secret, required) Confirmed against every published spec from 10.7.0 to 10.11.8 — the rename lands at exactly 10.8.0, with no version carrying both names.
DON'T BRANCH ON THE ERROR CODE HERE. The spec declares only 400 ("Missing token") plus 503 from 10.11.0, but a live 10.11.11 answered 404 for a secret it had not seen approved — an undeclared code. So a non-ok response means "this secret cannot be exchanged" and nothing finer; quickConnectExchangeFailure (source/utils/quickConnect.bs) owns the one distinction worth making.
| Name | Type | Description |
|---|---|---|
secret | string | The Quick Connect secret from Initiate |
- Source
Request AA: { method, url, body, headers } or invalid if server URL not set
- Type:
- dynamic
BuildCancelSeriesTimerRequest(timerId) → {dynamic}
Build a request AA to cancel a Live TV series recording timer, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
timerId | string | The series timer ID to cancel |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildCancelTimerRequest(timerId) → {dynamic}
Build a request AA to cancel a Live TV recording timer, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
timerId | string | The timer ID to cancel |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildConnectQuickConnectRequest(secret) → {dynamic}
Build a request AA to poll whether a Quick Connect secret has been approved, for use with fetchAsync() / fetchRes(). Responds 200 with the same QuickConnectResult shape Initiate returned, its Authenticated flag now true once someone approved the code.
An UNKNOWN or EXPIRED secret answers 404 ("Unknown quick connect secret"), declared by EVERY published spec from 10.7.0 to 10.11.8 and corroborated by a live 10.11.11. That is the only signal separating "not approved yet" from "this code is dead", and it is invisible to a caller that only parses the body — which is why this endpoint has to go through the pool (res.statusCode) rather than a sync JSON helper.
| Name | Type | Description |
|---|---|---|
secret | string | The Quick Connect secret from Initiate |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildCreateSeriesTimerRequest(defaults) → {dynamic}
Build a request AA to create a Live TV series recording timer, for use with fetchRes() or fetchJson().
| Name | Type | Description |
|---|---|---|
defaults | object | Timer defaults AA from BuildGetLiveTvTimerDefaultsRequest response |
- Source
Request AA: { method, url, body, headers } or invalid if server URL not set
- Type:
- dynamic
BuildCreateTimerRequest(defaults) → {dynamic}
Build a request AA to create a Live TV recording timer, for use with fetchRes() or fetchJson().
| Name | Type | Description |
|---|---|---|
defaults | object | Timer defaults AA from BuildGetLiveTvTimerDefaultsRequest response |
- Source
Request AA: { method, url, body, headers } or invalid if server URL not set
- Type:
- dynamic
BuildDeleteItemRequest(itemId) → {dynamic}
Build a request AA to delete an item, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID to delete |
- Source
Request AA: { method, url }
- Type:
- dynamic
BuildGetAdditionalPartsRequest(itemId) → {dynamic}
Build a request AA for GetAdditionalParts, for use with fetchRes() or fetchJson().
| Name | Type | Description |
|---|---|---|
itemId | string | The video item ID |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetAlbumArtistsRequest(paramsopt) → {dynamic}
Build a request AA to fetch all album artists, for use with fetchRes() or fetchJson(). Mirrors GetAlbumArtists(): applies injectDefaults and injects UserId.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetArtistByNameRequest(name, paramsopt) → {dynamic}
Build a request AA for GetArtistByName, for use with fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name | string | Artist name (will be URI-encoded) | ||
params | object | <optional> | {} | Optional query parameters |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetArtistSimilarRequest(itemId, paramsopt) → {dynamic}
Build a request AA to get similar artists, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The artist item ID | ||
params | object | <optional> | {} | Optional query parameters (userId, limit, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetArtistsRequest(paramsopt) → {dynamic}
Build a request AA to fetch all artists, for use with fetchRes() or fetchJson(). Mirrors GetArtists(): applies injectDefaults and injects UserId.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetBrandingConfigurationRequest() → {dynamic}
Build a request AA for GetBrandingConfiguration, for use with fetchRes() or fetchJson().
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetEpisodesRequest(seriesId, paramsopt) → {dynamic}
Build a request AA for GetEpisodes, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
seriesId | string | The series ID | ||
params | object | <optional> | {} | Optional query parameters (StartItemId, Limit, etc.) |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetFiltersRequest(paramsopt) → {dynamic}
Build a request AA for GetFilters, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (userid, parentid, includeitemtypes, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetGenresRequest(paramsopt) → {dynamic}
Build a request AA to fetch genres, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetInstantMixRequest(itemId, paramsopt) → {dynamic}
Build a request AA for GetInstantMix, for use with fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The item ID | ||
params | object | <optional> | {} | Optional query parameters (Limit, etc.) |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetIntrosRequest(itemId) → {dynamic}
Build a request AA for GetIntros, for use with fetchJson().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetItemLyricsRequest(itemId) → {dynamic}
Build a request AA for GetItemLyrics, for use with fetchJson().
| Name | Type | Description |
|---|---|---|
itemId | string | The Audio item ID |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetItemRawRequest(itemId, paramsopt) → {dynamic}
Build a request AA to get a single item WITHOUT image/version field injection.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The item ID | ||
params | object | <optional> | {} | Optional query parameters (passed through as-is) |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetItemRequest(itemId, paramsopt) → {dynamic}
Get a single item by ID with automatic image and version field injection Build a request AA to get a single item with automatic image/version field injection.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The item ID | ||
params | object | <optional> | {} | Optional query parameters (fields, etc.) |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetItemsByQueryRequest(paramsopt) → {dynamic}
Build a request AA for GetItemsByQuery, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (limit, sortBy, filters, etc.) |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetLatestMediaRequest(paramsopt) → {dynamic}
Build a request AA for GetLatestMedia, for use with fetchRes() or fetchJson(). Both V1 and V2 return a bare array of BaseItemDto (not paginated). V1: /users/{id}/items/latest (10.7.x–10.8.x) V2: /Items/Latest?userId= (10.9+)
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Optional query parameters (ParentId, Limit, etc.) |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetLiveTVChannelsRequest(paramsopt) → {dynamic}
Build a request AA to fetch Live TV channels, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTVProgramsRequest(paramsopt) → {dynamic}
Build a request AA for GetLiveTVPrograms (full EPG search), for use with fetchRes() or fetchJson(). Mirrors GetLiveTVPrograms(): applies injectDefaults.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (SearchTerm, Limit, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTvProgramRequest(programId, paramsopt) → {dynamic}
Build a request AA to fetch a single Live TV program, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
programId | string | The program ID | ||
params | object | <optional> | {} | Optional query parameters (UserId, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTvRecommendedProgramsRequest(paramsopt) → {dynamic}
Build a request AA to get recommended Live TV programs (On Now), for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (userId, isAiring, limit, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTvRecordingsRequest(paramsopt) → {dynamic}
Build a request AA to get Live TV recordings, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (isInProgress, limit, status, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTvScheduleRequest(params) → {dynamic}
Build a request AA to fetch the Live TV schedule, for use with fetchRes() or fetchJson(). Uses POST because the channelIds list can exceed URL length limits.
| Name | Type | Description |
|---|---|---|
params | object | Query/body parameters (channelIds, startTime, endTime, UserId, etc.) |
- Source
Request AA: { method, url, body, headers } or invalid if server URL not set
- Type:
- dynamic
BuildGetLiveTvTimerDefaultsRequest(programId) → {dynamic}
Build a request AA to fetch Live TV timer defaults for a program, for use with fetchRes() or fetchJson().
| Name | Type | Description |
|---|---|---|
programId | string | The program ID to pre-fill timer defaults |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetLocalTrailersRequest(itemId) → {dynamic}
Build a request AA for GetLocalTrailers, for use with submitApiRequest() or fetchJson(). Version-aware: V2 uses /Items/{id}/LocalTrailers, V1 uses /users/{userId}/items/{id}/localtrailers.
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no userId (V1 only)
- Type:
- dynamic
BuildGetMediaSegmentsRequest(itemId, includeSegmentTypesopt) → {dynamic}
Build a request AA for GetMediaSegments, for use with fetchJson(). Only available on Jellyfin 10.10.0+ servers.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The item ID | ||
includeSegmentTypes | string | <optional> | "" | Optional comma-separated segment types to filter (e.g., "Intro,Outro") |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetNextUpRequest(paramsopt) → {dynamic}
Build a request AA for GetNextUp, for use with fetchRes() or fetchJson(). Mirrors GetNextUp(): applies injectDefaults and injects UserId.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (SeriesId, limit, EnableRewatching, etc.) |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetPersonsRequest(paramsopt) → {dynamic}
Build a request AA for GetPersons, for use with fetchRes() or fetchJson(). Mirrors GetPersons(): applies injectDefaults and injects UserId.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (e.g. IsFavorite, searchTerm) |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetPlaylistItemsRequest(playlistId, paramsopt) → {dynamic}
Build a request AA for GetPlaylistItems, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
playlistId | string | The playlist ID | ||
params | object | <optional> | {} | Optional query parameters |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildGetQuickConnectEnabledRequest() → {dynamic}
Build a request AA for GetQuickConnectEnabled, for use with fetchRes() or fetchJson(). Server responds with a plain boolean body (true = enabled, false = disabled). Lowercase path matches the existing /quickconnect/initiate convention - Jellyfin's routing is case-insensitive but reverse proxies in the wild sometimes are not.
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetResumeItemsRequest(paramsopt) → {dynamic}
Build a request AA for GetResumeItems (Continue Watching), for use with fetchRes() or fetchJson(). Mirrors GetResumeItems(): applies injectDefaults, version-aware endpoint.
The server hardcodes Recursive, OrderBy=DatePlayed and IsResumable on this endpoint, so MediaTypes is the ONLY narrowing a client controls — don't bother sending recursive / SortBy / SortOrder / Filters, they are ignored. Since 12.0 a folder also matches IsResumable when a descendant is in progress, so an unfiltered query returns Seasons and Series (by design) mixed in with the episodes. Every JellyRock resume flow is video, so default to Video; pass MediaTypes as a comma-separated STRING to widen it.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Optional query parameters |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetSeasonsRequest(seriesId, paramsopt) → {dynamic}
Build a request AA for GetSeasons, for use with fetchRes() or fetchJson(). Mirrors GetSeasons(): applies injectDefaults and injects UserId.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
seriesId | string | The series ID | ||
params | object | <optional> | {} | Optional query parameters |
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildGetSessionsRequest(paramsopt) → {dynamic}
Build a request AA to get active sessions, for use with fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters (e.g. { deviceId: "..." }) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetSimilarItemsRequest(itemId, paramsopt) → {dynamic}
Build a request AA to get similar items, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
itemId | string | The item ID | ||
params | object | <optional> | {} | Optional query parameters (userId, limit, etc.) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetSpecialFeaturesRequest(itemId) → {dynamic}
Build a request AA for GetSpecialFeatures, for use with fetchRes() or fetchJson(). Mirrors GetSpecialFeatures(): version-aware endpoint.
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no userId (V1 only)
- Type:
- dynamic
BuildGetStudiosRequest(paramsopt) → {dynamic}
Build a request AA to fetch studios, for use with fetchRes() or fetchJson().
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
params | object | <optional> | {} | Query parameters |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildGetViewsRequest() → {dynamic}
Build a request AA for GetViews, for use with fetchRes() or fetchJson(). Mirrors GetViews(): version-aware endpoint.
- Source
Request AA: { method, url } or invalid if no userId
- Type:
- dynamic
BuildHeadItemImageRequest(id, imageType, imageIndexopt) → {dynamic}
Build a HEAD request AA to check if an item image exists, for use with fetchRes() or fetchJson(). Caller checks res.ok — no body is returned for HEAD requests.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id | string | Item ID | ||
imageType | string | Type of image (e.g. "logo", "Primary") | ||
imageIndex | integer | <optional> | 0 | Image index (default 0) |
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildInitiateQuickConnectRequest() → {dynamic}
Build a request AA to start a Quick Connect request, for use with fetchAsync() / fetchRes(). The response carries the Secret we poll with and the Code the user types on their other device.
The HTTP METHOD moved at the same boundary as the apiVersion split: apiVersion 1 (10.7.0 - 10.8.13): GET (no POST route exists) apiVersion 2 (10.9.0+): POST (no GET route exists) Confirmed against every published spec from 10.7.0 to 10.11.8: each version declares exactly one of the two verbs, and the swap is at exactly 10.9.0.
Sending the wrong method to a modern server yields 401 ("Quick connect is not active on this server"), which reads as a feature gate but is actually a route mismatch — so the dispatch is load-bearing, not cosmetic. That collision is also why quickConnectInitiateFailure treats 401 as "disabled": it is the same code either way, and a route mismatch is our bug, not something to tell a user.
- Source
Request AA: { method, url } or invalid if server URL not set
- Type:
- dynamic
BuildMarkFavoriteRequest(itemId) → {dynamic}
Build a request AA to mark an item as favorite, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildMarkPlayedRequest(itemId) → {dynamic}
Build a request AA to mark an item as played, for use with SubmitSideEffect(). Includes default DatePlayed (now) and PlaybackPositionTicks (0) matching Jellyfin API expectations.
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildPlaystateRequest(state, params) → {dynamic}
Build a playstate request AA for use with SubmitSideEffect(). Applies default playstate fields and routes to the correct session endpoint.
| Name | Type | Description |
|---|---|---|
state | string | "start" | "update" | "stop" | "finished" |
params | object | Playback parameters (ItemId, PositionTicks, IsPaused, etc.) |
- Source
Request AA: { method, url, body, headers } or invalid if state unknown
- Type:
- dynamic
BuildPostPlaybackInfoRequest(itemId, postData) → {dynamic}
Build a request AA for PostPlaybackInfo, for use with fetchJson().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
postData | object | Request body data (DeviceProfile, MediaSourceId, etc.) |
- Source
Request AA: { method, url, body } or invalid if server URL not set
- Type:
- dynamic
BuildPostSessionCapabilitiesRequest(capabilities) → {dynamic}
Build a request AA to post full session capabilities, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
capabilities | object | Device capabilities AA from getDeviceCapabilities() |
- Source
Request AA: { method, url, body, headers } or invalid if server URL not set
- Type:
- dynamic
BuildUnmarkFavoriteRequest(itemId) → {dynamic}
Build a request AA to unmark an item as favorite, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
BuildUnmarkPlayedRequest(itemId) → {dynamic}
Build a request AA to mark an item as unplayed, for use with SubmitSideEffect().
| Name | Type | Description |
|---|---|---|
itemId | string | The item ID |
- Source
Request AA: { method, url } or invalid if no user
- Type:
- dynamic
GetConfigurationByName(name) → {dynamic}
Get configuration by name
| Name | Type | Description |
|---|---|---|
name | string | Configuration name |
- Source
API response or invalid on error
- Type:
- dynamic
GetDisplayPreferences(id, paramsopt) → {dynamic}
Get display preferences
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id | string | Preference ID | ||
params | object | <optional> | {} | Query parameters |
- Source
API response or invalid on error
- Type:
- dynamic
GetImageURL(id, imageType, imageIndexopt, paramsopt) → {dynamic}
Get image URL
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id | string | Item ID | ||
imageType | string | Type of image | ||
imageIndex | integer | <optional> | 0 | Image index |
params | object | <optional> | {} | Optional parameters |
- Source
API response or invalid on error
- Type:
- dynamic
GetPublicUsers() → {dynamic}
Get public users
- Source
API response or invalid on error
- Type:
- dynamic
GetUser(userId) → {dynamic}
Get user by ID
| Name | Type | Description |
|---|---|---|
userId | string | The user ID |
- Source
API response or invalid on error
- Type:
- dynamic
GetUserImageURL(id, imageType, imageIndexopt, paramsopt) → {dynamic}
Get user image URL
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id | string | User ID | ||
imageType | string | Type of image | ||
imageIndex | integer | <optional> | 0 | Image index |
params | object | <optional> | {} | Optional parameters |
- Source
API response or invalid on error
- Type:
- dynamic