### Install via Go Source: https://github.com/hosttracker/cli/blob/main/README.md Installs the binary using the Go toolchain. ```sh go install github.com/HostTracker/cli/cmd/ht-cli@latest ``` -------------------------------- ### Install on Windows Source: https://github.com/hosttracker/cli/blob/main/README.md Installs the CLI using Scoop or winget. ```powershell scoop bucket add hosttracker https://github.com/HostTracker/scoop-bucket scoop install ht-cli ``` ```powershell winget install HostTracker.ht-cli ``` -------------------------------- ### Install via Release Binary Source: https://github.com/hosttracker/cli/blob/main/README.md Downloads and installs the binary from a tarball. ```sh ver=$(curl -fsSL https://api.github.com/repos/HostTracker/cli/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') curl -fsSLO "https://github.com/HostTracker/cli/releases/download/v$ver/ht-cli_${ver}_linux_amd64.tar.gz" tar xzf "ht-cli_${ver}_linux_amd64.tar.gz" sudo install ht-cli /usr/local/bin/ht-cli ``` -------------------------------- ### Install via Shell Script Source: https://github.com/hosttracker/cli/blob/main/README.md Downloads the latest release and installs it to ~/.local/bin. ```sh curl -fsSL https://raw.githubusercontent.com/HostTracker/cli/main/install.sh | sh ``` -------------------------------- ### Install via Homebrew Source: https://github.com/hosttracker/cli/blob/main/README.md Use Homebrew to install the CLI on macOS or Linux. ```sh brew install HostTracker/tap/ht-cli ``` -------------------------------- ### Install on Fedora, RHEL, CentOS, and openSUSE Source: https://github.com/hosttracker/cli/blob/main/README.md Configures the dnf repository and installs the package. ```sh sudo curl -fsSL -o /etc/yum.repos.d/hosttracker.repo https://hosttracker.github.io/apt/rpm/hosttracker.repo sudo dnf install ht-cli ``` -------------------------------- ### Install on Arch Linux Source: https://github.com/hosttracker/cli/blob/main/README.md Installs the package from the AUR using yay. ```sh yay -S ht-cli-bin ``` -------------------------------- ### Install on Debian and Ubuntu Source: https://github.com/hosttracker/cli/blob/main/README.md Adds the signed HostTracker apt repository and installs the package. ```sh curl -fsSL https://hosttracker.github.io/apt/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/hosttracker.gpg echo "deb [signed-by=/usr/share/keyrings/hosttracker.gpg] https://hosttracker.github.io/apt stable main" | sudo tee /etc/apt/sources.list.d/hosttracker.list sudo apt update && sudo apt install ht-cli ``` -------------------------------- ### Install ht-cli Source: https://github.com/hosttracker/cli/blob/main/llms.txt Commands to install the HostTracker CLI on macOS, Linux, Windows, and via Docker or Go. ```sh brew install HostTracker/tap/ht-cli # macOS, Linux curl -fsSL https://raw.githubusercontent.com/HostTracker/cli/main/install.sh | sh sudo apt install ht-cli # after adding https://hosttracker.github.io/apt sudo dnf install ht-cli # after adding https://hosttracker.github.io/apt/rpm/hosttracker.repo yay -S ht-cli-bin # Arch, from the AUR scoop bucket add hosttracker https://github.com/HostTracker/scoop-bucket && scoop install ht-cli winget install HostTracker.ht-cli # Windows docker run --rm -e HT_TOKEN ghcr.io/hosttracker/ht-cli monitors list # or docker.io/hosttracker/ht-cli go install github.com/HostTracker/cli/cmd/ht-cli@latest # Go 1.24+ ``` -------------------------------- ### Install via .deb or .rpm Package Source: https://github.com/hosttracker/cli/blob/main/README.md Downloads and installs a specific package version manually. ```sh ver=$(curl -fsSL https://api.github.com/repos/HostTracker/cli/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') curl -fsSLO "https://github.com/HostTracker/cli/releases/download/v$ver/ht-cli_${ver}_linux_amd64.deb" sudo apt install "./ht-cli_${ver}_linux_amd64.deb" ``` -------------------------------- ### Install on Alpine Linux Source: https://github.com/hosttracker/cli/blob/main/README.md Downloads and installs the .apk package with untrusted source allowance. ```sh ver=$(curl -fsSL https://api.github.com/repos/HostTracker/cli/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p') curl -fsSLO "https://github.com/HostTracker/cli/releases/download/v$ver/ht-cli_${ver}_linux_amd64.apk" sudo apk add --allow-untrusted "./ht-cli_${ver}_linux_amd64.apk" ``` -------------------------------- ### CLI Error Handling Example Source: https://github.com/hosttracker/cli/blob/main/README.md Example of a command failure showing the error output and the resulting exit code. ```console $ ht-cli monitors get 00000000-0000-4000-8000-000000000099 ht-cli: not_found (HTTP 404) No such monitor. /id: value=00000000-0000-4000-8000-000000000099 request 9515cf81-e64f-459d-b4e5-7d7d9f77ded2 https://api2.host-tracker.com/problems/not_found $ echo $? 4 ``` -------------------------------- ### HostTracker CLI Usage Examples Source: https://github.com/hosttracker/cli/blob/main/llms.txt Common commands for authentication, monitor management, and API interaction. ```sh ht-cli auth login # prompts, verifies, and stores the token 0600 ht-cli auth status # which credential is in force, and whether it works export HT_TOKEN=... # or pass it by environment, which is what CI wants ht-cli account get-quota # what the account has left ht-cli monitors list --state down --type http --tag prod # narrow a listing ht-cli monitors list --all # follow the cursor to exhaustion ht-cli monitors get --expand settings,lastResult ht-cli monitors create --set name="api health" --set type=http \ --set url=https://api.example.com/health --set interval=5 ht-cli check run https://www.host-tracker.com --type http --country de --wait ht-cli jobs wait "$job" # a bulk edit answers with a job id ht-cli webhooks verify --secret "$HT_WEBHOOK_SECRET" --headers-file headers.txt < body.json ht-cli api GET /monitor --query limit=5 --query state=down # the escape hatch ``` -------------------------------- ### Get a configuration setting Source: https://github.com/hosttracker/cli/blob/main/docs/config.md Prints the value of a specific key for the current profile. ```bash ht-cli config get ``` -------------------------------- ### GET /monitor/type Source: https://github.com/hosttracker/cli/blob/main/docs/monitor-types.md Lists every monitor type with its label, entitlement, and constraints. ```APIDOC ## GET /monitor/type ### Description List every monitor type, with its label, entitlement and constraints. Use it to drive a type picker or to validate a type before a create. ### Method GET ### Endpoint /monitor/type ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /monitor/type/q. ``` -------------------------------- ### Store an API token Source: https://github.com/hosttracker/cli/blob/main/docs/auth.md Usage examples for storing an API token in a profile using different input methods. ```bash ht-cli auth login prompt for a token ht-cli auth login --token-stdin < token.txt read it from a file ht-cli auth login --profile staging store it under another profile ``` -------------------------------- ### GET /contact/type Source: https://github.com/hosttracker/cli/blob/main/docs/contacts.md List the contact types, their gateways, and their capabilities. ```APIDOC ## GET /contact/type ### Description List the contact types, their gateways, and their capabilities. Use it to build a contact form or to validate a type before a create. ### Method GET ### Endpoint /contact/type ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **limit** (int64) - Optional - Rows to return. ``` -------------------------------- ### GET /account Source: https://github.com/hosttracker/cli/blob/main/docs/account.md Read the account identity, package, usage, limits, and status. ```APIDOC ## GET /account ### Description Returns the caller's account in one document, including identity, package, usage, limits, and status. ### Method GET ### Endpoint /account ### Parameters #### Query Parameters - **expand** (stringSlice) - Optional - Comma-separated names of the extra blocks to embed (e.g., quota). - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. ``` -------------------------------- ### Get status page configuration Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md Retrieves the full configuration, settings, and component set for a status page. ```bash ht-cli status-pages get [flags] ``` -------------------------------- ### POST /monitor Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Creates a new monitor. Supports optional inline creation of contacts and subscriptions to enable full site setup in a single request. ```APIDOC ## POST /monitor ### Description Creates one monitor of the given type. Can optionally create or bind contacts and wire alert/report subscriptions in the same request. ### Method POST ### Endpoint /monitor ### Parameters #### Query Parameters - **dryRun** (bool) - Optional - Validate and preview actions without writing data. #### Request Body - **onOverlimit** (string) - Optional - Behavior when package limit is reached: 'fail' (default) or 'disable'. - **Idempotency-Key** (string) - Required if body contains inline contacts. - **interval** (integer) - Optional - Monitor check cadence. ### Request Example { "type": "http", "name": "My Monitor", "onOverlimit": "fail", "interval": 5 } ``` -------------------------------- ### Get results summary Source: https://github.com/hosttracker/cli/blob/main/docs/results.md Aggregates uptime and SLA figures for monitors over a specified time window. Supports grouping by monitor or account and optional timing metrics. ```bash ht-cli results get-summary [flags] ``` -------------------------------- ### GET /check/type Source: https://github.com/hosttracker/cli/blob/main/docs/instant-checks.md Retrieves a list of available instant-check types and their associated options. ```APIDOC ## GET /check/type ### Description Returns the catalogue of instant-check types with a description, an example target, and any per-type options such as device profiles or record types. ### Method GET ### Endpoint /check/type ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. - **all** (flag) - Optional - Walks every page. ``` -------------------------------- ### Execute API requests with ht-cli Source: https://github.com/hosttracker/cli/blob/main/docs/api.md Examples of using the api command to perform various HTTP methods with query parameters, body sets, and JSON payloads. ```bash ht-cli api GET /account ht-cli api GET /monitor --query limit=5 --query state=down ht-cli api POST /monitor --set name=api --set type=http --set url=https://example.com ht-cli api PATCH /monitor/ --json '{"enabled":false}' ``` ```bash ht-cli api [flags] ``` -------------------------------- ### GET /account/usage Source: https://github.com/hosttracker/cli/blob/main/docs/account.md Read the account's current resource consumption per domain. ```APIDOC ## GET /account/usage ### Description Returns how much of each resource the account is using, including monitor, contact, report, and maintenance usage. ### Method GET ### Endpoint /account/usage ### Parameters #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. ``` -------------------------------- ### Get monitor type details Source: https://github.com/hosttracker/cli/blob/main/docs/monitor-types.md Retrieves the catalogue row and full settings schema for a specific monitor type. ```bash ht-cli monitor-types get [flags] ``` -------------------------------- ### GET /report Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md List every report subscription on the account as a flat list of monitor and contact pairs. ```APIDOC ## GET /report ### Description Returns every (monitor, contact) report pair the account holds as one flat list. Results can be narrowed using various monitor and contact filters. ### Method GET ### Endpoint /report ### Parameters #### Query Parameters - **contact-confirmed** (bool) - Optional - Filter by contact confirmation status. - **contact-id** (stringSlice) - Optional - Filter by contact ID (repeatable). - **contact-q** (string) - Optional - Filter by contact query. - **contact-type** (stringSlice) - Optional - Filter by contact type (repeatable). - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Fields to include in the response (repeatable). - **limit** (int64) - Optional - Number of rows to return. - **monitor-id** (stringSlice) - Optional - Filter by monitor ID (repeatable). - **monitor-like** (bool) - Optional - Enable partial matching for monitor URL. - **monitor-q** (string) - Optional - Filter by monitor query. - **monitor-tag** (stringSlice) - Optional - Filter by monitor tag (repeatable). - **monitor-type** (stringSlice) - Optional - Filter by monitor type (repeatable). - **monitor-url** (stringSlice) - Optional - Filter by monitor URL (repeatable). - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /report/q. ``` -------------------------------- ### Get combined settings schema Source: https://github.com/hosttracker/cli/blob/main/docs/monitor-types.md Retrieves a single JSON Schema document containing the settings shapes for all monitor types. ```bash ht-cli monitor-types get-settings-schema ``` -------------------------------- ### GET /monitor/result/summary Source: https://github.com/hosttracker/cli/blob/main/docs/results.md Retrieves aggregated uptime, SLA, and response-time figures across monitors over a specified time window. ```APIDOC ## GET /monitor/result/summary ### Description Returns aggregated uptime and SLA figures for monitors. Supports bucketing, timing metrics, and account-level roll-ups. ### Method GET ### Endpoint /monitor/result/summary ### Parameters #### Query Parameters - **--bucket** (string) - Optional - none | hour | day | week | month - **--cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor - **--expand** (stringSlice) - Optional - Extra blocks to embed (monitor, monitor.settings, etc.) - **--fields** (stringSlice) - Optional - Top-level members to keep on each row - **--from** (int64) - Optional - Start of the time window (Unix seconds) - **--group-by** (string) - Optional - monitor (default) or account - **--limit** (int64) - Optional - Rows to return - **--metrics** (stringSlice) - Optional - Timing metrics to include - **--monitor** (stringSlice) - Required - The monitors to summarise - **--query-file** (string) - Optional - Filter with a body query read from a file - **--query** (string) - Optional - Filter with a body query - **--sla** (float64) - Optional - Ad-hoc SLA target in percent - **--to** (int64) - Optional - End of the time window (Unix seconds) ``` -------------------------------- ### GET /monitor/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Retrieves a single monitor with its full configuration, supporting optional data expansion and field filtering. ```APIDOC ## GET /monitor/{id} ### Description Retrieve one monitor, with its full configuration. Returns a single monitor in the same row shape as the list endpoint. ### Method GET ### Endpoint /monitor/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The monitor id #### Query Parameters - **expand** (stringSlice) - Optional - Comma-separated names of the extra blocks to embed. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **from** (int64) - Optional - The start of the time window, in Unix seconds. - **to** (int64) - Optional - The end of the time window, in Unix seconds. ``` -------------------------------- ### GET /monitor Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Retrieves a list of monitors for the account. Supports filtering by various attributes, sorting, and expanding related resources. ```APIDOC ## GET /monitor ### Description List the account's monitors, filtered, sorted and cursor-paginated. Returns a lean projection of monitors with options to expand related data. ### Method GET ### Endpoint /monitor ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **enabled** (bool) - Optional - The CONFIGURED flag, matching the resource's own enabled member. - **expand** (stringSlice) - Optional - Comma-separated names of the extra blocks to embed. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **from** (int64) - Optional - Window start, Unix seconds. - **id** (stringSlice) - Optional - Explicit ids. - **include-id** (stringSlice) - Optional - Ids to include in the answer regardless of other filters. - **like** (bool) - Optional - true switches url= from exact match to case-insensitive SUBSTRING match. - **limit** (int64) - Optional - Rows to return. - **open-stat** (bool) - Optional - Whether the monitor's statistics are publicly shared. - **paused-last** (bool) - Optional - Order every monitor that is NOT being checked after every monitor that is. - **preset** (stringSlice) - Optional - Monitors built from a server-side settings PRESET. - **q** (string) - Optional - Case-insensitive substring over name AND url. - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /monitor/q. - **sort** (string) - Optional - Sort field (name, state, type, interval, lastChange, url, tags, created) with optional :asc or :desc suffix. - **state** (stringSlice) - Optional - up, down, paused, or maintenance. - **tag** (stringSlice) - Optional - Tags, matched exactly. - **to** (int64) - Optional - Window end, Unix seconds. - **type** (stringSlice) - Optional - One or more of the 14 v2 type tokens. - **updated-since** (string) - Optional - Return only what changed since this point. - **url** (stringSlice) - Optional - Address filter. ``` -------------------------------- ### GET /monitor/type/{type} Source: https://github.com/hosttracker/cli/blob/main/docs/monitor-types.md Retrieves the catalogue row and full settings schema for a specific monitor type. ```APIDOC ## GET /monitor/type/{type} ### Description Get one monitor type's catalogue row and its full settings schema. Returns the complete JSON Schema describing one type's settings object. ### Method GET ### Endpoint /monitor/type/{type} ### Parameters #### Path Parameters - **type** (string) - Required - The kind of thing this is, from the relevant catalogue's closed vocabulary. #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (type | schema | attachedSchema). ``` -------------------------------- ### Get monitor snapshot Source: https://github.com/hosttracker/cli/blob/main/docs/results.md Retrieves a binary page snapshot for a specific check result. The response supports ETag caching for efficient retrieval. ```bash ht-cli results get-monitor-snapshot [flags] ``` -------------------------------- ### Initialize ht-cli usage Source: https://github.com/hosttracker/cli/blob/main/docs/README.md Common commands to authenticate, list monitors, and perform a one-off check. ```bash ht-cli auth login store an API token ht-cli monitors list the account's monitors ht-cli check run https://example.com a one-off check, no monitor needed ``` -------------------------------- ### List configuration profiles Source: https://github.com/hosttracker/cli/blob/main/docs/config.md Displays all available profiles and their associated settings. ```bash ht-cli config list ``` -------------------------------- ### Print configuration file path Source: https://github.com/hosttracker/cli/blob/main/docs/config.md Displays the absolute file path where settings are currently stored. ```bash ht-cli config path ``` -------------------------------- ### GET /webhook Source: https://github.com/hosttracker/cli/blob/main/docs/webhooks.md Lists all webhooks registered to the account, providing details on their enabled state, event subscriptions, and delivery health. ```APIDOC ## GET /webhook ### Description Returns a list of all webhooks registered on the account. Supports sorting, pagination, and filtering by update time. ### Method GET ### Endpoint /webhook ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response for pagination. - **fields** (stringSlice) - Optional - Specifies which top-level members to return. - **limit** (int64) - Optional - Number of rows to return. - **sort** (string) - Optional - Sort criteria (created, updated, name, url) with optional :asc or :desc suffix. - **updated-since** (string) - Optional - Return only rows edited since this point (Unix seconds or syncCursor). ### Request Body (via POST /webhook/q) - **query-file** (string) - Optional - Path to a JSON file containing a body query. - **query** (string) - Optional - Inline JSON body query. ``` -------------------------------- ### Get account usage Source: https://github.com/hosttracker/cli/blob/main/docs/account.md Retrieves current resource consumption per domain. This provides specific headroom data for monitors, contacts, reports, and maintenance windows. ```bash ht-cli account get-usage [flags] ``` -------------------------------- ### Display version information Source: https://github.com/hosttracker/cli/blob/main/docs/version.md Executes the version command to output the current versions of the CLI, SDK, and toolchain. ```bash ht-cli version ``` -------------------------------- ### GET /report/by-monitor Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Retrieves a list of report subscriptions grouped by monitor. ```APIDOC ## GET /report/by-monitor ### Description List every report subscription on the account, grouped by monitor. Each monitor's identity is carried once with its subscribed contacts nested underneath. ### Method GET ### Endpoint /report/by-monitor ### Parameters #### Query Parameters - **contact-confirmed** (bool) - Optional - Narrows the result. - **contact-id** (stringSlice) - Optional - Narrows the result (repeatable). - **contact-q** (string) - Optional - Narrows the result. - **contact-type** (stringSlice) - Optional - Narrows the result (repeatable). - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (repeatable). - **limit** (int64) - Optional - Rows to return. - **monitor-id** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-like** (bool) - Optional - Narrows the result. - **monitor-q** (string) - Optional - Narrows the result. - **monitor-tag** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-type** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-url** (stringSlice) - Optional - Narrows the result (repeatable). ``` -------------------------------- ### GET /check Source: https://github.com/hosttracker/cli/blob/main/docs/instant-checks.md Returns a page of the instant checks this account has run, newest first, optionally narrowed by time window or check type. ```APIDOC ## GET /check ### Description Returns a page of the instant checks this account has run, newest first, optionally narrowed by time window or check type. ### Method GET ### Endpoint /check ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (id | dbId | type | url | state | up | created | doneAt). - **from** (int64) - Optional - The start of the time window, in Unix seconds. - **limit** (int64) - Optional - Rows to return. - **query** (string) - Optional - Filter with a body query against /check/q. - **to** (int64) - Optional - The end of the time window, in Unix seconds. - **type** (stringSlice) - Optional - v2 type tokens (crawl | dns | dnsbl | http | ping | port | rusRegBL | trace | ...). ``` -------------------------------- ### GET /report/by-contact Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Lists all report subscriptions on the account, grouped by contact. ```APIDOC ## GET /report/by-contact ### Description List every report subscription on the account, grouped by contact. Filters can be applied via query parameters or a JSON body file. ### Method GET ### Endpoint /report/by-contact ### Parameters #### Query Parameters - **contact-confirmed** (bool) - Optional - Narrows the result. - **contact-id** (stringSlice) - Optional - Narrows the result. - **contact-q** (string) - Optional - Narrows the result. - **contact-type** (stringSlice) - Optional - Narrows the result. - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (contact | subscriptions). - **limit** (int64) - Optional - Rows to return. - **monitor-id** (stringSlice) - Optional - Narrows the result. - **monitor-like** (bool) - Optional - Narrows the result. - **monitor-q** (string) - Optional - Narrows the result. - **monitor-tag** (stringSlice) - Optional - Narrows the result. - **monitor-type** (stringSlice) - Optional - Narrows the result. - **monitor-url** (stringSlice) - Optional - Narrows the result. - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /report/by-contact/q. ``` -------------------------------- ### GET /account/member Source: https://github.com/hosttracker/cli/blob/main/docs/account.md List the contacts holding shared access to the account. ```APIDOC ## GET /account/member ### Description Returns a page of the people granted shared access to the account. ### Method GET ### Endpoint /account/member ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /account/member/q. ``` -------------------------------- ### Create a monitor via CLI Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Basic command structure for creating a monitor using the ht-cli tool. ```bash ht-cli monitors create [flags] ``` -------------------------------- ### GET /alert/by-contact Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md List every alert subscription on the account, grouped by contact. ```APIDOC ## GET /alert/by-contact ### Description List every alert subscription on the account, grouped by contact. This operation returns one page by default. ### Method GET ### Endpoint /alert/by-contact ### Parameters #### Query Parameters - **contact-confirmed** (bool) - Optional - Narrows the result. - **contact-id** (stringSlice) - Optional - Narrows the result (repeatable). - **contact-q** (string) - Optional - Narrows the result. - **contact-type** (stringSlice) - Optional - Narrows the result (repeatable). - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (repeatable). - **limit** (int64) - Optional - Rows to return. - **monitor-id** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-like** (bool) - Optional - Narrows the result. - **monitor-q** (string) - Optional - Narrows the result. - **monitor-tag** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-type** (stringSlice) - Optional - Narrows the result (repeatable). - **monitor-url** (stringSlice) - Optional - Narrows the result (repeatable). ``` -------------------------------- ### GET /statuspage/{id}/subscriber Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md List all subscribers for a specific status page. ```APIDOC ## GET /statuspage/{id}/subscriber ### Description Returns every subscriber for a status page, including email addresses with confirmation states and push channels like webhooks, Slack, or Teams. ### Method GET ### Endpoint /statuspage/{id}/subscriber ### Parameters #### Path Parameters - **id** (string) - Required - The status page ID. #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Top-level members to keep on each row (e.g., id, kind, email). - **limit** (int64) - Optional - Number of rows to return. ``` -------------------------------- ### Create a status page Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md Initializes a new status page with a unique slug and optional configuration settings. ```bash ht-cli status-pages create [flags] ``` -------------------------------- ### GET /statuspage/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md Retrieves the full configuration and components of a status page. ```APIDOC ## GET /statuspage/{id} ### Description Returns the page's full configuration including settings and the ordered component set. ### Method GET ### Endpoint /statuspage/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The status page id #### Query Parameters - **--fields** (stringSlice) - Optional - Which top-level members to keep on each row (e.g., id, name). ``` -------------------------------- ### GET /report/type Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Retrieves a list of available report types, formats, and schedules. ```APIDOC ## GET /report/type ### Description Returns the catalogue of report types the account can generate, including supported output formats, content sections, and delivery frequencies. ### Method GET ### Endpoint /report/type ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (type | label | formats | sections | frequencies). - **limit** (int64) - Optional - Rows to return. - **query** (string) - Optional - Filter with a body query against /report/type/q: inline JSON, @file, or -. ``` -------------------------------- ### GET /maintenance/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/maintenance.md Retrieves a single maintenance window by its unique identifier. ```APIDOC ## GET /maintenance/{id} ### Description Read one maintenance window. Returns a single maintenance window in the same shape as the list response. ### Method GET ### Endpoint /maintenance/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The maintenance id #### Query Parameters - **expand** (stringSlice) - Optional - Comma-separated names of the extra blocks to embed (monitor | monitor.settings | monitor.subscription | monitor.lastIncident | monitor.maintenance) - **fields** (stringSlice) - Optional - Which top-level members to keep on each row ``` -------------------------------- ### GET /account/quota Source: https://github.com/hosttracker/cli/blob/main/docs/account.md Read the account's current API quota headroom. ```APIDOC ## GET /account/quota ### Description Returns how much of each metered quota pool remains and when each window resets. ### Method GET ### Endpoint /account/quota ### Parameters #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. ``` -------------------------------- ### Retrieve a monitor configuration via CLI Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Fetches a single monitor's full configuration, supporting optional expansion fields and time window filtering. ```bash ht-cli monitors get [flags] ``` -------------------------------- ### List monitors command Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Basic command syntax for listing monitors via the CLI. ```bash ht-cli monitors list [flags] ``` -------------------------------- ### List report subscriptions via CLI Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Executes the command to list all report subscriptions on the account. ```bash ht-cli reports list-subscription [flags] ``` -------------------------------- ### Get contact alert subscription Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Retrieves the alert subscription details between a contact and a monitor. ```bash ht-cli alerts get-contact [flags] ``` -------------------------------- ### Bulk create monitors Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Submits a batch of monitor definitions as a single asynchronous job. Requires an idempotency key to prevent duplicate creation on retries. ```bash ht-cli monitors bulk-create [flags] ``` -------------------------------- ### GET /report/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Reads a single report-subscription pair from the list by its unique identifier. ```APIDOC ## GET /report/{id} ### Description Read one report-subscription pair from the flat list, by its id. ### Method GET ### Endpoint /report/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The report id #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (id | monitor | contact | frequencies | created) ``` -------------------------------- ### Run live smoke tests Source: https://github.com/hosttracker/cli/blob/main/README.md Executes tests against a real account using an authentication token. ```sh HT_TOKEN=... go test -tags live ./cmd -run TestLive -v ``` -------------------------------- ### GET /monitor/report/{id}/content Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Downloads the rendered document bytes for a generated report. ```APIDOC ## GET /monitor/report/{id}/content ### Description Streams the report's bytes with a suggested filename in the requested format. ### Method GET ### Endpoint /monitor/report/{id}/content ### Parameters #### Path Parameters - **id** (string) - Required - The report id ``` -------------------------------- ### List alert subscriptions by monitor using ht-cli Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Basic command syntax to list alert subscriptions grouped by monitor. ```bash ht-cli alerts list-by-monitor [flags] ``` -------------------------------- ### Get contact report subscription Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Reads the report subscription between a specific contact and a monitor. ```bash ht-cli reports get-contact [flags] ``` -------------------------------- ### Run via Docker Source: https://github.com/hosttracker/cli/blob/main/README.md Executes the CLI in a containerized environment. ```sh docker run --rm -e HT_TOKEN ghcr.io/hosttracker/ht-cli monitors list docker run --rm -e HT_TOKEN hosttracker/ht-cli monitors list ``` -------------------------------- ### List monitor types Source: https://github.com/hosttracker/cli/blob/main/docs/monitor-types.md Lists all available monitor types, including labels, entitlements, and constraints. ```bash ht-cli monitor-types list [flags] ``` -------------------------------- ### Manage Configuration Profiles Source: https://github.com/hosttracker/cli/blob/main/README.md Commands to manage named profiles and configuration settings. ```sh ht-cli auth login --profile staging ht-cli --profile staging monitors list ht-cli config set output json ht-cli config list ``` -------------------------------- ### GET /alert/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Reads one alert-subscription pair from the flat list by its unique identifier. ```APIDOC ## GET /alert/{id} ### Description Returns the subscription details for a specific (monitor, contact) pair addressed by the provided ID. ### Method GET ### Endpoint /alert/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The alert id. #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (id | monitor | contact | alertTypes | created). ``` -------------------------------- ### GET /contact/{id}/alert/{monitorId} Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Reads the alert subscription between a specific contact and a monitor. ```APIDOC ## GET /contact/{id}/alert/{monitorId} ### Description Retrieves the alert subscription details for a specific contact and monitor pair. ### Method GET ### Endpoint /contact/{id}/alert/{monitorId} ### Parameters #### Path Parameters - **id** (string) - Required - The contact id - **monitorId** (string) - Required - The monitor id #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row (monitor | alertTypes | created) ``` -------------------------------- ### List instant-check types via CLI Source: https://github.com/hosttracker/cli/blob/main/docs/instant-checks.md Executes the command to retrieve the catalogue of available instant-check types and their associated options. ```bash ht-cli instant-checks list-type [flags] ``` -------------------------------- ### GET /contact Source: https://github.com/hosttracker/cli/blob/main/docs/contacts.md Retrieves a list of account contacts with support for filtering, pagination, and field expansion. ```APIDOC ## GET /contact ### Description Returns a page of contacts, which are the addresses where alerts and reports are delivered. Supports filtering by ID, type, confirmation state, or free-text search. ### Method GET ### Endpoint /contact ### Parameters #### Query Parameters - **confirmed** (bool) - Optional - Restrict to confirmed or unconfirmed contacts. - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **expand** (stringSlice) - Optional - Comma-separated names of extra blocks to embed (subscription, template, group, summary, count). - **fields** (stringSlice) - Optional - Top-level members to keep on each row. - **id** (stringSlice) - Optional - Explicit contact IDs to filter by. - **limit** (int64) - Optional - Number of rows to return. - **q** (string) - Optional - Case-insensitive substring search over name and address. - **sort** (string) - Optional - Sort by created, name, or address, with optional :asc or :desc suffix. - **type** (stringSlice) - Optional - Filter by contact-type tokens (email, sms, voiceCall, etc.). - **updated-since** (string) - Optional - Return changes since a specific Unix timestamp or syncCursor. ``` -------------------------------- ### List alert subscriptions via CLI Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Basic command structure for listing alert subscriptions with optional flags. ```bash ht-cli alerts list-subscription [flags] ``` -------------------------------- ### GET /contact/group/{id} Source: https://github.com/hosttracker/cli/blob/main/docs/contacts.md Reads a single contact group, returning its full membership snapshot. ```APIDOC ## GET /contact/group/{id} ### Description Read one contact group. Returns a single contact group with its full membership snapshot, in exactly the list's row shape. ### Method GET ### Endpoint /contact/group/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The group id #### Query Parameters - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. (id | name | created | items) ``` -------------------------------- ### Authenticate with HostTracker CLI Source: https://github.com/hosttracker/cli/blob/main/README.md Commands to log in and verify the current authentication status. ```sh ht-cli auth login # prompts, verifies, and stores it 0600 ht-cli auth status # which credential is in force, and whether it works ``` -------------------------------- ### Get report subscription by ID Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Reads a single report-subscription pair using its unique identifier. ```bash ht-cli reports get-subscription [flags] ``` -------------------------------- ### List report subscriptions by monitor Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Basic command syntax to list report subscriptions grouped by monitor. ```bash ht-cli reports list-by-monitor [flags] ``` -------------------------------- ### List contacts command syntax Source: https://github.com/hosttracker/cli/blob/main/docs/contacts.md Basic command structure for listing contacts via the CLI. ```bash ht-cli contacts list [flags] ``` -------------------------------- ### Get monitor report subscription Source: https://github.com/hosttracker/cli/blob/main/docs/reports.md Retrieves the report frequency for a specific monitor and contact pair. ```bash ht-cli reports get-monitor [flags] ``` -------------------------------- ### Get a single webhook by ID Source: https://github.com/hosttracker/cli/blob/main/docs/webhooks.md Retrieves the state of a specific webhook using its unique identifier. ```bash ht-cli webhooks get [flags] ``` -------------------------------- ### GET /maintenance Source: https://github.com/hosttracker/cli/blob/main/docs/maintenance.md Lists scheduled, active, and finished maintenance windows with support for pagination and filtering. ```APIDOC ## GET /maintenance ### Description List scheduled, active and finished maintenance windows. Returns a page of maintenance windows, optionally narrowed by time window, state or the monitors they cover. ### Method GET ### Endpoint /maintenance ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **expand** (stringSlice) - Optional - Comma-separated names of the extra blocks to embed. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **from** (int64) - Optional - Window START lower bound, Unix seconds. - **limit** (int64) - Optional - Rows to return. - **monitor** (stringSlice) - Optional - Only windows covering these monitors. - **query** (string) - Optional - Filter with a body query against /maintenance/q. - **query-file** (string) - Optional - Filter with a body query read from a file. - **sort** (string) - Optional - Sort order (from | created | from:asc | from:desc | created:asc | created:desc). - **state** (stringSlice) - Optional - Filter by state (scheduled | active | finished). - **to** (int64) - Optional - Window START upper bound, Unix seconds. - **updated-since** (string) - Optional - Return only what changed since this point. ``` -------------------------------- ### List device profiles Source: https://github.com/hosttracker/cli/blob/main/docs/instant-checks.md Command to retrieve available device profiles for emulating page-loading checks. ```bash ht-cli instant-checks list-device [flags] ``` -------------------------------- ### GET /agent/pool Source: https://github.com/hosttracker/cli/blob/main/docs/monitoring-locations.md Lists location pools, including counts, defaults, and presets for monitoring locations. ```APIDOC ## GET /agent/pool ### Description Returns the pools monitoring locations are grouped into, how many locations each offers per capability, and the account's own minimum-agent requirement. ### Method GET ### Endpoint /agent/pool ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. ``` -------------------------------- ### GET /agent/ip Source: https://github.com/hosttracker/cli/blob/main/docs/monitoring-locations.md Lists the IP addresses from which monitoring checks originate, useful for firewall allow-listing. ```APIDOC ## GET /agent/ip ### Description Returns the addresses checks are sent from, for allow-listing in a firewall or in a monitored service's access rules. ### Method GET ### Endpoint /agent/ip ### Parameters #### Query Parameters - **country** (stringSlice) - Optional - Filter by datacenter country names. - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **family** (stringSlice) - Optional - Restrict IP families (ipv4 or ipv6). - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. ``` -------------------------------- ### Create a contact group Source: https://github.com/hosttracker/cli/blob/main/docs/contacts.md Creates a named preset of contacts and their event selections. Requires at least one contact with at least one event. ```bash ht-cli contacts create-group [flags] ``` -------------------------------- ### GET /alert/type Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Retrieves the fixed vocabulary of alert types and alert delay values available for subscriptions. ```APIDOC ## GET /alert/type ### Description List the alert types and the alert delays a subscription may use. Use this to populate a picker or validate values before writing a subscription. ### Method GET ### Endpoint /alert/type ### Parameters #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **limit** (int64) - Optional - Rows to return. - **query-file** (string) - Optional - Filter with a body query read from a file. - **query** (string) - Optional - Filter with a body query against /alert/type/q. ``` -------------------------------- ### Create a maintenance window Source: https://github.com/hosttracker/cli/blob/main/docs/maintenance.md Schedules a maintenance window for specific monitors to suppress alerts. Requires either monitorIds or monitors to be defined. ```bash ht-cli maintenance create [flags] ``` -------------------------------- ### POST /monitor/bulk Source: https://github.com/hosttracker/cli/blob/main/docs/monitors.md Submits a batch of monitor definitions as a single asynchronous job. ```APIDOC ## POST /monitor/bulk ### Description Create many monitors at once as one asynchronous job. This operation returns a job ID to poll for per-item results. ### Method POST ### Endpoint /monitor/bulk ### Parameters #### Query Parameters - **--idempotency-key** (string) - Required - A client-chosen key, unique per logical request. - **--json** (string) - Optional - Request body: inline JSON, @file, or - for standard input. - **--set** (stringArray) - Optional - Set one body member (repeatable). ``` -------------------------------- ### GET /contact/{id}/alert Source: https://github.com/hosttracker/cli/blob/main/docs/alerts.md Lists the monitors that alert a specific contact, including the alert-type for each monitor. ```APIDOC ## GET /contact/{id}/alert ### Description List the monitors that alert this contact, with each monitor's alert-type set. ### Method GET ### Endpoint /contact/{id}/alert ### Parameters #### Path Parameters - **id** (string) - Required - The contact id #### Query Parameters - **cursor** (string) - Optional - Opaque cursor from a previous response's nextCursor. - **fields** (stringSlice) - Optional - Which top-level members to keep on each row. - **limit** (int64) - Optional - Rows to return. - **query** (string) - Optional - Filter with a body query against /contact/{id}/alert/q. - **query-file** (string) - Optional - Filter with a body query read from a file. ``` -------------------------------- ### Get incident details Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md Retrieves a specific incident's status, timeline, and postmortem information by ID. ```bash ht-cli status-pages get-incident [flags] ``` -------------------------------- ### Format CLI Output Source: https://github.com/hosttracker/cli/blob/main/README.md Use the -o flag to specify the output format. JSON is recommended for scripts, while table view is intended for human readability. ```sh ht-cli monitors list -o json | jq -r '.data[] | select(.state=="down") | .url' ht-cli account get -o yaml ``` -------------------------------- ### Create a status page template Source: https://github.com/hosttracker/cli/blob/main/docs/status-pages.md Saves a preset template for future incident declarations. Templates are immutable and should be replaced by deleting the old one and creating a new one. ```bash ht-cli status-pages create-template [flags] ``` -------------------------------- ### Set a configuration value Source: https://github.com/hosttracker/cli/blob/main/docs/config.md Updates a specific key with a new value for the current profile. Supported keys include token, base-url, and output. ```bash ht-cli config set ``` ```bash ht-cli config set base-url https://api2.host-tracker.com ht-cli config set output json ht-cli config set token "$HT_TOKEN" ```