---
title: "List Branches by Agent"
method: GET
path: "/agents/{namespace_slug}/{agent_name}/branches"
tags: ["Branches"]
---

# List Branches by Agent

`GET /agents/{namespace_slug}/{agent_name}/branches`

List all branches for an agent.

    Each branch represents a git branch (e.g., main, staging, feature-x).
    By default, retired branches are excluded.

## Path parameters

- `namespace_slug` string, required
- `agent_name` string, required

## Query parameters

- `include_retired` boolean — Include retired branches in results

## Response `200`

Successful Response

- BranchListResponse — Response for listing branches.
  - `branches` BranchResponse[], required — List of branches
    - `agent_id` string, required — Parent agent ID
    - `created_at` string, date-time, nullable — Creation timestamp
    - `current_version` VersionSummary — Abbreviated version info for embedding in branch responses.
      - `deployed_at` string, date-time, required — When this version was deployed
      - `git_hash` string, required — Git commit hash
      - `git_message` string — Git commit message
      - `id` string, required — Version ID
      - `source_filesystem_id` string, nullable — Filesystem snapshot that can reopen this version in Agent Builder
      - `status` 'DEPLOYING' | 'ACTIVE' | 'FAILED' | 'UNHEALTHY' | 'DRAINING' | 'RETIRED' | 'ROLLED_BACK', required — Status of a version in its lifecycle.
    - `git_branch` string, required — Original git branch name
    - `git_branch_normalized` string, required — DNS-safe branch name
    - `id` string, required — Branch ID
    - `replicas` integer, required — Desired replica count
    - `retired_at` string, date-time, nullable — When branch was retired
    - `retired_reason` string, nullable — Reason for retirement
    - `updated_at` string, date-time, nullable — Last update timestamp
  - `total` integer, required — Total count

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/versions/f24a474dc415/schema)
