2kw.ai

Versions, latest and Live

Every save of an agent creates a new version. latest is the newest one. Live is the one your users get. By default Live follows latest; an admin can pin it to one version and keep users there while you keep saving.

In one line

Live is what users get; latest is every save.

latest and Live

WordMeansMoves when
latestThe newest versionEvery save: a new version, a restore, an agents apply that changes the agent, skills saved from chat
LiveThe version users getWith every save while the agent follows latest. Otherwise only when an admin goes live, rolls back or lets it follow latest again

A new agent starts with version 1 as both latest and Live, so it can run at once.

The agent carries both pointers: latestVersionId and latestVersionNumber, liveVersionId and liveVersionNumber, plus liveMode. GET /v1/agents/{agentId}/versions/latest and GET /v1/agents/{agentId}/versions/live return the version itself. While Live versions are not available in your workspace yet, liveMode is null and every caller gets latest.

Live modes

ModeliveModeWhat users get
Follows latestfollows_latestEvery save, at once. The default for every agent
PinnedpinnedThe version an admin put live, until an admin changes it. A save moves only latest

Only Go live, Roll back and Follow latest change the mode. A save, a restore or an update of the agent never does; liveMode in a create or update body is ignored.

Go Live, Roll Back, Follow Latest

Only an ADMIN or OWNER can change what users get: a signed-in admin, or an API key whose role is ADMIN or OWNER. A member can save versions and try them, but cannot move Live.

ActionWhat it does
Go livePuts a version live and pins the agent there
Roll backGo live with an older version. The agent is pinned, so the next save does not undo it
Follow latestMoves Live to latest and lets it follow every save again

All three are one call, PUT /v1/agents/{agentId}/labels/live:

# Go live with a version (an older version is a roll back)
curl -X PUT https://api.2kw.ai/v1/agents/agt_123/labels/live \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_your_api_key" \
  -d '{
    "agentVersionId": "ver_456",
    "expectedVersionId": "ver_455",
    "expectedLiveMode": "follows_latest",
    "note": "Fixes the VAT rule"
  }'

# Follow latest again
curl -X PUT https://api.2kw.ai/v1/agents/agt_123/labels/live \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk_your_api_key" \
  -d '{ "liveMode": "follows_latest", "expectedVersionId": "ver_456", "expectedLiveMode": "pinned" }'
  • agentVersionId: the version to put live. Leave it out only for Follow latest.
  • liveMode: pinned (the default when you send a version) or follows_latest (send no version). pinned without a version, or follows_latest with one, answers 400.
  • expectedVersionId and expectedLiveMode: the agent's liveVersionId and liveMode as you read them. If Live moved since, because another admin acted or a save moved a following agent, the call answers 409 LIVE_CHANGED instead of overwriting it. Read the agent again and decide again.
  • note: why, up to 1,000 characters, shown in the Live history.

Before a version goes live it is checked again: it must be active, and its models, tools, connectors and skills must still be valid. A version that can no longer run is refused here, not at a user's first message.

A call that changes nothing answers 200 and adds no history entry: Go live with the version a pinned agent already has, or Follow latest on an agent that already follows. Pinning a following agent at its current version is a change, because it sets the mode. The response is the live label; read liveMode from GET /v1/agents/{agentId}. Every field: API reference.

Restore is not Roll back. Restore (PUT /v1/agents/{agentId}/versions/{versionId}/activate) copies an older version to a new latest. On a following agent that reaches users at once; on a pinned agent Live stays where it is. To change what users of a pinned agent get, roll back.

The live and latest labels cannot be created, renamed or deleted by hand (400 RESERVED_LABEL_NAME). The Live version of a pinned agent cannot be deactivated (409 VERSION_IS_LIVE): put another version live, or follow latest, first.

From the CLI, which sends the expected values for you:

2kw agents go-live invoice-checker --version 7 --note "Fixes the VAT rule"
2kw agents go-live invoice-checker --version 6     # an older version: roll back
2kw agents follow-latest invoice-checker
2kw agents live-history invoice-checker
2kw agents versions live --agent <agentId>

The MCP server has the same as 2kw_go_live_agent, 2kw_follow_latest_agent and 2kw_agent_live_history. Go live and Follow latest need a key whose role is ADMIN or OWNER there too. An agent's own tools can never reach them.

