> ## Documentation Index
> Fetch the complete documentation index at: https://docs.terminaluse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Branch

> Get branch details by ID.

    Used by CLI to poll for branch status after calling POST /agents/deploy.
    Poll until status is READY (success) or FAILED/TIMEOUT (failure).



## OpenAPI

````yaml openapi.json GET /branches/{branch_id}
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /branches/{branch_id}:
    get:
      tags:
        - Branches
      summary: Get Branch
      description: |-
        Get branch details by ID.

            Used by CLI to poll for branch status after calling POST /agents/deploy.
            Poll until status is READY (success) or FAILED/TIMEOUT (failure).
      operationId: branches_retrieve
      parameters:
        - in: path
          name: branch_id
          required: true
          schema:
            title: Branch Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    BranchResponse:
      description: Full branch details including current version.
      properties:
        agent_id:
          description: Parent agent ID
          title: Agent Id
          type: string
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Creation timestamp
          title: Created At
        current_version:
          anyOf:
            - $ref: '#/components/schemas/VersionSummary'
            - type: 'null'
          description: Currently active version (includes status)
        git_branch:
          description: Original git branch name
          title: Git Branch
          type: string
        git_branch_normalized:
          description: DNS-safe branch name
          title: Git Branch Normalized
          type: string
        id:
          description: Branch ID
          title: Id
          type: string
        replicas:
          description: Desired replica count
          title: Replicas
          type: integer
        retired_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When branch was retired
          title: Retired At
        retired_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Reason for retirement
          title: Retired Reason
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: Last update timestamp
          title: Updated At
      required:
        - id
        - agent_id
        - git_branch
        - git_branch_normalized
        - replicas
      title: BranchResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    VersionSummary:
      description: Abbreviated version info for embedding in branch responses.
      properties:
        deployed_at:
          description: When this version was deployed
          format: date-time
          title: Deployed At
          type: string
        git_hash:
          description: Git commit hash
          title: Git Hash
          type: string
        git_message:
          default: ''
          description: Git commit message
          title: Git Message
          type: string
        id:
          description: Version ID
          title: Id
          type: string
        source_filesystem_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Filesystem snapshot that can reopen this version in Agent Builder
          title: Source Filesystem Id
        status:
          $ref: '#/components/schemas/VersionStatus'
          description: Version lifecycle status
      required:
        - id
        - git_hash
        - status
        - deployed_at
      title: VersionSummary
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    VersionStatus:
      description: Status of a version in its lifecycle.
      enum:
        - DEPLOYING
        - ACTIVE
        - FAILED
        - UNHEALTHY
        - DRAINING
        - RETIRED
        - ROLLED_BACK
      title: VersionStatus
      type: string

````