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

# Update Agent Branch

> Update agent branch properties such as archiving status and protection level



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/convai/agents/{agent_id}/branches/{branch_id}
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/agents/{agent_id}/branches/{branch_id}:
    patch:
      tags:
        - Agents Platform
      summary: Update Agent Branch
      description: >-
        Update agent branch properties such as archiving status and protection
        level
      operationId: update_branch_route
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            description: The id of an agent. This is returned on agent creation.
            examples:
              - agent_3701k3ttaq12ewp8b7qv5rfyszkz
            embed: true
            title: Agent Id
          description: The id of an agent. This is returned on agent creation.
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            description: Unique identifier for the branch.
            examples:
              - agtbrch_0901k4aafjxxfxt93gd841r7tv5t
            title: Branch Id
          description: Unique identifier for the branch.
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Body_Update_agent_branch_v1_convai_agents__agent_id__branches__branch_id__patch
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentBranchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Body_Update_agent_branch_v1_convai_agents__agent_id__branches__branch_id__patch:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 140
              minLength: 1
            - type: 'null'
          title: Name
          description: New name for the branch. Must be unique within the agent.
        is_archived:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Archived
          description: Whether the branch should be archived
        protection_status:
          anyOf:
            - $ref: '#/components/schemas/BranchProtectionStatus'
            - type: 'null'
          description: The protection level for the branch
      type: object
      title: >-
        Body_Update_agent_branch_v1_convai_agents__agent_id__branches__branch_id__patch
    AgentBranchResponse:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        agent_id:
          type: string
          title: Agent Id
        description:
          type: string
          title: Description
        created_at:
          type: integer
          title: Created At
        last_committed_at:
          type: integer
          title: Last Committed At
        is_archived:
          type: boolean
          title: Is Archived
        protection_status:
          $ref: '#/components/schemas/BranchProtectionStatus'
          default: writer_perms_required
        access_info:
          anyOf:
            - $ref: '#/components/schemas/ResourceAccessInfo'
            - type: 'null'
          description: Access information for the branch
        current_live_percentage:
          type: number
          title: Current Live Percentage
          description: Percentage of traffic live on the branch
          default: 0
        parent_branch:
          anyOf:
            - $ref: '#/components/schemas/AgentBranchBasicInfo'
            - type: 'null'
          description: Parent branch of the branch
        most_recent_versions:
          items:
            $ref: '#/components/schemas/AgentVersionMetadata'
          type: array
          title: Most Recent Versions
          description: Most recent versions on the branch
      type: object
      required:
        - id
        - name
        - agent_id
        - description
        - created_at
        - last_committed_at
        - is_archived
      title: AgentBranchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BranchProtectionStatus:
      type: string
      enum:
        - writer_perms_required
        - admin_perms_required
      title: BranchProtectionStatus
    ResourceAccessInfo:
      properties:
        is_creator:
          type: boolean
          title: Is Creator
          description: Whether the user making the request is the creator of the agent
        creator_name:
          type: string
          title: Creator Name
          description: Name of the agent's creator
        creator_email:
          type: string
          title: Creator Email
          description: Email of the agent's creator
        role:
          type: string
          enum:
            - admin
            - editor
            - commenter
            - viewer
          title: Role
          description: The role of the user making the request
        anonymous_access_level_override:
          anyOf:
            - type: string
              enum:
                - admin
                - editor
                - commenter
                - viewer
            - type: 'null'
          title: Anonymous Access Level Override
          description: >-
            The access level for anonymous users. If None, the resource is not
            shared publicly.
        access_source:
          anyOf:
            - type: string
              enum:
                - creator
                - explicit
                - workspace_admin
                - workspace_default
            - type: 'null'
          title: Access Source
          description: >-
            Why the requesting user has access to this resource. 'creator' =
            caller is the owner. 'explicit' = caller (or one of their workspace
            groups) is listed in role_to_group_ids beyond the workspace-wide
            everyone group. 'workspace_default' = the workspace-wide everyone
            group is listed in role_to_group_ids (every non-anon workspace
            member, including admins, sees this resource). 'workspace_admin' =
            caller is a workspace admin and the admin seat is the *only* path to
            access; reserved for docs nobody else can see. Lets the UI disclose
            why an admin-bypass viewer sees a doc that wasn't explicitly shared
            with them.
      type: object
      required:
        - is_creator
        - creator_name
        - creator_email
        - role
      title: ResourceAccessInfo
      example:
        access_source: creator
        creator_email: john.doe@example.com
        creator_name: John Doe
        is_creator: true
        role: admin
    AgentBranchBasicInfo:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: AgentBranchBasicInfo
    AgentVersionMetadata:
      properties:
        id:
          type: string
          title: Id
        agent_id:
          type: string
          title: Agent Id
        branch_id:
          type: string
          title: Branch Id
        version_description:
          type: string
          title: Version Description
        seq_no_in_branch:
          type: integer
          title: Seq No In Branch
        time_committed_secs:
          type: integer
          title: Time Committed Secs
        parents:
          $ref: '#/components/schemas/AgentVersionParents'
        access_info:
          anyOf:
            - $ref: '#/components/schemas/ResourceAccessInfo'
            - type: 'null'
      type: object
      required:
        - id
        - agent_id
        - branch_id
        - version_description
        - seq_no_in_branch
        - time_committed_secs
        - parents
      title: AgentVersionMetadata
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentVersionParents:
      properties:
        in_branch_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: In Branch Parent Id
        out_of_branch_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Out Of Branch Parent Id
        merged_into_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged Into Branch Id
        merged_from_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged From Branch Id
        merged_from_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged From Version Id
        rebased_from_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Rebased From Version Id
      type: object
      title: AgentVersionParents

````