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

# Redeploy Branch

> Redeploy a branch with the current secrets from the EnvVar table.

    Creates a new Version with:
    - Same image as current version
    - Fresh secrets_snapshot from current EnvVars

    Use this after updating secrets to apply them to a running branch.



## OpenAPI

````yaml openapi.json POST /branches/{branch_id}/redeploy
openapi: 3.1.0
info:
  title: Sb0 API
  version: 0.1.0
servers: []
security: []
paths:
  /branches/{branch_id}/redeploy:
    post:
      tags:
        - Branches
      summary: Redeploy with Updated Secrets
      description: |-
        Redeploy a branch with the current secrets from the EnvVar table.

            Creates a new Version with:
            - Same image as current version
            - Fresh secrets_snapshot from current EnvVars

            Use this after updating secrets to apply them to a running branch.
      operationId: branches_redeploy
      parameters:
        - in: path
          name: branch_id
          required: true
          schema:
            title: Branch Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedeployResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    RedeployResponse:
      description: Response from a redeploy operation.
      properties:
        branch_id:
          description: Branch ID
          title: Branch Id
          type: string
        message:
          description: Human-readable status message
          title: Message
          type: string
        version_id:
          description: New version ID created for redeploy
          title: Version Id
          type: string
        version_status:
          $ref: '#/components/schemas/VersionStatus'
          description: Version status after redeploy
      required:
        - branch_id
        - version_id
        - version_status
        - message
      title: RedeployResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    VersionStatus:
      description: Status of a version in its lifecycle.
      enum:
        - DEPLOYING
        - ACTIVE
        - FAILED
        - UNHEALTHY
        - DRAINING
        - RETIRED
        - ROLLED_BACK
      title: VersionStatus
      type: string
    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

````