In the console, an admin finds Go live in the agent's header and Roll back to this on an older row and Go live with this on a newer row of the agent's Versions page; Follow latest is in the agent's menu while it is pinned.

References

Wherever you name a version of an agent, you use one of four kinds:

ReferenceExampleGets
Liveagent/invoice-checker@liveWhat users get
latestagent/invoice-checker@latestEvery save
A labelagent/invoice-checker@prodThe version a member pointed the label at. It moves only when a member moves it
A fixed versiona version id, ver_…One version. It never changes

Labels are yours to create and move; see Agents. A fixed version is named by its id, for example in an experiment variant ("version": { "versionId": "…" }) or in GET /v1/agents/{agentId}/versions/{versionId}. Every response's model names the version that ran (agent/invoice-checker@4), whatever you addressed.

Prompts and schemas have versions, labels and latest, and no Live: see Prompts and Schemas.

Which Version a Run Gets

A reference with @live, @latest or a label runs that. A bare agent/invoice-checker runs what fits the caller:

Calleragent/xagent/x@live@latest or another label
Signed-in member: chat app, mobile app, console chat, the CLI signed in with your accountLiveLiveMEMBER and above
Embeddable surface visitorLiveLive404
Member or API key with role USERLiveLive404
API key with role MEMBER, ADMIN or OWNER: the API, and the CLI, MCP server and n8n with such a keylatestLiveThat label
  • An API key keeps latest for a bare reference, so existing scripts run what they ran before. Send @live when you mean what users get.
  • A caller that may not name @latest or another label gets the same 404 as an unknown agent.
  • Scheduled tasks run Live.
  • A sub-agent follows its parent: under a parent on latest it runs latest, under any other parent it runs Live.
  • An experiment variant runs the label or version you pick, and latest when it names none. live is a label you can pick.

Reads that describe what users get follow Live too. The agent catalog describes the Live version. GET /v1/agents/{agentId}/skills and GET /v1/agents/{agentId}/knowledge take label, default live; a MEMBER or above may pass latest or another label.

Trying latest in chat. When latest differs from Live, a member (MEMBER and above) starting a new chat with the agent can switch it from Live to Latest. That chat then runs latest; reopened later, it continues on Live. Each answer shows the version that answered.

Open conversations. A turn runs the version it started on, and its model names it. The next message resolves the agent again, so an open chat gets the new Live with its next message.

Live History

GET /v1/agents/{agentId}/labels/live/history lists who put which version live, newest first and paged. Any MEMBER or above can read it.

FieldMeaning
kindgo_live, rollback or follow_latest. Ignore a value you do not know
fromVersionNumber, toVersionNumberWhere Live was, and where it went
liveModeThe mode after the change
actorKind, actorIdWho did it: user or api_key, and its id. Ignore a value you do not know
noteWhy, as sent
atWhen

Saves of a following agent are not listed: the history holds the decisions, not every save. The console shows it on the agent's Versions page, and the CLI as 2kw agents live-history <agent>.

Errors

The label and version calls answer with a problem document; branch on errorCode.

Status and errorCodeWhenWhat to do
400 RESERVED_LABEL_NAMECreating, renaming or deleting live or latest by handUse another label name
400pinned without a version, or follows_latest with oneSend a version to go live, none to follow latest
403 GO_LIVE_REQUIRES_ADMINGo live, Roll back or Follow latest by a caller below ADMINAsk an admin, or use a key whose role is ADMIN or OWNER
404Unknown agent or versionCheck the ids
409 LIVE_CHANGEDLive, or its mode, changed since you read itRead the agent again and decide again
409 VERSION_INACTIVEThe version is deactivatedPick an active version, or restore it and put the copy live
409 VERSION_IS_LIVEDeactivating the Live version of a pinned agentPut another version live, or follow latest, first
409 LIVE_NOT_ACTIVELive versions are not available in this workspace yetNothing to do: every caller gets latest until then

On POST /v1/responses, a caller that may not name @latest or another label gets the unknown-agent 404 described on Errors.

Was this page helpful?

A request failed? See Errors for every status and code.