Agent upgrades

Endpoints: /api/servers/servers/{server_id}/agent-upgrades/, /api/servers/agent-upgrades/

Read the record of every agent upgrade: automatic ones started by the workspace’s agent update policy, and manual ones started from the Agent card or with the upgrade_agent action. This is the same record the console shows as upgrade history.

Both endpoints are read-only. They return only servers the caller can see, the same as the server list, and an API token needs the server:read scope. Records begin when upgrade history was introduced; earlier upgrades aren’t included.

List a server’s upgrades

Retrieve one server’s agent upgrades, newest first.

Request

GET /api/servers/servers/{server_id}/agent-upgrades/

Path parameters

ParameterTypeRequiredDescription
server_idUUIDYesServer ID

Query parameters

ParameterTypeDescription
pageintegerPage number
page_sizeintegerResults per page (default: 15, max: 100)

A server the caller can’t see returns 404.

Response

{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "3b1f6f0e-8a52-4c1d-9d6e-5f2a7c9e1b40",
      "server": "7e3984de-49ab-4cc6-bcdf-21fbd35858b8",
      "server_name": "web-server-01",
      "from_version": "1.4.2",
      "target_version": "1.5.0",
      "to_version": "1.5.0",
      "outcome": "success",
      "error_class": null,
      "detail": null,
      "requested_at": "2026-09-21T02:14:05Z",
      "acknowledged_at": "2026-09-21T02:14:07Z",
      "reported_at": "2026-09-21T02:19:40Z",
      "origin": "scheduled",
      "policy_mode": "latest",
      "initiator": {
        "kind": "policy",
        "id": null,
        "label": "Alpacon automatic policy (latest)"
      }
    },
    {
      "id": "a0c4d2b7-19e3-4f56-8b0a-2d7e6c1f9a33",
      "server": "7e3984de-49ab-4cc6-bcdf-21fbd35858b8",
      "server_name": "web-server-01",
      "from_version": "1.4.1",
      "target_version": null,
      "to_version": "1.4.1",
      "outcome": "failed",
      "error_class": "download_failed",
      "detail": null,
      "requested_at": "2026-09-14T09:30:12Z",
      "acknowledged_at": "2026-09-14T09:30:13Z",
      "reported_at": "2026-09-14T09:31:02Z",
      "origin": "manual",
      "policy_mode": null,
      "initiator": {
        "kind": "user",
        "id": "a540bf0f-8b37-4f03-8546-dd71c6b03329",
        "label": "admin"
      }
    }
  ]
}

See Fields for what each field means.

Example

curl -X GET "https://your-workspace.us1.alpacon.io/api/servers/servers/7e3984de-49ab-4cc6-bcdf-21fbd35858b8/agent-upgrades/" \
  -H "Authorization: token=\"alpat-xxxxxxxxxxxxxxxxxx\""

Fields

FieldTypeDescription
idUUIDUpgrade record ID
serverUUIDServer ID
server_namestringServer name
from_versionstring or nullAgent version before the upgrade
target_versionstring or nullThe release the agent was asked to install. null when the agent was sent a plain upgrade to the newest version rather than a specific release
to_versionstring or nullThe version the agent ended on; null until it reports back
outcomestringpending (in progress), success, rolled_back (the new version didn’t come up cleanly and the agent went back to the previous one), failed, timed_out (the agent didn’t confirm in time), or refused (withdrawn before it reached the agent)
error_classstring or nullWhy the upgrade didn’t land; null when there’s no error
detailstring or nullA short explanation from Alpacon, for example why an upgrade was refused
requested_atdate-timeWhen the upgrade was requested
acknowledged_atdate-time or nullWhen the agent received the upgrade
reported_atdate-time or nullWhen the agent reported the result
originstringscheduled for an automatic upgrade, manual for one started by a member or a token
policy_modestring or nullFor an automatic upgrade, the update policy it ran under (latest or n_minus_1); null for a manual one
initiatorobjectWho started the upgrade (see below)

initiator is a snapshot taken when the upgrade was requested, so it keeps its name after the member or token is gone:

FieldTypeDescription
kindstringpolicy for an automatic upgrade, user or token for a manual one
idstring or nullThe user or token ID; null for policy
labelstringWho started it, by name: the member’s username, the token’s name, or Alpacon automatic policy (latest) ((N-1) under n_minus_1). A request made in Korean gets Alpacon 자동 정책 (latest)

error_class values, with the label the console shows:

ValueConsole labelMeaning
signature_invalidSignature invalidThe release’s signature didn’t verify, so the agent didn’t install it
digest_mismatchDigest mismatchThe downloaded package didn’t match its published checksum
download_failedDownload failedThe agent couldn’t download the release
swap_failedSwap failedThe agent couldn’t replace its binary with the new one
health_check_failedHealth check failedThe new version didn’t pass its health check
package_managerPackage manager errorThe system package manager reported an error
window_closedMaintenance window closedThe maintenance window closed before the upgrade reached the agent
keys_unavailableAlpacon configuration issue; no action neededA problem on Alpacon’s side; nothing to change on your server, and no alert is raised
unknownUnknown errorA failure without a known reason

A failed or rolled-back upgrade also raises a warning upgrade failure alert on the server, except for keys_unavailable. Each upgrade is recorded in the activity log as well, when it’s sent and when it ends.

Error responses

StatusError codeDescription
401—Invalid or missing authentication. Uncoded {"detail": "..."} response
403api_token_scope_missingThe API token doesn’t hold the server:read scope
404—Server not found, or not visible to the caller. Uncoded {"detail": "..."} response
Last updated: