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

# Replace Asset



## OpenAPI

````yaml /openapi.json post /assets/{originAssetId}/replace
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /assets/{originAssetId}/replace:
    post:
      tags:
        - asset
      summary: Replace Asset
      operationId: AssetController_replaceAsset
      parameters:
        - name: originAssetId
          required: true
          in: path
          description: originAssetId
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: true
          in: query
          description: the branchId
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceAssetBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplaceAssetOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidAssetStartedAtErrorDto'
              examples:
                INVALID_ASSET_STARTED_AT:
                  $ref: '#/components/schemas/InvalidAssetStartedAtErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BranchNotFoundErrorDto'
              examples:
                BRANCH_NOT_FOUND:
                  $ref: '#/components/schemas/BranchNotFoundErrorDto'
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingConfigErrorDto'
                  - $ref: '#/components/schemas/MaxActiveAssetsReachedErrorDto'
                  - $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingBranchTypeErrorDto'
                  - $ref: '#/components/schemas/ConflictingAssetStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingFieldDefinitionErrorDto'
              examples:
                CONFLICTING_POLICY_STATUS:
                  $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
                CONFLICTING_CONFIG:
                  $ref: '#/components/schemas/ConflictingConfigErrorDto'
                MAX_ACTIVE_ASSETS_REACHED:
                  $ref: '#/components/schemas/MaxActiveAssetsReachedErrorDto'
                CONFLICTING_BRANCH_STATUS:
                  $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                CONFLICTING_BRANCH_TYPE:
                  $ref: '#/components/schemas/ConflictingBranchTypeErrorDto'
                CONFLICTING_ASSET_STATUS:
                  $ref: '#/components/schemas/ConflictingAssetStatusErrorDto'
                CONFLICTING_FIELD_DEFINITION:
                  $ref: '#/components/schemas/ConflictingFieldDefinitionErrorDto'
          description: ''
