REST API
OS updates
The agent reads the host’s own package manager (dnf, yum or apt) from what it already has on disk. It never runs the package manager, and never downloads anything itself. Three calls give you what it read:
| Call | Scope | Answers |
|---|---|---|
GET /v1/servers/{server_uuid}/os-updates |
servers.view |
200, the summary: counts, release, kernel, reboot, freshness |
GET /v1/servers/{server_uuid}/os-updates/packages |
security.view |
200, a page of pending packages |
POST /v1/servers/{server_uuid}/os-updates/recheck |
security.edit |
202, the recheck the agent will answer |
The summary carries counts only. Package names and versions are a map of what an attacker could use, so the list needs security.view, as the console’s drawer does. A key needs the scope and your role the same permission; see authentication and keys.
An uuid that does not exist, or belongs to another organisation, answers 404 not_found: the two cannot be told apart. A scope or permission the key lacks answers 403 forbidden.
Read the summary
Section titled “Read the summary”GET /v1/servers/{server_uuid}/os-updates returns one object per server, built from the same report the console’s OS updates card shows.
statusisok,no_metadata(the host has no package lists, or it runs Windows),unsupported,failedornot_reported(no report yet). The set is open: treat a value you do not know as “not counted”.reported_atandstale: when the last report arrived, andtruewhen that is over two days ago.observed_atis when the agent read the host.hostis what the host’s own package manager sees.security_by_levelcounts security updates ascritical,important,moderate,lowandunknown(an advisory that gives no severity).security_publishedisfalsewhen the host’s package sources publish no security data, and thenupdates_securityisnull, never 0.security_by_level, inhostand inat_latest, isnullwhen its levels are not known, never a row of zeros: always on Ubuntu and Debian, whose package lists give no severity, and on other servers until their levels have been read. Readupdates_securityfor the total.release_lockedandat_latestare for Amazon Linux 2023 only, below.kernelandreboot: the running kernel and the newest one present on the host, and whether the host needs a reboot, since when and why.recheck: whether you can ask for a recheck now, and the last one asked.recheck.stateavailablemeansPOST /v1/servers/{server_uuid}/os-updates/recheck(scopesecurity.edit) will be accepted now.
Every time is in epoch milliseconds, as everywhere in the API (see times and windows).
curl https://rest.watchtower15.com/v1/servers/$SERVER_UUID/os-updates \ -H "Authorization: Bearer $WT15_API_KEY"{ "data": { "package_manager": "dnf", "status": "ok", "reason": null, "observed_at": 1794563310000, "reported_at": 1794563312000, "stale": false, "metadata_refreshed_at": 1794559800000, "host": { "updates_total": 0, "updates_security": 0, "security_published": true, "security_by_level": { "critical": 0, "important": 0, "moderate": 0, "low": 0, "unknown": 0 }, "security_pending_since": null, "packages_truncated": false }, "release_locked": { "current": "2023.5.20240624", "follows_latest": false, "latest": "2023.9.20251110", "latest_released_on": "2025-11-10", "releases_behind": 31, "days_behind": 498 }, "at_latest": { "status": "matched", "reason": null, "release": "2023.9.20251110", "matched_at": 1794563400000, "checked_at": 1794563460000, "stale": false, "updates_total": 214, "updates_security": 96, "security_by_level": { "critical": 4, "important": 51, "moderate": 38, "low": 3, "unknown": 0 }, "advisory_counts": { "critical": 3, "important": 44, "moderate": 29, "low": 2, "unknown": 0, "total": 78 }, "kernel_candidate": "6.1.158-178.288.amzn2023", "security_pending_since": 1780000000000, "packages_truncated": false }, "kernel": { "running": "6.1.94-99.176.amzn2023", "newest_present": "6.1.94-99.176.amzn2023", "update_available": false }, "reboot": { "required": false, "since": null, "source": null, "package_count": 0 }, "recheck": { "state": "available", "available_at": null, "last": null } }}A server that has not reported answers status not_reported with every other field null but recheck.
Amazon Linux 2023: the host and the latest release
Section titled “Amazon Linux 2023: the host and the latest release”An Amazon Linux 2023 server is locked to the release it was built from. Inside that release its package manager sees almost nothing waiting, however far behind it is. So the summary answers two scopes:
host: whatdnf check-updateon the server would list, inside its locked release.at_latest: whatdnf upgrade --releasever=latestwould install, with the severity of every security update and the advisories behind them. WatchTower15 matches the server’s package inventory against Amazon’s own metadata for the latest release every hour, and within about 5 minutes of a new inventory.
release_locked says which release the server is on and how far behind it is. Both are null on a server that is not a locked Amazon Linux 2023 server (Ubuntu, a server that follows latest, Windows). at_latest.status is matched, awaiting_match (no inventory matched yet), no_inventory or index_unavailable; its stale is true when the match was last confirmed over two days ago.
List the pending packages
Section titled “List the pending packages”GET /v1/servers/{server_uuid}/os-updates/packages returns a page of the packages the server has waiting, security updates first. The list pages by page and per_page like every page list: see pagination.
Parameters
Section titled “Parameters”| Parameter | Type | Meaning |
|---|---|---|
scope |
host, latest |
host (the default): what the host’s own package manager lists. latest: what dnf upgrade --releasever=latest would install on a server locked to an Amazon Linux 2023 release; empty for any other server. The set is open. |
security_only |
boolean | true lists only security updates. |
per_page |
integer | Rows per page, 1 to 100; 25 by default. limit is the same. |
page |
integer | The page to read, from 1; 1 by default. |
Returns
Section titled “Returns”data, the packages; current_page, per_page, last_page and total, the number of stored packages that match; and meta: the scope read, updates_total, the scope’s own count of pending updates, truncated, true when the server had more than 500 and only the first 500 are kept, and release, on the latest scope the Amazon Linux 2023 release the match was made against (the summary’s at_latest.release), null on host and when no match is stored.
A package
Section titled “A package”| Field | Type | Meaning |
|---|---|---|
name |
string | The package’s name. |
arch |
string | Its architecture, such as x86_64 or noarch. |
current_version |
string | The version on the host now. |
available_version |
string | The version the update installs. |
repository |
string or null |
The repository that offers it. On the host scope, the one the host’s package manager offers it from; on the latest scope, always amazonlinux, because the latest-release list is read from Amazon’s AL2023 core repository. |
security |
boolean | Whether a security advisory names this update. |
severity |
string or null |
critical, important, moderate, low or unknown: the worst severity of the advisories that name it; unknown for a security update whose advisory gives none; null when it is not a security update. The set is open. |
vendor_severity |
string or null |
That severity in the distribution’s own words. |
advisory |
string or null |
The id of the worst advisory. |
advisories |
array | latest scope only: every advisory that names the update, worst first, at most 16. Never null: it is empty on the host scope, and empty when none is known yet, so a latest row with advisory set and advisories empty was matched before the advisories were kept and has them after the next hourly match. |
advisories[].id |
string | The advisory’s id, such as ALAS2023-2025-1180. |
advisories[].severity |
string | Its severity. |
advisories[].cve_ids |
array of strings | The CVE ids it fixes, at most 32. |
advisories[].cve_ids_truncated |
boolean | true when it names more than 32. |
advisories_truncated |
boolean or null |
true when more than 16 advisories name the update; null on the host scope. |
only_at_latest |
boolean or null |
latest scope only: true when the host’s own list does not have this update, so only moving to the latest release brings it. null on the host scope, and when the host’s list was cut at 500, since a package past the cut would read true. |
curl -G https://rest.watchtower15.com/v1/servers/$SERVER_UUID/os-updates/packages \ -H "Authorization: Bearer $WT15_API_KEY" \ -d scope=latest \ -d security_only=true \ -d per_page=2{ "data": [ { "name": "openssl-libs", "arch": "x86_64", "current_version": "1:3.0.8-1.amzn2023.0.12", "available_version": "1:3.2.2-1.amzn2023.0.2", "repository": "amazonlinux", "security": true, "severity": "important", "vendor_severity": "important", "advisory": "ALAS2023-2025-1180", "advisories": [ { "id": "ALAS2023-2025-1180", "severity": "important", "cve_ids": ["CVE-2025-9230", "CVE-2025-9231"], "cve_ids_truncated": false }, { "id": "ALAS2023-2024-0705", "severity": "moderate", "cve_ids": ["CVE-2024-5535"], "cve_ids_truncated": false } ], "advisories_truncated": false, "only_at_latest": true } ], "current_page": 1, "per_page": 2, "last_page": 9, "total": 18, "meta": { "scope": "latest", "updates_total": 214, "truncated": false, "release": "2023.12.20261102" }}Recheck after you patch
Section titled “Recheck after you patch”POST /v1/servers/{server_uuid}/os-updates/recheck
The agent reads the package manager’s state on a schedule, so a server you have just patched can show the old counts for a while. A recheck asks the agent to read it again at once and send it. The call takes no body and answers 202 with the recheck; the agent answers it within a few minutes.
Follow it
Section titled “Follow it”Read the summary until recheck.last.status is no longer pending or dispatched:
completed: the agent’s report arrived. Then readstatus: when it isok,hostandreported_atare current. When it isfailed, the agent could not read the package manager (reasonsays why, for examplerpmdb_busywhile a patch is still finishing), and the counts are those of the last report that could: ask again oncerecheck.available_athas passed. On Amazon Linux 2023,at_latestfollows within about 5 minutes when the installed packages changed: watchat_latest.matched_at.expired: no report arrived within 15 minutes. Nothing more happens; ask again.
When a recheck is refused
Section titled “When a recheck is refused”The summary’s recheck.state says, before you call, whether a recheck would be accepted: available, or the reason it would not be. A refused call answers 422 invalid_request on os_updates_recheck, with the sentence below, and starts nothing. The reasons are checked in this order:
recheck.state |
When | The sentence |
|---|---|---|
unsupported |
The server runs Windows. | Windows servers report their updates from Windows Update: a recheck is not available for them. |
container |
The agent runs in a container, which has no package manager to read. | This agent runs in a container: pending updates are not read for container installs. |
agent_update |
The server’s agent is older than the recheck. | The agent on this server needs updating before it can recheck its updates. |
not_active |
The server or its agent is switched off or not approved. | The server or its agent is not active. |
pending |
A recheck is still waiting for the agent. | A recheck is already waiting for the agent. |
too_soon |
The last recheck was asked less than 10 minutes ago; available_at says when the next one can be. |
One recheck every 10 minutes: try again later. |
A call can carry an Idempotency-Key, so a script that timed out can send it again without asking twice: see idempotent requests.
curl -X POST https://rest.watchtower15.com/v1/servers/$SERVER_UUID/os-updates/recheck \ -H "Authorization: Bearer $WT15_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"{ "data": { "state": "pending", "available_at": null, "last": { "uuid": "8b1d6f3e-2c4a-4e7b-9a50-3f6d1c2e8a47", "status": "pending", "issued_at": 1794563700000, "expires_at": 1794564600000, "completed_at": null } }}{ "type": "…/api/errors/invalid_request/", "status": 422, "code": "invalid_request", "detail": "The request is invalid", "errors": { "os_updates_recheck": ["One recheck every 10 minutes: try again later."] } }Example: check a server after patching
Section titled “Example: check a server after patching”Ask for a recheck, wait for it, then read the counts. A script that patches many servers can do this for each one; each server takes one recheck every 10 minutes.
api=https://rest.watchtower15.com/v1/servers/$SERVER_UUID/os-updatesauth="Authorization: Bearer $WT15_API_KEY"
curl -sS -X POST "$api/recheck" -H "$auth" -H "Idempotency-Key: $(uuidgen)"
# every 30 s, up to 15 minutesuntil s=$(curl -sS "$api" -H "$auth" | jq -r .data.recheck.last.status); [ "$s" = completed ] || [ "$s" = expired ]; do sleep 30; done
# the counts are current only when status is "ok"curl -sS "$api" -H "$auth" | jq '.data | {status, reason, reported_at, host: .host.security_by_level}'