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

# Search a brokerage firm's policies

> Filters are sent in the request body, which is why this is a POST.



## OpenAPI

````yaml /openapi.json post /brokerage-firms/{brokerageFirmId}/policies/search
openapi: 3.0.0
info:
  title: Korint API
  description: >-
    Quoting, policy issuance, billing, claims, documents and compliance for
    insurance distribution.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.korint.io
    description: Production
  - url: https://api.sandbox.korint.io
    description: Sandbox
security:
  - oauth2: []
  - bearerAuth: []
tags: []
paths:
  /brokerage-firms/{brokerageFirmId}/policies/search:
    post:
      tags:
        - policy
      summary: Search a brokerage firm's policies
      description: Filters are sent in the request body, which is why this is a POST.
      operationId: PolicyReadsController_searchBrokerageFirmPolicies
      parameters:
        - name: tenant
          in: header
          required: true
          description: Your tenant identifier. Requests without it are rejected.
          schema:
            type: string
        - name: brokerageFirmId
          required: true
          in: path
          schema:
            pattern: >-
              ^brokerage_firm(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListBrokerageFirmPoliciesInputBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListBrokerageFirmPoliciesOutput'
components:
  schemas:
    ListBrokerageFirmPoliciesInputBody:
      type: object
      properties:
        pageInfo:
          description: the page info
          allOf:
            - $ref: '#/components/schemas/PageInfo'
        order:
          description: the sort options
          allOf:
            - $ref: '#/components/schemas/OrderDto'
        viewType:
          type: string
          description: View type
          enum:
            - newBusiness
            - archivedNewBusiness
            - derogation
            - live
        statuses:
          type: array
          description: Statuses to filter by
          items:
            type: string
            enum:
              - POLICY_CREATED
              - POLICY_QUOTED
              - POLICY_CONFIRMED
              - POLICY_SIGNED
              - POLICY_STARTED
              - POLICY_STOPPED
              - POLICY_SUSPENDED
        customStatuses:
          description: Custom statuses to filter by
          type: array
          items:
            type: string
        onSameBranch:
          description: Conditions that must be satisfied on the same branch simultaneously
          type: array
          items:
            $ref: '#/components/schemas/PropertyCondition'
        businessIntroducers:
          description: Business introducers to filter by
          type: array
          items:
            type: string
        startedAt:
          description: Started at range
          allOf:
            - $ref: '#/components/schemas/DateRange'
        stoppedAt:
          description: Stopped at range
          allOf:
            - $ref: '#/components/schemas/DateRange'
        endedAt:
          description: Ended at range (contract end date / due date)
          allOf:
            - $ref: '#/components/schemas/DateRange'
        createdAt:
          description: Created at range
          allOf:
            - $ref: '#/components/schemas/DateRange'
        hasAcknowledgedAlerts:
          type: boolean
          description: >-
            Optional: if filled, returns policies with at least one alert which
            acknowledgement matches this attribute
        awaitingFirstPayment:
          type: boolean
          description: >-
            Signed but awaiting first payment: CONFIRMED, signed, start date
            passed, on a product that gates activation on first payment.
        expandCustomers:
          type: boolean
        expandAssets:
          type: boolean
        expandBrokerageFirm:
          type: boolean
        expandDerogations:
          type: boolean
        queryString:
          type: string
          description: Full text search
        brokerageFirmName:
          type: string
          description: Brokerage firm name
        derogationStatuses:
          type: array
          description: Filter by derogation status
          items:
            type: string
            enum:
              - PENDING
              - DECLINED
              - APPROVED
        productIds:
          description: List of product ids
          type: array
          items:
            type: string
        stopReasons:
          description: List of stop reasons to filter by
          type: array
          items:
            type: string
        authorUserIds:
          description: Filter by assigned broker (policy author) user ids
          type: array
          items:
            type: string
      required:
        - viewType
    ListBrokerageFirmPoliciesOutput:
      type: object
      properties:
        data:
          description: the list of items in the page
          type: array
          items:
            $ref: '#/components/schemas/PolicyForBrokerEntity'
        pageInfo:
          description: the page info
          allOf:
            - $ref: '#/components/schemas/ResponsePageInfo'
        totalCount:
          type: number
          description: the total number of items
        currentPage:
          type: number
          description: the current page
        totalPages:
          type: number
          description: the total number of pages
      required:
        - data
        - pageInfo
        - totalCount
        - currentPage
        - totalPages
    PageInfo:
      type: object
      properties:
        count:
          type: number
          description: the number of items to return
          default: 10
        page:
          type: number
          description: the page to retrieve
          default: 1
    OrderDto:
      type: object
      properties:
        by:
          type: string
          description: the sort key
        direction:
          type: string
          description: the sort direction
      required:
        - by
        - direction
    PropertyCondition:
      type: object
      properties:
        includeAllBranches:
          type: boolean
          description: >-
            Search all branches regardless of their type and status. false =
            look only at BASE branch
          default: true
        excludeBaseBranch:
          type: boolean
          default: false
        timeZone:
          type: string
          description: >-
            This timezone is used in case no offset is specified in date filters
            values (ex: if 2021-01-01 or 2021-01-01T00:00:00 are provided, the
            timezone option is used to convert it to a UTC date)
          default: UTC
        textSearchDepth:
          type: number
          description: >-
            [EXPERIMENTAL] The number of relations text search filters are
            checked against (exponential impact on performances)
          default: 0
          minimum: 0
          maximum: 3
        property:
          type: string
        value:
          oneOf:
            - $ref: '#/components/schemas/OpEquals'
            - $ref: '#/components/schemas/OpGt'
            - $ref: '#/components/schemas/OpLt'
            - $ref: '#/components/schemas/OpGte'
            - $ref: '#/components/schemas/OpLte'
            - $ref: '#/components/schemas/OpContains'
            - $ref: '#/components/schemas/OpStartsWith'
            - $ref: '#/components/schemas/OpEndsWith'
            - $ref: '#/components/schemas/OpIn'
      required:
        - property
        - value
    DateRange:
      type: object
      properties:
        start:
          format: date-time
          type: string
          description: Start date
        end:
          format: date-time
          type: string
          description: End date
    PolicyForBrokerEntity:
      type: object
      properties:
        customerIds:
          description: Customer ids
          type: array
          items:
            type: string
        policyId:
          type: string
          description: Policy id
        branches:
          type: array
          items:
            $ref: '#/components/schemas/PolicyBranchesForBrokerEntity'
      required:
        - customerIds
        - policyId
        - branches
    ResponsePageInfo:
      type: object
      properties:
        first:
          type: boolean
          description: whether this is the first page
        last:
          type: boolean
          description: whether this is the last page
    OpEquals:
      type: object
      properties:
        equals:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: string
              format: date-time
      required:
        - equals
    OpGt:
      type: object
      properties:
        gt:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: string
              format: date-time
      required:
        - gt
    OpLt:
      type: object
      properties:
        lt:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: string
              format: date-time
      required:
        - lt
    OpGte:
      type: object
      properties:
        gte:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: string
              format: date-time
      required:
        - gte
    OpLte:
      type: object
      properties:
        lte:
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: string
              format: date-time
      required:
        - lte
    OpContains:
      type: object
      properties:
        contains:
          type: string
      required:
        - contains
    OpStartsWith:
      type: object
      properties:
        startsWith:
          type: string
      required:
        - startsWith
    OpEndsWith:
      type: object
      properties:
        endsWith:
          type: string
      required:
        - endsWith
    OpIn:
      type: object
      properties:
        in:
          type: array
          items:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: string
                format: date-time
      required:
        - in
    PolicyBranchesForBrokerEntity:
      type: object
      properties:
        branch:
          $ref: '#/components/schemas/PolicyBranchDto'
        customers:
          type: array
          items:
            $ref: '#/components/schemas/SimplifiedCustomerDto'
        policy:
          $ref: '#/components/schemas/SimplifiedPolicyDto'
        assets:
          type: array
          items:
            $ref: '#/components/schemas/SimplifiedAssetDto'
        brokerageFirm:
          $ref: '#/components/schemas/SimplifiedBrokerageFirmDto'
        parentBrokerageFirm:
          $ref: '#/components/schemas/SimplifiedBrokerageFirmDto'
        derogations:
          type: array
          items:
            $ref: '#/components/schemas/SimplifiedDerogationDto'
      required:
        - policy
    PolicyBranchDto:
      type: object
      properties:
        branchId:
          type: string
        createdAt:
          format: date-time
          type: string
          description: Creation date of the branch
        renewalStatus:
          type: string
          description: 'Optional: Branch renewal status'
          enum:
            - RENEWAL_ACCEPTED
            - RENEWAL_REFUSED
        branchType:
          type: string
          enum:
            - BASE
            - NEW_BUSINESS
            - MTA
            - RENEWAL
            - REPRICING
        branchSubType:
          description: 'Optional: Branch sub type'
          allOf:
            - $ref: '#/components/schemas/BranchSubType'
        availability:
          type: string
          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
            - SIGNATURE_CANCELLED
        mergedAt:
          format: date-time
          type: string
          description: 'Optional: Merge date of the branch'
        derogations:
          description: 'Optional: Branch derogations'
          type: array
          items:
            $ref: '#/components/schemas/DerogationDto'
      required:
        - branchId
        - createdAt
        - branchType
    SimplifiedCustomerDto:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDto'
        name:
          type: string
          description: 'Optional: Name of the entity'
        type:
          type: string
          description: Type of the customer
        id:
          pattern: >-
            ^customer(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          type: string
          description: Unique identifier for the customer
        createdAt:
          format: date-time
          type: string
          description: Date and time when the customer was created
        lastModifiedAt:
          format: date-time
          type: string
          description: Date and time when the customer was last modified
        status:
          type: string
          description: Status of the customer
          enum:
            - CUSTOMER_CREATED
            - CUSTOMER_CONFIRMED
        role:
          type: string
          description: Customer business role
        paymentMode:
          type: string
          enum:
            - DIRECT_DEBIT
            - BANK_TRANSFER
      required:
        - type
        - id
        - createdAt
        - lastModifiedAt
        - status
        - role
        - paymentMode
    SimplifiedPolicyDto:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDto'
        id:
          pattern: >-
            ^policy(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          type: string
          description: Unique identifier for the policy
        productId:
          type: string
          description: Product ID
        externalId:
          type: string
          description: External policy id
        createdAt:
          format: date-time
          type: string
          description: Date and time when the policy was created
        lastModifiedAt:
          format: date-time
          type: string
          description: Date and time when the policy was last modified
        status:
          type: string
          description: Status of the policy
          enum:
            - POLICY_CREATED
            - POLICY_QUOTED
            - POLICY_CONFIRMED
            - POLICY_SIGNED
            - POLICY_STARTED
            - POLICY_STOPPED
            - POLICY_SUSPENDED
        author:
          description: Author of the policy
          allOf:
            - $ref: '#/components/schemas/BrokerDto'
        signedAt:
          format: date-time
          type: string
          description: Date and time when the policy was signed
        startedAt:
          format: date-time
          type: string
          description: Date and time when the policy started
        isAwaitingFirstPayment:
          type: boolean
          description: >-
            Derived: signed but not yet active because the product gates
            activation on first payment and that payment is still outstanding
            (status CONFIRMED, signed, start date passed).
        endedAt:
          format: date-time
          type: string
          description: Date and time when the policy will end
        stoppedAt:
          format: date-time
          type: string
          description: Date and time when the policy stopped
        stop:
          description: stop reason, details and createdAt
          allOf:
            - $ref: '#/components/schemas/StopDto'
        hasOpenedClientAccount:
          type: boolean
          description: Has anyone has a DRIVER relationship with the policy's customer
        totalPremium:
          $ref: '#/components/schemas/SimplifiedAmountDto'
      required:
        - id
        - productId
        - createdAt
        - lastModifiedAt
        - status
        - hasOpenedClientAccount
    SimplifiedAssetDto:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDto'
        id:
          pattern: >-
            ^asset(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          type: string
          description: assetId
        lastModifiedAt:
          format: date-time
          type: string
          description: Last modified date of the asset
        createdAt:
          format: date-time
          type: string
          description: Creation date of the asset
        status:
          type: string
          description: Status of the asset
          enum:
            - ASSET_CREATED
            - ASSET_REMOVED
            - ASSET_QUOTED
            - ASSET_CONFIRMED
            - ASSET_STARTED
            - ASSET_STOPPED
            - ASSET_CANCELLED
        startedAt:
          format: date-time
          type: string
          description: Date the asset starts
        stoppedAt:
          format: date-time
          type: string
          description: Date the asset stops
        totalPremium:
          $ref: '#/components/schemas/SimplifiedAmountDto'
      required:
        - id
        - lastModifiedAt
        - createdAt
        - status
    SimplifiedBrokerageFirmDto:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDto'
        firmType:
          type: string
          description: Brokerage firm type
          enum:
            - WHOLESALE
            - RETAIL
            - TEAM
        id:
          pattern: >-
            ^brokerage_firm(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          type: string
          description: Brokerage firm id
        companyInfo:
          description: Company info
          allOf:
            - $ref: '#/components/schemas/FormattedSirenDataDto'
      required:
        - firmType
        - id
        - companyInfo
    SimplifiedDerogationDto:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - PENDING
            - DECLINED
            - APPROVED
        policyId:
          pattern: >-
            ^policy(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          type: string
      required:
        - id
        - status
        - policyId
    BranchSubType:
      type: string
      enum:
        - CREATE_ADDITIONAL_COMPONENTS
        - DRIVEQUANT
      description: Branch sub type
    DerogationDto:
      type: object
      properties:
        derogationId:
          pattern: >-
            ^derogation(_test)?_[346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz]{21}$
          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:
          format: date-time
          type: string
          description: Derogation creation date
      required:
        - derogationId
        - action
        - status
        - createdAt
    CustomFieldDto:
      type: object
      properties:
        key:
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
      required:
        - key
        - value
    BrokerDto:
      type: object
      properties:
        firstName:
          type: string
          description: First name
        lastName:
          type: string
          description: Last name
        userId:
          type: string
          description: User id
        email:
          format: email
          type: string
        brokerRole:
          type: string
      required:
        - firstName
        - lastName
        - userId
    StopDto:
      type: object
      properties:
        reason:
          type: string
          description: >-
            Stop reason. The accepted values are defined per product; read them
            from `stopReasons` in `GET /config/{productId}`. An unlisted value
            fails with INVALID_STOP_REASON.
        details:
          description: Stop details
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldDto'
        createdAt:
          type: string
          description: Date and time when the stop was created
      required:
        - reason
    SimplifiedAmountDto:
      type: object
      properties:
        amountPreFeesAndTaxes:
          type: integer
        totalFees:
          type: integer
        amountWithFeesPreTaxes:
          type: integer
        totalTaxes:
          type: integer
        amountWithFeesAndTaxes:
          type: integer
      required:
        - amountPreFeesAndTaxes
        - totalFees
        - amountWithFeesPreTaxes
        - totalTaxes
        - amountWithFeesAndTaxes
    FormattedSirenDataDto:
      type: object
      properties:
        siren:
          type: string
          description: 'Optional: Siren number'
        siret:
          type: string
          description: Siret number
        nafCode:
          type: string
          description: 'Optional: Naf code'
        nafLabel:
          type: string
          description: 'Optional: Naf label'
        name:
          type: string
          description: 'Optional: Company name'
        creationDate:
          format: date-time
          type: string
          description: 'Optional: Creation date'
        location:
          description: 'Optional: Location'
          allOf:
            - $ref: '#/components/schemas/LocationDto'
        legalStatus:
          description: 'Optional: legal status by level'
          allOf:
            - $ref: '#/components/schemas/LegalStatusDto'
        headcount:
          type: string
          description: 'Optional: Number of employees'
        isActive:
          type: boolean
          description: >-
            Optional: legal unit is active (INSEE etatAdministratifUniteLegale:
            A=active, C=ceased)
      required:
        - siret
    DerogationAction:
      type: string
      enum:
        - QUOTE
        - CONFIRM
        - SIGN
    DerogationStatus:
      type: string
      enum:
        - CREATED
        - APPROVED
        - DENIED
      description: Status of the derogation
    LocationDto:
      type: object
      properties:
        address:
          type: string
          description: Address
        postCode:
          type: string
          description: Post code
        city:
          type: string
          description: City
        country:
          type: string
          description: Country
      required:
        - city
        - country
    LegalStatusDto:
      type: object
      properties:
        '1':
          type: string
          description: First legal status
        '2':
          type: string
          description: Second legal status
        '3':
          type: string
          description: Third legal status
      required:
        - '1'
        - '2'
        - '3'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://korint-tenant.auth.eu-west-3.amazoncognito.com/oauth2/token
          scopes:
            korint.io/account: Read account information
            korint.io/analytics: Access analytics endpoints
            korint.io/assets: Access asset endpoints
            korint.io/billing: Access billing endpoints
            korint.io/branches: Access branch endpoints
            korint.io/broker: Access broker endpoints
            korint.io/claims: Access claim endpoints
            korint.io/comments: Access comment endpoints
            korint.io/customers: Access customer endpoints
            korint.io/derogations: Access derogation endpoints
            korint.io/documents: Access document endpoints
            korint.io/external: Access external lookup endpoints
            korint.io/external-claims: Declare claims from an external system
            korint.io/internal-notes: Access internal note endpoints
            korint.io/invitations: Access invitation endpoints
            korint.io/payments: Access payment endpoints
            korint.io/permissions: Access permission management endpoints
            korint.io/policies: Access policy endpoints
            korint.io/quotes: Access quote endpoints
            korint.io/reportings: Access reporting endpoints
            korint.io/signature: Access signature endpoints
      description: >-
        Machine-to-machine clients use the OAuth 2.0 client credentials grant.
        Each tenant has its own authorization server: in the token URL below,
        replace `tenant` with your tenant identifier.
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: An access token obtained from your tenant authorization server.

````