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

# List Agent Branches

> Returns a list of branches an agent has



## OpenAPI

````yaml /api-reference/openapi.json get /v1/convai/agents/{agent_id}/branches
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:
    get:
      tags:
        - Agents Platform
      summary: List Agent Branches
      description: Returns a list of branches an agent has
      operationId: get_branches_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: include_archived
          in: query
          required: false
          schema:
            type: boolean
            description: Whether archived branches should be included
            default: false
            title: Include Archived
          description: Whether archived branches should be included
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            exclusiveMinimum: 1
            description: How many results at most should be returned
            default: 100
            title: Limit
          description: How many results at most should be returned
        - name: include_commit_status
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Whether to compute how far each branch has diverged from main
              (commits_ahead/commits_behind). This walks the version DAG of
              every branch, so it is slow on agents with long histories and is
              off by default, leaving those fields null.
            default: false
            title: Include Commit Status
          description: >-
            Whether to compute how far each branch has diverged from main
            (commits_ahead/commits_behind). This walks the version DAG of every
            branch, so it is slow on agents with long histories and is off by
            default, leaving those fields null.
        - 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.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListResponse_AgentBranchSummary_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ListResponse_AgentBranchSummary_:
      properties:
        meta:
          $ref: '#/components/schemas/ListResponseMeta'
          default: {}
        results:
          items:
            $ref: '#/components/schemas/AgentBranchSummary'
          type: array
          title: Results
      type: object
      required:
        - results
      title: ListResponse[AgentBranchSummary]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ListResponseMeta:
      properties:
        total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        page_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Size
      type: object
      title: ListResponseMeta
    AgentBranchSummary:
      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_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Branch Id
          description: ID of the parent branch
        draft_exists:
          type: boolean
          title: Draft Exists
          description: Whether a draft exists for the branch
          default: false
        calls_7d:
          type: integer
          title: Calls 7D
          description: Number of calls in the last 7 days
          default: 0
        commits_ahead:
          anyOf:
            - type: integer
            - type: 'null'
          title: Commits Ahead
          description: >-
            Number of commits on this branch not yet on main, relative to their
            common ancestor. Null if it could not be computed (e.g. no common
            ancestor, or the branch history exceeds the comparison budget).
        commits_behind:
          anyOf:
            - type: integer
            - type: 'null'
          title: Commits Behind
          description: >-
            Number of commits on main not yet incorporated into this branch,
            relative to their common ancestor. Null if it could not be computed
            (e.g. no common ancestor, or the branch history exceeds the
            comparison budget).
        merged_into_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged Into Branch Id
          description: ID of the branch this branch's tip version was merged into, if any
      type: object
      required:
        - id
        - name
        - agent_id
        - description
        - created_at
        - last_committed_at
        - is_archived
      title: AgentBranchSummary
    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
    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

````