Workspace preferences

Endpoint: /api/workspaces/preferences/

Read and update the workspace-wide preferences shown under Workspace settings > General, including the agent update policy. There is one preferences object per workspace.

On Alpacon Cloud, this endpoint takes a signed-in session: the web console, or an OAuth client such as the Alpacon MCP server. An API token is refused with 401. On a self-hosted deployment, an API token with the preferences scope works.

Get preferences

Any member of the workspace can read the preferences.

Request

GET /api/workspaces/preferences/-/

Response

{
  "front_url": "https://your-workspace.us1.alpacon.io",
  "country": "US",
  "language": "en",
  "timezone": "America/New_York",
  "invite_ttl": 172800,
  "enabled_extensions": ["metrics"],
  "websh_session_timeout": 86400,
  "agent_rollout_policy": {
    "mode": "latest",
    "window": {
      "days": [0, 1, 2, 3, 4],
      "start_hour": 2,
      "length_hours": 4,
      "timezone": "America/New_York"
    }
  },
  "auto_agent_upgrade": true,
  "package_proxy": null,
  "activity_report_cadence": ["weekly"],
  "billing_email": "billing@example.com"
}
FieldTypeDescription
front_urlstringThe workspace’s console URL
country, languagestringWorkspace country and default display language
timezonestringWorkspace default timezone
invite_ttlintegerHow long invitation links stay valid, in seconds
enabled_extensionsarrayEnabled extensions
websh_session_timeoutintegerIdle Websh session timeout, in seconds
agent_rollout_policyobjectThe agent rollout policy
auto_agent_upgradebooleanDeprecated. See auto_agent_upgrade
package_proxystring or nullProxy server URL for package installation
activity_report_cadencearrayReview periods the workspace declares, such as weekly
billing_emailstringBilling contact email. Alpacon Cloud only

Agent rollout policy

agent_rollout_policy decides whether Alpacon upgrades agents in this workspace automatically, and in which hours:

{
  "mode": "latest",
  "window": {
    "days": [0, 1, 2, 3, 4, 5, 6],
    "start_hour": 0,
    "length_hours": 24,
    "timezone": "UTC"
  }
}
FieldTypeDescription
modestringlatest upgrades agents to new releases inside the window. n_minus_1 stays one release behind the newest; until verified upgrades are enabled, choosing it is refused with preferences_agent_rollout_mode_unavailable. manual runs no automatic upgrade: each server is upgraded with the upgrade_agent action
window.daysarray of integersDays the window opens, 0 (Monday) to 6 (Sunday). At least one, no repeats
window.start_hourintegerHour the window opens, 0 to 23, in window.timezone
window.length_hoursintegerHow long the window stays open, 1 to 24. It can run past midnight, and it’s elapsed time, so a daylight-saving change inside the window doesn’t stretch or shorten it
window.timezonestringAn IANA timezone name, such as Asia/Seoul or America/New_York

The example above is the default: latest, with a window open every day for 24 hours, so upgrades can start at any time.

A write may name only part of the object—just mode, or just one window field—and whatever it leaves out keeps its current value. A read always returns the whole object.

Alpacon plans each week’s automatic upgrades on Monday, inside the window. A change to the window takes effect from the next Monday’s plan; upgrades already planned for hours that now fall outside it wait for the next open hour.

Every server’s agent_upgrade_policy field in the Servers API carries the current mode.

auto_agent_upgrade (deprecated)

auto_agent_upgrade is the boolean that agent_rollout_policy replaced. It stays readable and writable for one more release, then it’s removed. Use agent_rollout_policy instead.

  • Read: true unless mode is manual.
  • Write true: sets mode to latest, unless the mode is already automatic (latest or n_minus_1), in which case nothing changes.
  • Write false: sets mode to manual.
  • Neither write changes the window.
  • When a request names both fields, agent_rollout_policy wins and auto_agent_upgrade is ignored.
  • It accepts a JSON boolean only; any other value is refused with invalid_input.

These rules describe the REST API. The Alpacon MCP server converts its own deprecated auto_agent_upgrade input before calling this endpoint, with slightly different rules; see the MCP reference.

Error responses

StatusError codeDescription
400preferences_agent_rollout_policy_invalidagent_rollout_policy or its window isn’t an object, or names a field that doesn’t exist
400preferences_agent_rollout_mode_invalidmode isn’t latest, n_minus_1, or manual
400preferences_agent_rollout_mode_unavailablen_minus_1 can’t be chosen until verified upgrades are enabled; choose latest or manual
400preferences_agent_rollout_window_days_invaliddays is empty, repeats a day, or has a value outside 0–6
400preferences_agent_rollout_window_start_hour_invalidstart_hour isn’t an integer from 0 to 23
400preferences_agent_rollout_window_length_invalidlength_hours isn’t an integer from 1 to 24
400preferences_agent_rollout_window_timezone_invalidtimezone isn’t an IANA timezone name
401—Invalid or missing authentication, including an API token on Alpacon Cloud. Uncoded {"detail": "..."} response
403—Only Staff and Superuser members can update preferences. Uncoded {"detail": "..."} response
Last updated: