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

# Accept Loan Rebalance

> Accept the loan rebalance request. Only a lender can carry out this action.



## OpenAPI

````yaml /copper-open-api-public.json patch /organizations/{organizationId}/loans/{acceptRebalanceLoanId}
openapi: 3.1.0
info:
  description: >-
    Copper API is based on the REST API interface provided for data exchange
    between a client and a server with the use of HTTPS requests and responses.

    By default, the request should include a Content-Type header set as
    application/json. Some requests require different header fields, as well as
    other Content-Type values. In this case, a proper header will be stated in
    an example.

    When interacting with the API, please note that all numerical values, such
    as order amounts or timestamps, should be transmitted as strings. This
    ensures consistent data representation and prevents potential issues with
    floating-point precision
  title: Copper Platform API
  version: latest
servers:
  - description: platform.copper.co
    url: https://api.copper.co/platform
  - description: demo.copper.co
    url: https://api.stage.copper.co/platform
  - description: testnet.copper.co
    url: https://api.testnet.copper.co/platform
security: []
tags:
  - name: reports
  - name: deposit-targets
  - name: lending
  - name: portfolios
  - name: wallets
  - name: network
  - name: stake
  - name: blockchain
  - name: organizations
  - name: files
  - name: orders
  - name: address-book
  - name: clearloop
  - name: currencies
paths:
  /organizations/{organizationId}/loans/{acceptRebalanceLoanId}:
    patch:
      tags:
        - lending
      summary: Accept Loan Rebalance
      description: >-
        Accept the loan rebalance request. Only a lender can carry out this
        action.
      parameters:
        - description: application/vnd.accept-loan-rebalance+json
          in: header
          name: Content-Type
          required: false
          schema:
            type: string
        - in: path
          name: organizationId
          required: true
          schema:
            type: string
        - in: path
          name: acceptRebalanceLoanId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/vnd.accept-loan-rebalance+json:
            schema:
              $ref: '#/components/schemas/ActionLoan'
      responses:
        '200':
          content:
            application/vnd.accept-loan-rebalance+json:
              schema:
                $ref: '#/components/schemas/Loan'
          description: OK
        '400':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - bad-request
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Bad Request
        '403':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - forbidden
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Forbidden
        '409':
          content:
            application/json:
              schema:
                properties:
                  error:
                    description: The machine-readable error code
                    examples:
                      - conflict
                    type: string
                  message:
                    description: >-
                      A human-readable message providing more details about the
                      error
                    type: string
                type: object
          description: Conflict
