---
title: "Get Branch by Agent and Git Branch"
method: GET
path: "/agents/{namespace_slug}/{agent_name}/branch"
tags: ["Branches"]
---

# Get Branch by Agent and Git Branch

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

Get a specific branch by agent name and git branch.

    The git branch name will be normalized (lowercased, slashes converted to hyphens).
    For example, "feature/new-tool" becomes "feature-new-tool".

## Path parameters

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

## Query parameters

- `branch` string, required — Target branch (e.g., 'main', 'feature/login')

## Response `200`

Successful Response

- BranchResponse — Full branch details including current version.
  - `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

## 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)
