### setup Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Sets up the Uptime Kuma server with the provided username and password. ```APIDOC ## setup ### Description Sets up the Uptime Kuma server with the provided username and password. ### Parameters #### Path Parameters - **username** (str) - Required - Username for the initial setup. - **password** (str) - Required - Password for the initial setup. ### Response #### Success Response (200) - **msg** (str) - Message indicating the result of the setup. ### Request Example ```python api.setup(username, password) ``` ### Response Example ```json { "msg": "Added Successfully." } ``` ``` -------------------------------- ### System and Configuration Source: https://uptime-kuma-api.readthedocs.io/en/latest/genindex.html Methods for system setup, configuration, and status checks. ```APIDOC ## setup() ### Description Performs the initial setup of the Uptime Kuma instance. ## need_setup() ### Description Checks if the instance requires initial setup. ## set_settings() ### Description Updates the system settings. ``` -------------------------------- ### Install uptime-kuma-api Source: https://uptime-kuma-api.readthedocs.io/en/latest/install.html Run this command in your terminal to install the uptime-kuma-api package using pip. ```bash $ pip install uptime-kuma-api ``` -------------------------------- ### Check Apprise Installation Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Verifies if the Apprise library is installed and accessible by Uptime Kuma. Returns True if available, False otherwise. ```python >>> api.check_apprise() ``` -------------------------------- ### Setup Uptime Kuma Server Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Initializes the Uptime Kuma server by setting the administrator username and password. This should be called only once during the initial setup. ```python api.setup(username, password) ``` -------------------------------- ### prepare_2fa Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Initiates the 2FA setup process by generating a unique URI for configuring an authenticator app. ```APIDOC ## prepare_2fa ### Description Initiates the 2FA setup process by generating a unique URI for configuring an authenticator app. ### Parameters #### Path Parameters - **password** (str) - Required - Current password. ### Response #### Success Response (200) - **uri** (str) - The OTPAuth URI for setting up 2FA. ### Response Example ```json { "uri": "otpauth://totp/Uptime%20Kuma:admin?secret=NBGVQNSNNRXWQ3LJJN4DIWSWIIYW45CZJRXXORSNOY3USSKXO5RG4MDPI5ZUK5CWJFIFOVCBGZVG24TSJ5LDE2BTMRLXOZBSJF3TISA" } ``` ``` -------------------------------- ### Get All Monitors Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured monitors from Uptime Kuma. ```APIDOC ## Get Monitors ### Description Fetches a list of all monitors currently configured in Uptime Kuma. ### Method ```python get_monitors() -> list[dict] ``` ### Returns - **list[dict]** - A list where each dictionary represents a monitor's configuration and status. ### Response Example ```json [ { "accepted_statuscodes": ["200-299"], "active": true, "authDomain": null, "authMethod": "", "authWorkstation": null, "basic_auth_pass": null, "basic_auth_user": null, "body": null, "childrenIDs": [], "databaseConnectionString": null, "databaseQuery": null, "description": null, "dns_last_result": null, "dns_resolve_server": "1.1.1.1", "dns_resolve_type": "A", "docker_container": null, "docker_host": null, "expiryNotification": false, "forceInactive": false, "game": null, "grpcBody": null, "grpcEnableTls": false, "grpcMetadata": null, "grpcMethod": null, "grpcProtobuf": null, "grpcServiceName": null, "grpcUrl": null, "headers": null, "hostname": null, "httpBodyEncoding": "json", "id": 1, "ignoreTls": false, "includeSensitiveData": true, "interval": 60, "keyword": null, "maintenance": false, "maxredirects": 10, "maxretries": 0, "method": "GET", "mqttPassword": null, "mqttSuccessMessage": null, "mqttTopic": null, "mqttUsername": null, "name": "monitor 1", "notificationIDList": [1, 2], "packetSize": 56, "parent": null, "pathName": "monitor 1", "port": null, "proxyId": null, "pushToken": null, "radiusCalledStationId": null, "radiusCallingStationId": null, "radiusPassword": null, "radiusSecret": null, "radiusUsername": null, "resendInterval": 0, "retryInterval": 60, "tags": [], "tlsCa": null, "tlsCert": null, "tlsKey": null, "type": "http", "upsideDown": false, "url": "http://127.0.0.1", "weight": 2000 } ] ``` ``` -------------------------------- ### Check Setup Status Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Checks if the Uptime Kuma server has been set up and is ready for use. Returns a boolean value. ```python api.need_setup() ``` -------------------------------- ### Get All Tags Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all tags configured in Uptime Kuma. Each tag includes its ID, name, and color. ```python >>> api.get_tags() [ { 'color': '#ffffff', 'id': 1, 'name': 'tag 1' } ] ``` -------------------------------- ### Prepare Two-Factor Authentication Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Initiate the 2FA setup process by providing the current password. This returns a URI containing the secret key needed to configure an authenticator app. ```python >>> password = "secret123" >>> r = api.prepare_2fa(password) >>> r { 'uri': 'otpauth://totp/Uptime%20Kuma:admin?secret=NBGVQNSNNRXWQ3LJJN4DIWSWIIYW45CZJRXXORSNOY3USSKXO5RG4MDPI5ZUK5CWJFIFOVCBGZVG24TSJ5LDE2BTMRLXOZBSJF3TISA' } >>> uri = r["uri"] >>> >>> from urllib import parse >>> def parse_secret(uri): ... query = parse.urlsplit(uri).query ... params = dict(parse.parse_qsl(query)) ... return params["secret"] >>> secret = parse_secret(uri) >>> secret NBGVQNSNNRXWQ3LJJN4DIWSWIIYW45CZJRXXORSNOY3USSKXO5RG4MDPI5ZUK5CWJFIFOVCBGZVG24TSJ5LDE2BTMRLXOZBSJF3TISA ``` -------------------------------- ### Get All API Keys Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all API keys configured in the system. This includes details like name, creation date, and activation status. ```python >>> api.get_api_key_list() [ { "id": 1, "name": "test", "userID": 1, "createdDate": "2023-03-20 11:15:05", "active": False, "expires": null, "status": "inactive" }, { "id": 2, "name": "test2", "userID": 1, "createdDate": "2023-03-20 11:20:29", "active": True, "expires": "2023-03-30 12:20:00", "status": "active" } ] ``` -------------------------------- ### Get Monitor Details Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves detailed information about a specific monitor, including its configuration and current status. ```APIDOC ## get_monitor(id: int) ### Description Retrieves detailed information about a specific monitor. ### Parameters #### Path Parameters - **id** (int) - Required - The ID of the monitor to retrieve. ### Returns - **dict** - A dictionary containing the monitor's details. ### Raises - **UptimeKumaException** – If the server returns an error. ### Example ```python api.get_monitor(1) ``` ``` -------------------------------- ### Get All Status Pages Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured status pages. This is useful for an overview of all available status pages. ```python >>> api.get_status_pages() [ { 'customCSS': '', 'description': 'description 1', 'domainNameList': [], 'footerText': None, 'icon': '/icon.svg', 'googleAnalyticsId': '', 'id': 1, 'published': True, 'showPoweredBy': False, 'showTags': False, 'slug': 'slug1', 'theme': 'light', 'title': 'status page 1' } ] ``` -------------------------------- ### Get All Proxies Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured proxies. Each proxy object contains details like host, port, authentication status, and creation date. ```python >>> api.get_proxies() ``` -------------------------------- ### Get Server Settings Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the current server settings configuration. This includes various operational parameters like beta checks, timezone, and authentication settings. ```python >>> api.get_settings() { 'checkBeta': False, 'checkUpdate': False, 'chromeExecutable': '', 'disableAuth': False, 'dnsCache': True, 'entryPage': 'dashboard', 'keepDataPeriodDays': 180, 'nscd': False, 'primaryBaseURL': '', 'searchEngineIndex': False, 'serverTimezone': 'Europe/Berlin', 'steamAPIKey': '', 'tlsExpiryNotifyDays': [ 7, 14, 21 ], 'trustProxy': False } ``` -------------------------------- ### Get Server Info Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Fetches general information about the Uptime Kuma server. This includes version details, container status, and server time settings. ```python api.info() { 'isContainer': True, 'latestVersion': '1.23.1', 'primaryBaseURL': '', 'serverTimezone': 'Europe/Berlin', 'serverTimezoneOffset': '+02:00', 'version': '1.23.1' } ``` -------------------------------- ### Get API Keys Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all API keys configured in the system. This is useful for auditing and managing access. ```APIDOC ## get_api_keys ### Description Get all api keys. ### Response #### Success Response (200) - **list[dict]** - All api keys. ### Response Example ```json [ { "id": 1, "name": "test", "userID": 1, "createdDate": "2023-03-20 11:15:05", "active": false, "expires": null, "status": "inactive" }, { "id": 2, "name": "test2", "userID": 1, "createdDate": "2023-03-20 11:20:29", "active": true, "expires": "2023-03-30 12:20:00", "status": "active" } ] ``` ``` -------------------------------- ### Add a New HTTP Monitor Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Use the add_monitor method to create a new monitor. Specify the monitor type, name, and URL. This example demonstrates adding an HTTP monitor. ```python api.add_monitor( type=MonitorType.HTTP, name="Google", url="https://google.com" ) ``` -------------------------------- ### Get Monitor Uptime Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the uptime data for monitors. The returned dictionary contains uptime percentages for different time intervals. ```python api.uptime() { 1: { 24: 1, 720: 1 } } ``` -------------------------------- ### Get Monitor Details Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves detailed information about a specific monitor by its ID. This is useful for inspecting the configuration and current status of a monitor. ```python >>> api.get_monitor(1) { 'accepted_statuscodes': ['200-299'], 'active': True, 'authDomain': None, 'authMethod': , 'authWorkstation': None, 'basic_auth_pass': None, 'basic_auth_user': None, 'body': None, 'childrenIDs': [], 'databaseConnectionString': None, 'databaseQuery': None, 'description': None, 'dns_last_result': None, 'dns_resolve_server': '1.1.1.1', 'dns_resolve_type': 'A', 'docker_container': None, 'docker_host': None, 'expectedValue': None, 'expiryNotification': False, 'forceInactive': False, 'game': None, 'gamedigGivenPortOnly': True, 'grpcBody': None, 'grpcEnableTls': False, 'grpcMetadata': None, 'grpcMethod': None, 'grpcProtobuf': None, 'grpcServiceName': None, 'grpcUrl': None, 'headers': None, 'hostname': None, 'httpBodyEncoding': 'json', 'id': 1, 'ignoreTls': False, 'includeSensitiveData': True, 'interval': 60, 'invertKeyword': False, 'jsonPath': None, 'kafkaProducerAllowAutoTopicCreation': False, 'kafkaProducerBrokers': None, 'kafkaProducerMessage': None, 'kafkaProducerSaslOptions': None, 'kafkaProducerSsl': False, 'kafkaProducerTopic': None, 'keyword': None, 'maintenance': False, 'maxredirects': 10, 'maxretries': 0, 'method': 'GET', 'mqttPassword': '', 'mqttSuccessMessage': '', 'mqttTopic': '', 'mqttUsername': '', 'name': 'monitor 1', 'notificationIDList': [1, 2], 'oauth_auth_method': None, 'oauth_client_id': None, 'oauth_client_secret': None, 'oauth_scopes': None, 'oauth_token_url': None, 'packetSize': 56, 'parent': None, 'pathName': 'monitor 1', 'port': None, 'proxyId': None, 'pushToken': None, 'radiusCalledStationId': None, 'radiusCallingStationId': None, 'radiusPassword': None, 'radiusSecret': None, 'radiusUsername': None, 'resendInterval': 0, 'retryInterval': 60, 'screenshot': None, 'tags': [], 'timeout': 48, 'tlsCa': None, 'tlsCert': None, 'tlsKey': None, 'type': , 'upsideDown': False, 'url': 'http://127.0.0.1', 'weight': 2000 } ``` -------------------------------- ### Get Average Ping for Monitors Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Calculates and returns the average ping time for each monitor. The result is a dictionary with monitor IDs as keys and their average ping as values. ```python >>> api.avg_ping() { 1: 10 } ``` -------------------------------- ### Add Maintenance (SINGLE Strategy) Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Schedule a single, specific maintenance period. The `dateRange` can include start and end times. A `timezoneOption` can be specified. ```python >>> api.add_maintenance( ... title="test", ... description="test", ... strategy=MaintenanceStrategy.SINGLE, ... active=True, ... intervalDay=1, ... dateRange=[ ... "2022-12-27 22:36:00", ... "2022-12-29 22:36:00" ... ], ... weekdays=[], ... daysOfMonth=[], ... timezoneOption="Europe/Berlin" ... ) { "msg": "Added Successfully.", "maintenanceID": 1 } ``` -------------------------------- ### Get Certificate Information for Monitors Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves certificate information for monitors that have extractable certificate data. Returns a dictionary where keys are monitor IDs and values contain certificate details like validity and issuer. ```python >>> api.cert_info() { 1: { 'valid': True, 'certInfo': { 'subject': { 'CN': 'www.google.de' }, 'issuer': { 'C': 'US', 'O': 'Google Trust Services LLC', 'CN': 'GTS CA 1C3' }, } } } ``` -------------------------------- ### Get All Monitor Heartbeats Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the heartbeat data for all monitors. Returns a dictionary where keys are monitor IDs and values are lists of heartbeat records. ```python >>> api.get_heartbeats() { 1: [ { 'down_count': 0, 'duration': 0, 'id': 1, 'important': True, 'monitor_id': 1, 'msg': '', 'ping': 10.5, 'status': , 'time': '2023-05-01 17:22:20.289' }, { 'down_count': 0, 'duration': 60, 'id': 2, 'important': False, 'monitor_id': 1, 'msg': '', 'ping': 10.7, 'status': , 'time': '2023-05-01 17:23:20.349' } ] } ``` -------------------------------- ### Get All Docker Hosts Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured Docker hosts connected to the Uptime Kuma service. Each host entry includes details like its ID, name, and connection type. ```python api.get_docker_hosts() ``` -------------------------------- ### Get Monitor Beat Data Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves historical beat data for a specific monitor over a given period in hours. Useful for analyzing past performance and uptime. ```python >>> api.get_monitor_beats(1, 6) [ { 'down_count': 0, 'duration': 0, 'id': 25, 'important': True, 'monitor_id': 1, 'msg': '200 - OK', 'ping': 201, 'status': , 'time': '2022-12-15 12:38:42.661' }, { 'down_count': 0, 'duration': 60, 'id': 26, 'important': False, 'monitor_id': 1, 'msg': '200 - OK', 'ping': 193, 'status': , 'time': '2022-12-15 12:39:42.878' }, ... ] ``` -------------------------------- ### need_setup Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Checks if the Uptime Kuma server has been set up. ```APIDOC ## need_setup ### Description Checks if the Uptime Kuma server has been set up. ### Response #### Success Response (200) - **return** (bool) - True if setup is needed, False otherwise. ### Request Example ```python api.need_setup() ``` ### Response Example ```json true ``` ``` -------------------------------- ### UptimeKumaApi Initialization and Login Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Demonstrates how to initialize the UptimeKumaApi client and log in to your Uptime Kuma instance. ```APIDOC ## UptimeKumaApi Initialization and Login ### Description Initializes the UptimeKumaApi client with the server URL and logs in using provided credentials. ### Method ```python UptimeKumaApi(url: str, timeout: float = 10, headers: Optional[dict] = None, ssl_verify: bool = True, wait_events: float = 0.2) login(username: str, password: str) ``` ### Parameters #### UptimeKumaApi Parameters - **url** (str) - The url to the Uptime Kuma instance. For example `http://127.0.0.1:3001` - **timeout** (float) - How many seconds the client should wait for the connection, an expected event or a server response. Default is `10`. - **headers** (dict) - Headers that are passed to the socketio connection, defaults to None - **ssl_verify** (bool) - `True` to verify SSL certificates, or `False` to skip SSL certificate verification. Default is `True`. - **wait_events** (float) - How many seconds the client should wait for the next event of the same type. Defaults is `0.2`. #### login Parameters - **username** (str) - The username for authentication. - **password** (str) - The password for authentication. ### Request Example ```python from uptime_kuma_api import UptimeKumaApi api = UptimeKumaApi('INSERT_URL') login_response = api.login('INSERT_USERNAME', 'INSERT_PASSWORD') print(login_response) ``` ### Response #### Success Response (login) - **token** (str) - The authentication token. #### Response Example (login) ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwiaWF0IjoxNjgyOTU4OTU4fQ.Xb81nuKXeNyE1D_XoQowYgsgZHka-edONdwHmIznJdk" } ``` ``` -------------------------------- ### Get Specific Monitor Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves details for a single monitor by its ID. ```APIDOC ## Get Monitor ### Description Fetches the details of a specific monitor using its unique ID. ### Method ```python get_monitor(_id_: int) -> dict ``` ### Parameters - **id** (int) - The unique identifier of the monitor to retrieve. ### Returns - **dict** - A dictionary containing the monitor's configuration and status. ### Response Example ```json { "accepted_statuscodes": ["200-299"], "active": true, "authDomain": null, "authMethod": "", "authWorkstation": null, "basic_auth_pass": null, "basic_auth_user": null, "body": null, "childrenIDs": [], "databaseConnectionString": null, "databaseQuery": null, "description": null, "dns_last_result": null, "dns_resolve_server": "1.1.1.1", "dns_resolve_type": "A", "docker_container": null, "docker_host": null, "expiryNotification": false, "forceInactive": false, "game": null, "grpcBody": null, "grpcEnableTls": false, "grpcMetadata": null, "grpcMethod": null, "grpcProtobuf": null, "grpcServiceName": null, "grpcUrl": null, "headers": null, "hostname": null, "httpBodyEncoding": "json", "id": 1, "ignoreTls": false, "includeSensitiveData": true, "interval": 60, "keyword": null, "maintenance": false, "maxredirects": 10, "maxretries": 0, "method": "GET", "mqttPassword": null, "mqttSuccessMessage": null, "mqttTopic": null, "mqttUsername": null, "name": "monitor 1", "notificationIDList": [1, 2], "packetSize": 56, "parent": null, "pathName": "monitor 1", "port": null, "proxyId": null, "pushToken": null, "radiusCalledStationId": null, "radiusCallingStationId": null, "radiusPassword": null, "radiusSecret": null, "radiusUsername": null, "resendInterval": 0, "retryInterval": 60, "tags": [], "tlsCa": null, "tlsCert": null, "tlsKey": null, "type": "http", "upsideDown": false, "url": "http://127.0.0.1", "weight": 2000 } ``` ``` -------------------------------- ### get_notifications Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured notifications. This includes details about each notification setup. ```APIDOC ## get_notifications ### Description Get all notifications. ### Returns #### Success Response (200) - **list[dict]** - A list of all notification objects. ### Response Example ```json [ { "active": true, "applyExisting": true, "id": 1, "isDefault": true, "name": "notification 1", "pushAPIKey": "123456789", "type": "PushByTechulus", "userId": 1 } ] ``` ``` -------------------------------- ### Certificate Validity Period Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Indicates the start and end dates for which the certificate is valid. ```json 'valid_from': 'Apr 3 08:24:23 2023 GMT', 'valid_to': 'Jun 26 08:24:22 2023 GMT', ``` -------------------------------- ### Get All Maintenances Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all scheduled maintenances. This is useful for monitoring planned downtime. ```python >>> api.get_maintenances() [ { "id": 1, "title": "title", "description": "description", "strategy": , "intervalDay": 1, "active": true, "dateRange": [ "2022-12-27 15:39:00", "2022-12-30 15:39:00" ], "timeRange": [ { "hours": 0, "minutes": 0 }, { "hours": 0, "minutes": 0 } ], "weekdays": [], "daysOfMonth": [], "timeslotList": [ { "startDate": "2022-12-27 22:36:00", "endDate": "2022-12-29 22:36:00" } ], "cron": "", "durationMinutes": null, "timezoneOption": "Europe/Berlin", "timezoneOffset": "+02:00", "status": "ended" } ] ``` -------------------------------- ### Initialize and Login to Uptime Kuma API Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Import the UptimeKumaApi class and initialize it with the server URL, username, and password to establish a connection. The login method returns an authentication token. ```python from uptime_kuma_api import UptimeKumaApi api = UptimeKumaApi('INSERT_URL') api.login('INSERT_USERNAME', 'INSERT_PASSWORD') ``` -------------------------------- ### Get Game List Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of games supported by the GameDig monitor type. ```APIDOC ## get_game_list() ### Description Get a list of games that are supported by the GameDig monitor type. ### Returns - **list[dict]** - A list of dictionaries, where each dictionary represents a supported game. ### Example ```python api.get_game_list() ``` ``` -------------------------------- ### Set Server Settings Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Configure various server settings such as update checks, data retention, timezone, and security options. Use this to customize Uptime Kuma's behavior and appearance. ```python >>> api.set_settings( ... checkUpdate=False, ... checkBeta=False, ... keepDataPeriodDays=180, ... serverTimezone="Europe/Berlin", ... entryPage="dashboard", ... searchEngineIndex=False, ... primaryBaseURL="", ... steamAPIKey="", ... dnsCache=False, ... tlsExpiryNotifyDays=[ ... 7, ... 14, ... 21 ... ], ... disableAuth=False, ... trustProxy=False ... ) { 'msg': 'Saved' } ``` -------------------------------- ### Authentication Methods Source: https://uptime-kuma-api.readthedocs.io/en/latest/genindex.html Methods for establishing a session with the Uptime Kuma instance. ```APIDOC ## login() ### Description Authenticates the user with the Uptime Kuma instance. ## login_by_token() ### Description Authenticates the user using a provided token. ## logout() ### Description Terminates the current session. ``` -------------------------------- ### test_notification Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Tests a notification configuration. This allows verifying that a notification setup is working correctly before applying it. ```APIDOC ## test_notification ### Description Test a notification configuration. ### Parameters #### Request Body - **name** (str) - Required - Friendly Name for the notification. - **type** (NotificationType) - Required - The type of notification service to use. - **isDefault** (bool) - Optional - Whether this notification should be enabled by default for new monitors., defaults to False - **applyExisting** (bool) - Optional - Whether to apply this notification to all existing monitors., defaults to False - **alertaApiEndpoint** (str) - Optional - Notification option for `type` `ALERTA`. - **alertaApiKey** (str) - Optional - Notification option for `type` `ALERTA`. - **alertaEnvironment** (str) - Optional - Notification option for `type` `ALERTA`. - **alertaAlertState** (str) - Optional - Notification option for `type` `ALERTA`. - **alertaRecoverState** (str) - Optional - Notification option for `type` `ALERTA`. - **alertNowWebhookURL** (str) - Optional - Notification option for `type` `ALERTNOW`. - **phonenumber** (str) - Optional - Notification option for `type` `ALIYUNSMS`. - **templateCode** (str) - Optional - Notification option for `type` `ALIYUNSMS`. - **signName** (str) - Optional - Notification option for `type` `ALIYUNSMS`. - **accessKeyId** (str) - Optional - Notification option for `type` `ALIYUNSMS`. - **secretAccessKey** (str) - Optional - Notification option for `type` `ALIYUNSMS`. - **appriseURL** (str) - Optional - Notification option for `type` `APPRISE`. - **title** (str) - Required - Notification option for `type` `APPRISE`. - **barkEndpoint** (str) - Optional - Notification option for `type` `BARK`. - **barkGroup** (str) - Optional - Notification option for `type` `BARK`. - **barkSound** (str) - Optional - Notification option for `type` `BARK`. - **clicksendsmsLogin** (str) - Optional - Notification option for `type` `CLICKSENDSMS`. - **clicksendsmsPassword** (str) - Optional - Notification option for `type` `CLICKSENDSMS`. - **clicksendsmsToNumber** (str) - Optional - Notification option for `type` `CLICKSENDSMS`. - **clicksendsmsSenderName** (str) - Required - Notification option for `type` `CLICKSENDSMS`. ### Returns #### Success Response (200) - **dict** - The server response, typically indicating success or failure of the test. ### Request Example ```python api.test_notification(name="Test Notification", type=NotificationType.PUSHOVER, userKey="abcdef123456") ``` ``` -------------------------------- ### Get All Notifications Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves a list of all configured notifications. This is useful for auditing or displaying notification settings. ```python >>> api.get_notifications() [ { 'active': True, 'applyExisting': True, 'id': 1, 'isDefault': True, 'name': 'notification 1', 'pushAPIKey': '123456789', 'type': 'userId': 1 } ] ``` -------------------------------- ### info() Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves general information about the Uptime Kuma server, including its version, container status, and timezone settings. ```APIDOC ## info() ### Description Retrieves general information about the Uptime Kuma server, including its version, container status, and timezone settings. ### Method GET ### Endpoint /api/info ### Parameters None ### Request Example ```json { "example": "api.info()" } ``` ### Response #### Success Response (200) - **isContainer** (boolean) - Indicates if the server is running in a container. - **latestVersion** (string) - The latest available version of Uptime Kuma. - **primaryBaseURL** (string) - The primary base URL for the server. - **serverTimezone** (string) - The timezone configured for the server. - **serverTimezoneOffset** (string) - The timezone offset from UTC. - **version** (string) - The current version of Uptime Kuma. #### Response Example ```json { "isContainer": true, "latestVersion": "1.23.1", "primaryBaseURL": "", "serverTimezone": "Europe/Berlin", "serverTimezoneOffset": "+02:00", "version": "1.23.1" } ``` ``` -------------------------------- ### Get Monitor Status Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the current status of a specific monitor. This is essential for real-time monitoring and alerting. ```APIDOC ## get_monitor_status ### Description Get the monitor status. ### Parameters #### Path Parameters - **monitor_id** (int) - Required - Id of the monitor. ### Response #### Success Response (200) - **MonitorStatus** - The monitor status. ### Response Example ```python ``` ``` -------------------------------- ### Get Database Size Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the current size of the Uptime Kuma database. Returns the size in bytes. ```python api.get_database_size() ``` -------------------------------- ### Add Proxy Configuration Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Adds a new proxy to the Uptime Kuma configuration. Requires protocol, host, and port. Authentication and other options are optional. ```python >>> api.add_proxy( ... protocol=ProxyProtocol.HTTP, ... host="127.0.0.1", ... port=8080, ... auth=True, ... username="username", ... password="password", ... active=True, ... default=False, ... applyExisting=False ... ) ``` -------------------------------- ### test_chrome Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Tests if the Chrome executable is valid and returns its version. This is useful for verifying the environment setup for browser-based monitoring. ```APIDOC ## test_chrome ### Description Tests if the chrome executable is valid and returns the version. ### Method POST (assumed based on function name and parameter) ### Endpoint /api/test/chrome (assumed based on function name) ### Parameters #### Path Parameters - **_executable_** (str) - Required - The path to the chrome executable. ### Response #### Success Response (200) - **msg** (str) - A message indicating the found browser and its version. ### Response Example ```json { "msg": "Found Chromium/Chrome. Version: 90.0.4430.212" } ``` ``` -------------------------------- ### Login with Token Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Logs into the Uptime Kuma service using a pre-generated login token obtained from the `login()` method. ```python api.login_by_token(token) ``` -------------------------------- ### Get API Key Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves details for a specific API key by its ID. This allows for inspection of individual key properties. ```APIDOC ## get_api_key ### Description Get an api key. ### Parameters #### Path Parameters - **id** (int) - Required - Id of the api key to get. ### Response #### Success Response (200) - **dict** - The api key. ### Response Example ```json { "id": 1, "name": "test", "userID": 1, "createdDate": "2023-03-20 11:15:05", "active": false, "expires": null, "status": "inactive" } ``` ``` -------------------------------- ### Get Monitors for a Maintenance Period Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html This snippet retrieves a list of all monitors associated with a specific maintenance period, identified by its ID. ```python >>> api.get_monitor_maintenance(1) [ { "id": 1 }, { "id": 2 } ] ``` -------------------------------- ### get_settings Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves the current Uptime Kuma server settings. ```APIDOC ## get_settings ### Description Retrieves the current Uptime Kuma server settings. ### Response #### Success Response (200) - **dict** - An object containing all server settings. ### Request Example ```python api.get_settings() ``` ### Response Example ```json { "checkBeta": false, "checkUpdate": false, "chromeExecutable": "", "disableAuth": false, "dnsCache": true, "entryPage": "dashboard", "keepDataPeriodDays": 180, "nscd": false, "primaryBaseURL": "", "searchEngineIndex": false, "serverTimezone": "Europe/Berlin", "steamAPIKey": "", "tlsExpiryNotifyDays": [ 7, 14, 21 ], "trustProxy": false } ``` ``` -------------------------------- ### Add Monitor Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Adds a new monitor to Uptime Kuma with specified details. ```APIDOC ## Add Monitor ### Description Creates a new monitor in Uptime Kuma. You need to be logged in to use this method. ### Method ```python add_monitor(type: MonitorType, name: str, url: str, **kwargs) ``` ### Parameters - **type** (MonitorType) - The type of monitor (e.g., MonitorType.HTTP). - **name** (str) - The name of the monitor. - **url** (str) - The URL to monitor. - **kwargs** - Additional parameters for monitor configuration (e.g., `interval`, `headers`, `auth`). ### Request Example ```python from uptime_kuma_api import UptimeKumaApi, MonitorType api = UptimeKumaApi('INSERT_URL') api.login('INSERT_USERNAME', 'INSERT_PASSWORD') add_response = api.add_monitor( type=MonitorType.HTTP, name="Google", url="https://google.com" ) print(add_response) ``` ### Response #### Success Response (200) - **msg** (str) - Confirmation message (e.g., 'Added Successfully.'). - **monitorId** (int) - The ID of the newly created monitor. #### Response Example ```json { "msg": "Added Successfully.", "monitorId": 1 } ``` ``` -------------------------------- ### Get Specific Maintenance Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves details for a single maintenance schedule by its ID. Use this to inspect a specific planned downtime. ```python >>> api.get_maintenance(1) { "id": 1, "title": "title", "description": "description", "strategy": , "intervalDay": 1, "active": true, "dateRange": [ "2022-12-27 15:39:00", "2022-12-30 15:39:00" ], "timeRange": [ { "hours": 0, "minutes": 0 }, { "hours": 0, "minutes": 0 } ], "weekdays": [], "daysOfMonth": [], "timeslotList": [ { "startDate": "2022-12-27 22:36:00", "endDate": "2022-12-29 22:36:00" } ], "cron": null, "duration": null, "durationMinutes": 0, "timezoneOption": "Europe/Berlin", "timezoneOffset": "+02:00", "status": "ended" } ``` -------------------------------- ### Get Specific Tag Source: https://uptime-kuma-api.readthedocs.io/en/latest/api.html Retrieves details for a single tag by its ID. Returns the tag's ID, name, and color. ```python >>> api.get_tag(1) { 'color': '#ffffff', 'id': 1, 'name': 'tag 1' } ```