# Status (*status*) ## Overview The status endpoints give you information about current playbacks, play history, and even terminating sessions. ### Available Operations * [list_sessions](#list_sessions) - List Sessions * [get_background_tasks](#get_background_tasks) - Get background tasks * [list_playback_history](#list_playback_history) - List Playback History * [terminate_session](#terminate_session) - Terminate a session * [delete_history](#delete_history) - Delete Single History Item * [get_history_item](#get_history_item) - Get Single History Item ## list_sessions List all current playbacks on this server ### Example Usage ```python from plex_api_client import PlexAPI with PlexAPI( token="", ) as plex_api: res = plex_api.status.list_sessions() assert res.object is not None # Handle response print(res.object) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.ListSessionsResponse](../../models/operations/listsessionsresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## get_background_tasks Get the list of all background tasks ### Example Usage ```python from plex_api_client import PlexAPI with PlexAPI( token="", ) as plex_api: res = plex_api.status.get_background_tasks() assert res.object is not None # Handle response print(res.object) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.GetBackgroundTasksResponse](../../models/operations/getbackgroundtasksresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## list_playback_history List all playback history (Admin can see all users, others can only see their own). Pagination should be used on this endpoint. Additionally this endpoint supports `includeFields`, `excludeFields`, `includeElements`, and `excludeElements` parameters. ### Example Usage ```python from plex_api_client import PlexAPI from plex_api_client.models import components with PlexAPI( accepts=components.Accepts.APPLICATION_XML, client_identifier="abc123", product="Plex for Roku", version="2.4.1", platform="Roku", platform_version="4.3 build 1057", device="Roku 3", model="4200X", device_vendor="Roku", device_name="Living Room TV", marketplace="googlePlay", token="", ) as plex_api: res = plex_api.status.list_playback_history(request={ "sort": [ "v", "i", "e", "w", "e", "d", "A", "t", ":", "d", "e", "s", "c", ",", "a", "c", "c", "o", "u", "n", "t", "I", "D", ], }) assert res.object is not None # Handle response print(res.object) ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `request` | [operations.ListPlaybackHistoryRequest](../../models/operations/listplaybackhistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.ListPlaybackHistoryResponse](../../models/operations/listplaybackhistoryresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## terminate_session Terminate a playback session kicking off the user ### Example Usage ```python from plex_api_client import PlexAPI from plex_api_client.models import components with PlexAPI( accepts=components.Accepts.APPLICATION_XML, client_identifier="abc123", product="Plex for Roku", version="2.4.1", platform="Roku", platform_version="4.3 build 1057", device="Roku 3", model="4200X", device_vendor="Roku", device_name="Living Room TV", marketplace="googlePlay", token="", ) as plex_api: res = plex_api.status.terminate_session(request={ "session_id": "cdefghijklmnopqrstuvwxyz", "reason": "Stop Playing", }) assert res is not None # Handle response print(res) ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `request` | [operations.TerminateSessionRequest](../../models/operations/terminatesessionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.TerminateSessionResponse](../../models/operations/terminatesessionresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## delete_history Delete a single history item by id ### Example Usage ```python from plex_api_client import PlexAPI from plex_api_client.models import components with PlexAPI( accepts=components.Accepts.APPLICATION_XML, client_identifier="abc123", product="Plex for Roku", version="2.4.1", platform="Roku", platform_version="4.3 build 1057", device="Roku 3", model="4200X", device_vendor="Roku", device_name="Living Room TV", marketplace="googlePlay", token="", ) as plex_api: res = plex_api.status.delete_history(request={ "history_id": 953579, }) assert res.media_container is not None # Handle response print(res.media_container) ``` ### Parameters | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `request` | [operations.DeleteHistoryRequest](../../models/operations/deletehistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.DeleteHistoryResponse](../../models/operations/deletehistoryresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | ## get_history_item Get a single history item by id ### Example Usage ```python from plex_api_client import PlexAPI from plex_api_client.models import components with PlexAPI( accepts=components.Accepts.APPLICATION_XML, client_identifier="abc123", product="Plex for Roku", version="2.4.1", platform="Roku", platform_version="4.3 build 1057", device="Roku 3", model="4200X", device_vendor="Roku", device_name="Living Room TV", marketplace="googlePlay", token="", ) as plex_api: res = plex_api.status.get_history_item(request={ "history_id": 832213, }) assert res.history_all_get_responses_200 is not None # Handle response print(res.history_all_get_responses_200) ``` ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `request` | [operations.GetHistoryItemRequest](../../models/operations/gethistoryitemrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response **[operations.GetHistoryItemResponse](../../models/operations/gethistoryitemresponse.md)** ### Errors | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* |