components:
  schemas:
    ReplaceAssetBody:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/NullableCustomFieldDto'
        name:
          type: string
          description: 'Optional: Name of the entity'
        policyId:
          type: string
          description: policyId of asset owner
        externalAssetId:
          type: string
          description: externalAssetId
        replacedAt:
          type: string
          description: original asset stoppedAt
      required:
        - policyId
    ReplaceAssetOutput:
      type: object
      properties:
        type:
          type: string
          description: type of entity
        id:
          type: string
          description: id of the entity
      required:
        - type
        - id
    InvalidAssetStartedAtErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_ASSET_STARTED_AT
        message:
          type: string
          example: Invalid asset startedAt with given date {givenDate}
        details:
          $ref: '#/components/schemas/InvalidAssetStartedAtDetailsDto'
      required:
        - code
        - message
        - details
    BranchNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - BRANCH_NOT_FOUND
        message:
          type: string
          example: Branch {branchId} not found
        details:
          $ref: '#/components/schemas/BranchNotFoundDetailsDto'
      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
    ConflictingConfigErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_CONFIG
        message:
          type: string
          example: Config field {configField} {requirement} {value} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingConfigDetailsDto'
      required:
        - code
        - message
        - details
    MaxActiveAssetsReachedErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - MAX_ACTIVE_ASSETS_REACHED
        message:
          type: string
          example: >-
            The active assets limit of {activeAssetsLimit} has been reached on
            those time periods
        details:
          $ref: '#/components/schemas/MaxActiveAssetConflictDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingBranchStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_BRANCH_STATUS
        message:
          type: string
          example: Branch status {requirement} {branchStatus} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingBranchStatusDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingBranchTypeErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_BRANCH_TYPE
        message:
          type: string
          example: Branch type {requirement} {branchType} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingBranchTypeDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingAssetStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_ASSET_STATUS
        message:
          type: string
          example: Asset status {requirement} {assetStatus} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingAssetStatusDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingFieldDefinitionErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_FIELD_DEFINITION
        message:
          type: string
          example: '{entity} {id} {field} {requirement} {qualifier}'
        details:
          $ref: >-
            #/components/schemas/ConflictingBusinessEntityFieldDefinitionDetailsDto
      required:
        - code
        - message
        - details
    NullableCustomFieldDto:
      type: object
      properties:
        key:
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
          nullable: true
      required:
        - key
        - value
    InvalidAssetStartedAtDetailsDto:
      type: object
      properties:
        givenDate:
          type: string
        limitDate:
          type: string
        userHelp:
          type: string
      required:
        - givenDate
    BranchNotFoundDetailsDto:
      type: object
      properties:
        branchId:
          type: string
      required:
        - branchId
    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
    ConflictingConfigDetailsDto:
      type: object
      properties:
        configField:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        value:
          type: string
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - configField
        - requirement
        - value
        - action
    MaxActiveAssetConflictDetailsDto:
      type: object
      properties:
        activeAssetsLimit:
          type: number
        timePeriods:
          type: array
          items:
            $ref: '#/components/schemas/MaxActiveAssetConflictDetailsTimePeriodsDto'
      required:
        - activeAssetsLimit
        - timePeriods
    ConflictingBranchStatusDetailsDto:
      type: object
      properties:
        branchStatus:
          allOf:
            - $ref: '#/components/schemas/BranchStatus'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - branchStatus
        - requirement
        - action
    ConflictingBranchTypeDetailsDto:
      type: object
      properties:
        branchType:
          allOf:
            - $ref: '#/components/schemas/BranchType'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - branchType
        - requirement
        - action
    ConflictingAssetStatusDetailsDto:
      type: object
      properties:
        assetStatus:
          allOf:
            - $ref: '#/components/schemas/AssetStatus'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
        additionalData:
          type: object
          additionalProperties: true
      required:
        - assetStatus
        - requirement
        - action
    ConflictingBusinessEntityFieldDefinitionDetailsDto:
      type: object
      properties:
        entity:
          allOf:
            - $ref: '#/components/schemas/BusinessEntity'
        id:
          type: string
        field:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        qualifier:
          allOf:
            - $ref: '#/components/schemas/FieldQualifier'
        additionalData:
          type: string
        rawData:
          type: object
          additionalProperties: true
      required:
        - entity
        - field
        - requirement
        - qualifier
    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
    MaxActiveAssetConflictDetailsTimePeriodsDto:
      type: object
      properties:
        startedAt:
          format: date-time
          type: string
        stoppedAt:
          format: date-time
          type: string
      required:
        - startedAt
    BranchStatus:
      type: string
      enum:
        - BRANCH_OPEN
        - BRANCH_MERGED
        - BRANCH_CLOSED
    BranchType:
      type: string
      enum:
        - BASE
        - NEW_BUSINESS
        - MTA
        - RENEWAL
        - REPRICING
    AssetStatus:
      type: string
      enum:
        - ASSET_CREATED
        - ASSET_REMOVED
        - ASSET_QUOTED
        - ASSET_CONFIRMED
        - ASSET_STARTED
        - ASSET_STOPPED
        - ASSET_CANCELLED
    BusinessEntity:
      type: string
      enum:
        - PAYMENT_METHOD
        - PAYMENT
        - POLICY
        - CUSTOMER
        - ASSET
        - INVOICE
        - DOCUMENT
        - SIGNATURE
        - TENANT
        - PRODUCT
        - QUOTE
        - BROKERAGE_FIRM
        - CLAIM
        - EXTERNAL_SERVICE
        - NOTIFICATION
        - PREMIUM_SCHEDULE
        - CHECK
        - ALERT
        - DISTRIBUTION_REQUEST
        - DEROGATION
        - BROKERAGE_FEE
        - COMMENT
        - CONVERSATION
        - CONVERSATION_MESSAGE
    FieldQualifier:
      type: string
      enum:
        - DEFINED
        - AFTER
        - BEFORE
        - ON or AFTER
        - BEFORE or ON
        - 'ON'
        - EMPTY
        - in

````