components:
  schemas:
    ActionLoan:
      properties:
        collateralPortfolioId:
          description: >-
            The account where the collateral is to be returned to if accepted by
            the borrower and repaid in full
          type: string
        loanAllocationId:
          description: The ID of the loan allocation
          type: string
      required:
        - loanAllocationId
      type: object
    Loan:
      properties:
        amount:
          description: The amount of the loan
          type: string
        borrowerCounterpartyId:
          description: The counterparty ID of the borrower
          type: string
        borrowerOrganizationId:
          description: The organization ID of the borrower. Obfuscated for lender
          type: string
        borrowerPortfolioId:
          description: >-
            The ID of the account which is to be the destination of disbursed
            funds. Obfuscated for lender
          type: string
        createdAt:
          description: Timestamp in epoch milliseconds of the loan creation
          type: string
        createdBy:
          description: The ID of the user that created the loan
          type: string
        currency:
          description: Currency code of the asset being lent
          type: string
        debtRatio:
          description: The LTV of the loan
          type: string
        debtRatioStatus:
          $ref: '#/components/schemas/DebtRatioStatus'
          description: The LTV status of the loan (healthy, margin-call, default)
        debtRatioUpdatedAt:
          description: Timestamp in epoch milliseconds when the LTV was last updated
          type: string
        defaultReason:
          description: The reason for the loan default
          type: string
        embedded:
          $ref: '#/components/schemas/LoanEmbedded'
          description: Additional data linked to the loan
          type: object
        externalId:
          description: Unique identifier for externally originated loans, must be unique
          type: string
        extra:
          $ref: '#/components/schemas/LoanExtra'
          description: Additional data for the loan
          type: object
        interestRate:
          description: The interest rate for the loan in basis points (BPS)
          type: string
        lenderCounterpartyId:
          description: The counterparty ID of the lender
          type: string
        lenderOrganizationId:
          description: The organization ID of the lender. Obfuscated for borrower
          type: string
        lenderPortfolioId:
          description: >-
            The ID of the account which is to be used for disbursing the loan to
            the borrower. Obfuscated for borrower
          type: string
        loanId:
          description: Unique identifier of the loan
          type: string
        loanType:
          $ref: '#/components/schemas/LoanType'
          description: The type of the loan. [See details](/enums/LoanType)
        mainCurrency:
          description: Currency code of the network being used to transfer the asset
          type: string
        maturityDate:
          description: Timestamp in epoch milliseconds of the maturity date
          type: string
        originalLoanAmount:
          description: The original amount of the loan at time of disbursal
          type: string
        originalLoanValue:
          description: The original value of the loan at time of disbursal
          type: string
        startDate:
          description: >-
            Timestamp in epoch milliseconds the loan is meant to be disbursed
            and activated
          type: string
        status:
          $ref: '#/components/schemas/LoanStatus'
          description: The status of the loan. [See details](/enums/LoanStatus)
        terminatedAt:
          description: Timestamp in epoch milliseconds of the loan termination
          type: string
        unrealisedAmount:
          description: The amount of pending loan funds; can be positive and negative
          type: string
        updatedAt:
          description: Timestamp in epoch milliseconds of the most recent loan update
          type: string
      required:
        - loanId
        - externalId
        - status
        - loanType
        - amount
        - currency
        - mainCurrency
        - lenderOrganizationId
        - lenderCounterpartyId
        - borrowerOrganizationId
        - borrowerCounterpartyId
        - createdBy
      type: object
    DebtRatioStatus:
      enum: []
      type: string
    LoanEmbedded:
      properties:
        childLoans:
          description: >-
            The list of child loans - Only applicable for agency lending parent
            loans
          items:
            $ref: '#/components/schemas/Loan'
          type: array
        collaterals:
          description: The list of collaterals allocated to their respective loans
          items:
            $ref: '#/components/schemas/Collateral'
          type: array
        counterparties:
          description: The list of counterparties
          items:
            $ref: '#/components/schemas/Counterparty'
          type: array
        loanAllocations:
          description: The list of transactions allocated to their respective loans
          items:
            $ref: '#/components/schemas/LoanAllocation'
          type: array
        loanInterest:
          $ref: '#/components/schemas/LoanInterest'
          description: The interest of the loan - Only applicable for bilateral loans
          type: object
        loanModifications:
          description: The list of modifications to their respective loans
          items:
            $ref: '#/components/schemas/LoanModification'
          type: array
        marginCall:
          $ref: '#/components/schemas/MarginCall'
          description: The margin call associated with the loan, if any
          type: object
      type: object
    LoanExtra:
      properties:
        acceptedAt:
          description: Timestamp in epoch milliseconds of the loan acceptance
          type: string
        acceptedBy:
          description: The ID of the user that accepted the loan
          type: string
        approvedAt:
          description: Timestamp in epoch milliseconds of the loan approval
          type: string
        approvedBy:
          description: The ID of the user that approved the loan
          type: string
        cancelledAt:
          description: Timestamp in epoch milliseconds of the loan cancellation
          type: string
        cancelledBy:
          description: The ID of the user that cancelled the loan
          type: string
        defaultThreshold:
          description: The LTV threshold at which the loan is in default
          type: string
        defaultedAt:
          description: Timestamp in epoch milliseconds of the loan default
          type: string
        defaultedBy:
          description: The ID of the user that defaulted the loan
          type: string
        disbursedAt:
          description: Timestamp in epoch milliseconds of the loan disbursal
          type: string
        externalDisbursal:
          description: >-
            Boolean representing if the loan funds are disbursed and managed
            off-platform
          type: boolean
        externalInterestPayment:
          description: Boolean representing if interest payments are managed off-platform
          type: boolean
        initialLtv:
          description: The LTV based off the initial collateral requirement
          type: string
        initiallyRequiredCollateralUsd:
          description: >-
            The value of the initially required collateral denominated in US
            Dollars
          type: string
        lenderFeeShare:
          description: >-
            Portion of interest fees allocated to the principal lender,
            expressed in basis points
          type: string
        lenderFeeSharePercentage:
          description: >-
            Portion of interest fees allocated to the principal lender,
            expressed as a percentage
          type: string
        marginCallExpiryPeriod:
          description: >-
            Duration of the margin call expiry period in hours, doesn't apply to
            ClearLoop loans
          type: string
        marginCallThreshold:
          description: The LTV threshold at which the loan is in margin call
          type: string
        rebalanceThreshold:
          description: The LTV threshold at which the borrower can request a rebalance
          type: string
        rejectedAt:
          description: Timestamp in epoch milliseconds of the loan rejection
          type: string
        rejectedBy:
          description: The ID of the user that rejected the loan
          type: string
        repaidAt:
          description: Timestamp in epoch milliseconds of the loan repayment
          type: string
        repaidBy:
          description: The ID of the user that repaid the loan
          type: string
        requiredCollaterals:
          description: >-
            The amount of the collateral required. Currently only a single
            collateral currency is supported
          items:
            $ref: '#/components/schemas/RequiredCollateral'
          type: array
      type: object
    LoanType:
      enum:
        - agency-lending-parent-loan
        - agency-inventory
        - agency-lending-collateralised-child-loan
        - agency-title-transfer-collateralised-loan
        - agency-lending-uncollateralised-child-loan
        - agency-uncollateralised-loan
        - agency-lending-first-lien-child-loan
        - agency-clearloop-loan
        - agency-lending-pledge-collateralised-child-loan
        - agency-pledge-collateralised-loan
        - bilateral-lending-title-transfer-collateralised-loan
        - bilateral-title-transfer-collateralised-loan
        - bilateral-lending-pledge-collateralised-loan
        - bilateral-pledge-collateralised-loan
        - bilateral-lending-uncollateralised-loan
        - bilateral-uncollateralised-loan
      type: string
    LoanStatus:
      enum:
        - awaiting-approval
        - awaiting-acceptance
        - awaiting-collateral
        - awaiting-interest-payment
        - disbursing
        - active
        - repaying
        - defaulting
        - partially-defaulting
        - early-termination-in-progress
        - early-termination-completed
        - defaulted
        - default-resolved
        - cancelled
        - rejected
        - errored
        - repaid
        - repaying-interest
        - interest-repaid
        - securing-collateral
        - collateral-secured
        - releasing-collateral
        - collateral-released
        - closed
      type: string
    Collateral:
      properties:
        amount:
          description: The amount of the transferred collateral
          type: string
        collateralId:
          description: Unique identifier of the collateral
          type: string
        createdAt:
          description: Timestamp in epoch milliseconds of the collateral creation
          type: string
        currency:
          description: Currency code of the asset being used for collateral
          type: string
        loanId:
          description: The ID of the loan
          type: string
        mainCurrency:
          description: Currency code of the network being used to transfer the collateral
          type: string
        portfolioId:
          description: The account where the collateral is being held
          type: string
        unrealisedAmount:
          description: The amount of pending collateral funds. Can be positive or negative
          type: string
        updatedAt:
          description: Timestamp in epoch milliseconds of the last collateral update
          type: string
      required:
        - collateralId
        - loanId
        - amount
        - currency
        - mainCurrency
        - createdAt
      type: object
    Counterparty:
      properties:
        backgroundImageId:
          description: Background image id
          type: string
        counterpartyDescription:
          description: Counterparty description
          type: string
        counterpartyId:
          description: Counterparty ID
          type: string
        counterpartyName:
          description: Counterparty name
          type: string
        counterpartyType:
          $ref: '#/components/schemas/CounterpartyType'
          description: Counterparty type. [See details](/enums/CounterpartyType)
        extra:
          $ref: '#/components/schemas/CounterpartyExtra'
          description: Counterparty additional information
          type: object
        imageId:
          description: Image id
          type: string
        networkTag:
          description: Counterparty network handle
          type: string
        priority:
          description: >-
            Counterparty priority indicator. The higher the value, the higher
            the priority
          type: string
        tags:
          description: Counterparty tags. [See details](/enums/CounterpartyTag)
          items:
            $ref: '#/components/schemas/CounterpartyTag'
          type: array
      required:
        - counterpartyId
        - counterpartyName
        - networkTag
        - counterpartyType
      type: object
    LoanAllocation:
      properties:
        allocationType:
          $ref: '#/components/schemas/LoanAllocationType'
          description: The type of the allocation. [See details](/enums/LoanAllocationType)
        amount:
          description: The amount of the loan allocation
          type: string
        counterpartyOrderId:
          description: The underlying deposit id
          type: string
        createdAt:
          description: Timestamp in epoch milliseconds of the allocation creation
          type: string
        createdBy:
          description: >-
            The ID of the user whose action resulted in the creation of the
            allocation
          type: string
        currency:
          description: Currency code of the asset being used for collateral
          type: string
        externalFailureDescription:
          description: >-
            The failure description of an allocation. Only populated when status
            is "failed" and the failure reason is known
          type: string
        extra:
          $ref: '#/components/schemas/LoanAllocationExtra'
          description: Additional data for the allocation
          type: object
        fromPortfolioId:
          description: >-
            The account that funds are transferred out of. Obfuscated depending
            on allocation type and requestor
          type: string
        loanAllocationId:
          description: Unique identifier of the loan allocation
          type: string
        loanId:
          description: The ID of the loan
          type: string
        mainCurrency:
          description: Currency code of the network being used to transfer the collateral
          type: string
        orderId:
          description: The underlying withdrawal id
          type: string
        requestorCounterpartyId:
          description: >-
            The ID of the counterparty whose action resulted in the creation of
            the allocation
          type: string
        status:
          $ref: '#/components/schemas/LoanAllocationStatus'
          description: >-
            The status of the allocation. [See
            details](/enums/LoanAllocationStatus)
        terminatedAt:
          description: Timestamp in epoch milliseconds of the allocation termination
          type: string
        toPortfolioId:
          description: >-
            The account that funds are transferred to. Obfuscated depending on
            allocation type and requestor
          type: string
        updatedAt:
          description: Timestamp in epoch milliseconds of the last allocation update
          type: string
      required:
        - loanAllocationId
        - loanId
        - amount
        - currency
        - mainCurrency
        - status
        - allocationType
        - extra
        - createdAt
      type: object
    LoanInterest:
      properties:
        accruedInterest:
          description: >-
            The interest amount accrued since the last interest payment or since
            the inception of loan
          type: string
        createdAt:
          description: Timestamp in epoch milliseconds of the loan interest creation
          type: string
        interestCurrency:
          description: The currency of the interest payment
          type: string
        lastPaymentAt:
          description: Timestamp in epoch milliseconds of the last loan interest payment
          type: string
        loanId:
          description: The ID of the loan
          type: string
        loanInterestId:
          description: Unique identifier of the loan interest
          type: string
        realisedInterest:
          description: >-
            The total interest amount paid by the borrower since the inception
            of loan
          type: string
        unrealisedInterest:
          description: The amount of pending interest payment
          type: string
        updatedAt:
          description: Timestamp in epoch milliseconds of the loan interest update
          type: string
      required:
        - loanInterestId
        - loanId
        - interestCurrency
        - accruedInterest
        - createdAt
      type: object
    LoanModification:
      properties:
        createdAt:
          description: Timestamp in epoch milliseconds of the allocation creation
          type: string
        createdBy:
          description: >-
            The ID of the user whose action resulted in the creation of the
            allocation
          type: string
        extra:
          $ref: '#/components/schemas/LoanModificationExtra'
          description: Additional data for the modification
          type: object
        loanId:
          description: The ID of the loan
          type: string
        loanModificationId:
          description: Unique identifier of the loan modification
          type: string
        modificationType:
          $ref: '#/components/schemas/LoanModificationType'
          description: >-
            The type of the modification. [See
            details](/enums/LoanModificationType)
        requestorCounterpartyId:
          description: >-
            The ID of the counterparty whose action resulted in the creation of
            the modification
          type: string
        status:
          $ref: '#/components/schemas/LoanModificationStatus'
          description: >-
            The status of the modification. [See
            details](/enums/LoanModificationStatus)
        updatedAt:
          description: Timestamp in epoch milliseconds of the last modification update
          type: string
      required:
        - loanModificationId
        - loanId
        - createdAt
        - status
        - modificationType
        - extra
      type: object
    MarginCall:
      properties: {}
      type: object
    RequiredCollateral:
      properties:
        amount:
          description: The amount of the collateral required
          type: string
        amountInUsd:
          description: The value of the collateral denominated in US Dollars
          type: string
        currency:
          description: Currency code of the asset being used for collateral
          type: string
        mainCurrency:
          description: Currency code of the network being used to transfer the collateral
          type: string
      required:
        - amount
        - currency
        - mainCurrency
      type: object
    CounterpartyType:
      enum:
        - standard
        - clearloop-exchange
        - agency-desk
      type: string
    CounterpartyExtra:
      properties:
        exchangeId:
          description: Counterparty exchange id
          type: string
      type: object
    CounterpartyTag:
      enum:
        - featured
      type: string
    LoanAllocationType:
      enum:
        - disburse
        - top-up
        - repay
        - rebalance
        - secure-collateral
        - release-collateral
        - disburse-externally
        - top-up-externally
        - repay-externally
      type: string
    LoanAllocationExtra:
      properties:
        acceptedAt:
          description: Timestamp in epoch milliseconds of the allocation acceptance
          type: string
        acceptedBy:
          description: The ID of the user that accepted the allocation
          type: string
        cancelledAt:
          description: Timestamp in epoch milliseconds of the allocation cancellation
          type: string
        cancelledBy:
          description: The ID of the user that cancelled the allocation
          type: string
        confirmedAt:
          description: >-
            Timestamp in epoch milliseconds of the allocation confirmation. Only
            applicable for off-platform loans
          type: string
        confirmedBy:
          description: >-
            The ID of the user that confirmed the allocation. Only applicable
            for off-platform loans
          type: string
        effectiveDate:
          description: >-
            Timestamp in epoch milliseconds of the effective date of external
            action. Only applicable for off-platform loans
          type: string
      type: object
    LoanAllocationStatus:
      enum:
        - new
        - awaiting-acceptance
        - accepted
        - cancelled
        - order-created
        - awaiting-confirmation
        - confirmed
        - awaiting-funds
        - awaiting-signature
        - completed
        - failed
      type: string
    LoanModificationExtra:
      properties:
        acceptedAt:
          description: Timestamp in epoch milliseconds of the modification acceptance
          type: string
        acceptedBy:
          description: The ID of the user that accepted the modification
          type: string
        cancelledAt:
          description: Timestamp in epoch milliseconds of the modification cancellation
          type: string
        cancelledBy:
          description: The ID of the user that cancelled the modification
          type: string
        currentInterestRate:
          description: The current interest rate of the loan in basis points (BPS)
          type: string
        currentMaturityDate:
          description: The current maturity date as timestamp in epoch milliseconds
          type: string
        newInterestRate:
          description: The new interest rate for the loan in basis points (BPS)
          type: string
        newMaturityDate:
          description: The new maturity date as timestamp in epoch milliseconds
          type: string
      type: object
    LoanModificationType:
      enum:
        - rerate
        - extend-term
      type: string
    LoanModificationStatus:
      enum:
        - awaiting-acceptance
        - accepted
        - cancelled
      type: string

````