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

# Delete customer from policy



## OpenAPI

````yaml /openapi.json delete /customers/{customerId}/policies/{policyId}
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /customers/{customerId}/policies/{policyId}:
    delete:
      tags:
        - customer
      summary: Delete customer from policy
      operationId: CustomerController_deleteCustomerFromPolicy
      parameters:
        - name: policyId
          required: true
          in: path
          description: The policy id
          schema:
            type: string
        - name: customerId
          required: true
          in: path
          description: The customer id to delete
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteCustomerFromPolicyOutput'
        '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'
                  - $ref: '#/components/schemas/CustomerNotFoundErrorDto'
              examples:
                POLICY_NOT_FOUND:
                  $ref: '#/components/schemas/PolicyNotFoundErrorDto'
                CUSTOMER_NOT_FOUND:
                  $ref: '#/components/schemas/CustomerNotFoundErrorDto'
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CannotDeleteLastCustomerErrorDto'
                  - $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
              examples:
                CANNOT_DELETE_LAST_CUSTOMER:
                  $ref: '#/components/schemas/CannotDeleteLastCustomerErrorDto'
                CONFLICTING_POLICY_STATUS:
                  $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
          description: ''
components:
  schemas:
    DeleteCustomerFromPolicyOutput:
      type: object
      properties:
        customerId:
          type: string
          description: The deleted customer id
        policyId:
          type: string
          description: The policy id
      required:
        - customerId
        - policyId
    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
    CustomerNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CUSTOMER_NOT_FOUND
        message:
          type: string
          example: Customer {customerId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/CustomerNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    CannotDeleteLastCustomerErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CANNOT_DELETE_LAST_CUSTOMER
        message:
          type: string
          example: Cannot delete the last customer from policy {policyId}
        details:
          $ref: '#/components/schemas/CannotDeleteLastCustomerDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingPolicyStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_POLICY_STATUS
        message:
          type: string
          example: '{policyId} status {requirement} {policyStatus} to perform {action}'
        details:
          $ref: '#/components/schemas/ConflictingPolicyStatusDetailsDto'
      required:
        - code
        - message
        - details
    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
    CustomerNotFoundDetailsDto:
      type: object
      properties:
        customerId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - customerId
    CannotDeleteLastCustomerDetailsDto:
      type: object
      properties:
        policyId:
          type: string
          description: Policy ID
        customerId:
          type: string
          description: Customer ID
      required:
        - policyId
        - customerId
    ConflictingPolicyStatusDetailsDto:
      type: object
      properties:
        policyStatus:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        policyId:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
        additionalData:
          type: object
          additionalProperties: true
      required:
        - policyStatus
        - policyId
        - requirement
        - action
    OperationRequirement:
      type: string
      enum:
        - must be
        - must NOT be
        - must contain
        - must NOT contain
    Action:
      type: string
      enum:
        - PERFORM THIS ACTION
        - CREATE POLICY
        - CREATE ASSET
        - CREATE ASSET WITH START DATE
        - REPLACE ASSET
        - REMOVE ASSET
        - CHOOSE ASSET OPTIONS
        - STOP ASSET
        - EDIT ASSET
        - EDIT ASSET WITH START DATE
        - CREATE BRANCH
        - CREATE DEROGATION
        - CREATE MTA BRANCH
        - FORK TO NEW MTA BRANCH
        - FORK TO NEW NB BRANCH
        - FORK TO NEW RENEWAL BRANCH
        - FORK TO NEW REPRICING BRANCH
        - DEFINE PARENT POLICY ID
        - INITIALIZE CUSTOMER
        - EDIT CUSTOMER
        - DELETE CUSTOMER FROM POLICY
        - DECLARE CLAIMS HISTORY
        - SIGN
        - EDIT POLICY
        - EDIT POLICY EXTERNAL ID
        - CONFIRM POLICY
        - QUOTE POLICY
        - RETRIEVING QUOTE
        - STOP POLICY
        - SUSPEND POLICY
        - ACTIVATE POLICY
        - GENERATE MANDATE SIGNATURE REQUEST
        - GENERATE PAYMENT METHOD SECRET
        - CREATE CLAIM
        - FINALIZE RENEWAL
        - SEND CONTRACT TO SIGNATURE
        - GENERATE SIGNATURE REQUEST
        - GENERATE DOCUMENTS FOR SIGNATURE
        - APPROVE DISTRIBUTION REQUEST
        - DENY DISTRIBUTION REQUEST
        - REVOKED_DISTRIBUTION_REQUEST
        - DELETE DISTRIBUTION REQUEST
        - WAITING FOR SIGNATURE DISTRIBUTION REQUEST
        - UPDATE POLICY QUOTE

````