---
title: "Make a branch live"
method: POST
path: "/agent/{id}/branches/{branchId}/live"
tags: ["Agent Versioning - Branches"]
---

# Make a branch live

`POST /agent/{id}/branches/{branchId}/live`

Make this branch the live branch. Its `headRevisionId` becomes the config that serves production traffic. The previously-live branch becomes not-live automatically. The branch must be non-archived, must have at least one `committed` (security-passed) revision, and its head revision must have passed the security scan.

## Path parameters

- `id` string, required
- `branchId` string, required

## Response `200`

Branch is now live.

- object
  - `status` boolean
  - `data` BranchSummary — Branch document plus derived fields used by list and detail views.
    - `branch` Branch — An `AgentBranch` document. An editable copy of an agent with its own draft slot and revision chain.
      - `_id` string — Branch ID (24-character ObjectId).
      - `agent` string — ID of the agent this branch belongs to.
      - `name` string — Branch name (unique per agent among active branches). `main` is reserved for the default branch.
      - `isDefault` boolean — True for the seeded `main` branch. The default branch cannot be renamed or archived.
      - `sourceBranchId` string, nullable — Head of the source branch at fork time. `null` for `main`.
      - `sourceRevisionId` string, nullable — Revision the branch was forked from. `null` for `main`.
      - `headRevisionId` string, nullable — ID of the branch's latest committed revision. `null` until the first commit.
      - `openDraftId` string, nullable — ID of the branch's single open draft. `null` when no draft is open.
      - `status` 'active' | 'archived' — Archived branches are hidden from list views and cannot receive draft edits or be made live.
      - `createdBy` string
      - `updatedBy` string
      - `createdAt` string, date-time
      - `updatedAt` string, date-time
    - `isLive` boolean — True when the agent's live config points at this branch.
    - `hasOpenDraft` boolean
    - `revisionsCount` integer
    - `headRevisionNumber` integer, nullable

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `403` — Forbidden. Branch is archived, security scan has not passed on the head revision, or the caller lacks write access.
- `404` — Resource not found. The referenced ID does not exist or does not belong to the caller's organization.
- `409` — Conflict. The request cannot be completed because of the current state of the resource (name already exists, another publish or restore is in progress, the source draft failed its security scan, or a similar in-flight collision).
- `423` — Locked. A configuration freeze is active on this agent, or the resource is temporarily locked for another write. Retry after the freeze window ends.
- `500` — Internal server error

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/9fd13f607823/schema)
