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

# List branches on the policy

> Returns a list of open branches on the policy at the simulated date. The branches are sorted by creation date, with the oldest branch appearing first.
If no simulated date is passed, this endpoint returns all branches still open after the application of every event pertaining to them, as branches that are merged or dropped will not appear. For example, if a branch is created on 01/01/2023 and merged/dropped on 05/01/2023, the branch will appear in the result if listing branches at dates 01/01/2023-05/01/2023; before 01/01/2023, the branch will not appear as it was not created; after 05/01/2023, the branch will not appear as it was merged or dropped.



## OpenAPI

````yaml /openapi.json get /policies/{policyId}/branches
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /policies/{policyId}/branches:
    get:
      tags:
        - policy
      summary: List branches on the policy
      description: >-
        Returns a list of open branches on the policy at the simulated date. The
        branches are sorted by creation date, with the oldest branch appearing
        first.

        If no simulated date is passed, this endpoint returns all branches still
        open after the application of every event pertaining to them, as
        branches that are merged or dropped will not appear. For example, if a
        branch is created on 01/01/2023 and merged/dropped on 05/01/2023, the
        branch will appear in the result if listing branches at dates
        01/01/2023-05/01/2023; before 01/01/2023, the branch will not appear as
        it was not created; after 05/01/2023, the branch will not appear as it
        was merged or dropped.
      operationId: PolicyController_listBranches
      parameters:
        - name: policyId
          required: true
          in: path
          description: the policy id
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: simulatedAt
          required: false
          in: query
          description: 'Optional: the simulatedAt datetime'
          schema:
            type: string
        - name: branchType
          required: false
          in: query
          description: the branch type
          schema:
            type: string
            enum:
              - BASE
              - NEW_BUSINESS
              - MTA
              - RENEWAL
              - REPRICING
        - name: branchStatus
          required: false
          in: query
          description: the branch status
          schema:
            type: string
            enum:
              - BRANCH_OPEN
              - BRANCH_MERGED
              - BRANCH_CLOSED
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBranchesOutput'
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ForbiddenErrorDto'
              examples:
                FORBIDDEN:
                  $ref: '#/components/schemas/ForbiddenErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PolicyNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  $ref: '#/components/schemas/PolicyNotFoundErrorDto'
          description: ''
components:
  schemas:
    ListBranchesOutput:
      type: object
      properties:
        total:
          type: number
          description: Total number of policies
        offset:
          type: number
          description: Offset used for pagination
        limit:
          type: number
          description: Page size used for pagination
        data:
          description: List of policies
          type: array
          items:
            $ref: '#/components/schemas/BranchDto'
      required:
        - total
        - offset
        - limit
        - data
    ForbiddenErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - FORBIDDEN
        message:
          type: string
          example: Forbidden
        details:
          $ref: '#/components/schemas/ForbiddenDetailsDto'
      required:
        - code
        - message
        - details
    PolicyNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - POLICY_NOT_FOUND
        message:
          type: string
          example: Policy {policyId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/PolicyNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    BranchDto:
      type: object
      properties:
        name:
          type: string
          description: 'Optional: Name of the entity'
        id:
          type: string
          description: Unique identifier for the branch
        type:
          type: string
          description: Type of object
          enum:
            - BRANCH
        createdAt:
          type: string
          description: Creation date of the branch
        lastModifiedAt:
          type: string
          description: Last modification date of the branch
        status:
          type: string
          description: 'Optional: Policy status'
          enum:
            - POLICY_CREATED
            - POLICY_QUOTED
            - POLICY_CONFIRMED
            - POLICY_STARTED
            - POLICY_STOPPED
            - POLICY_SUSPENDED
        renewalStatus:
          type: string
          description: 'Optional: Branch renewal status'
          enum:
            - RENEWAL_ACCEPTED
            - RENEWAL_REFUSED
        branchType:
          type: string
          description: 'Optional: Branch type'
          enum:
            - BASE
            - NEW_BUSINESS
            - MTA
            - RENEWAL
            - REPRICING
        branchSubType:
          description: 'Optional: Branch sub type'
          allOf:
            - $ref: '#/components/schemas/BranchSubType'
        branchStatus:
          type: string
          description: 'Optional: Branch status'
          enum:
            - BRANCH_OPEN
            - BRANCH_MERGED
            - BRANCH_CLOSED
        closeReason:
          type: string
          description: 'Optional: Branch close reason'
          enum:
            - BROKER_REQUEST
            - CUSTOMER_REQUEST
            - FORKED
            - ASSET_START_PASSED
            - CONCURRENT_BRANCH_MERGED
            - QUOTE_INVALIDATED
            - PARTITION_DROPPED
            - RENEWAL_REFUSED
            - CRM_ABOVE_LIMIT
            - TELEMATICS_SCORE_MISSING
        mergedAt:
          type: string
          description: Merge date of the branch
        derogations:
          description: 'Optional: Branch derogations'
          type: array
          items:
            $ref: '#/components/schemas/DerogationDto'
      required:
        - id
        - type
        - createdAt
        - lastModifiedAt
    ForbiddenDetailsDto:
      type: object
      properties:
        message:
          type: string
        documentKey:
          type: string
        userId:
          type: string
        ownerId:
          type: string
      required:
        - message
        - documentKey
        - userId
        - ownerId
    PolicyNotFoundDetailsDto:
      type: object
      properties:
        policyId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - policyId
    BranchSubType:
      type: string
      enum:
        - CREATE_ADDITIONAL_COMPONENTS
        - DRIVEQUANT
      description: Branch sub type
    DerogationDto:
      type: object
      properties:
        derogationId:
          type: string
          description: Unique identifier for the derogation
        action:
          description: Action for the derogation
          allOf:
            - $ref: '#/components/schemas/DerogationAction'
        status:
          description: Status of the derogation
          allOf:
            - $ref: '#/components/schemas/DerogationStatus'
        createdAt:
          type: string
          description: Derogation creation date
      required:
        - derogationId
        - action
        - status
        - createdAt
    DerogationAction:
      type: string
      enum:
        - QUOTE
        - CONFIRM
        - SIGN
    DerogationStatus:
      type: string
      enum:
        - CREATED
        - APPROVED
        - DENIED
      description: Status of the derogation

````