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

# Get Flex Investment History

> Retrieve the history of Flex investment operations including deposits and withdrawals via the V4 API.

<Note>
  These endpoints are available only for B2B partner services. Fill the form at [https://whitebit.com/institutional-services/b2b](https://whitebit.com/institutional-services/b2b) to request access.
</Note>


## OpenAPI

````yaml /openapi/private/main_api_v4.yaml POST /api/v4/main-account/smart-flex/investments/history
openapi: 3.0.3
info:
  title: WhiteBIT Private HTTP API V4
  description: |
    WhiteBIT Private HTTP API V4 for Main balance changes.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.
  version: 4.0.0
  contact:
    name: WhiteBIT Support
    email: support@whitebit.com
    url: https://whitebit.com
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main account balance and operations
  - name: Deposit
    description: Cryptocurrency and fiat deposit operations
  - name: Withdraw
    description: Cryptocurrency and fiat withdrawal operations
  - name: Transfer
    description: Balance transfer operations
  - name: Codes
    description: WhiteBIT codes operations
  - name: Crypto Lending - Fixed
    description: Fixed crypto lending plans
  - name: Crypto Lending - Flex
    description: Flexible crypto lending plans
  - name: Fees
    description: Fee information
  - name: Sub-Account
    description: Sub-account management
  - name: Sub-Account API Keys
    description: Sub-account API key management
  - name: Mining Pool
    description: Mining pool operations
  - name: Credit Line
    description: Credit line information
  - name: JWT
    description: JWT token management
paths:
  /api/v4/main-account/smart-flex/investments/history:
    post:
      tags:
        - Crypto Lending - Flex
      summary: Get Flex Investment History
      description: |
        Retrieve complete investment operations history with advanced filtering.

        **Available Action Types:**
        - 1: INVEST - Investment creation
        - 2: REINVEST - Automatic reinvestment
        - 3: WITHDRAW_FROM_INVESTMENT - Partial withdrawal
        - 4: DAILY_EARNING - Daily earnings
        - 5: CLOSE_INVESTMENT - Investment closure
        - 6: OPEN_INVESTMENT - Investment opening

        <Warning>
        Rate limit: 1000 requests/10 sec.
        </Warning>

        <Note>
        The API does not cache the response.
        </Note>
      operationId: getFlexInvestmentHistory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - request
                - nonce
              properties:
                limit:
                  type: integer
                  default: 50
                  description: Pagination limit.
                  example: 50
                offset:
                  type: integer
                  default: 0
                  description: Pagination offset.
                  example: 0
                plan:
                  type: string
                  description: Filter by plan ID (UUID).
                  example: 8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f
                investment:
                  type: string
                  description: Filter by investment ID.
                  example: inv_7e2d9c3b-1a4b-4c2d-9e5f-6a7b8c9d0e1f
                transaction:
                  type: string
                  description: Filter by transaction ID.
                  example: tx_9f3e0d4c-2b5c-4d3e-8f6g-7a8b9c0d1e2f
                dateFrom:
                  type: integer
                  description: Filter from date (timestamp).
                  example: 1640995200
                dateTo:
                  type: integer
                  description: Filter to date (timestamp).
                  example: 1641081600
                actionTypes:
                  type: array
                  items:
                    type: integer
                  description: Array of operation type IDs. See table below.
                  example:
                    - 1
                    - 2
                    - 4
                request:
                  type: string
                  description: Request signature
                  example: '{{request}}'
                nonce:
                  type: integer
                  description: Unique request identifier
                  example: 1594297865000
            example:
              limit: 50
              offset: 0
              plan: 8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f
              investment: inv_123
              transaction: tx_456
              dateFrom: 1640995200
              dateTo: 1641081600
              actionTypes:
                - 1
                - 2
                - 4
              request: '{{request}}'
              nonce: 1594297865000
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/FlexInvestmentHistory'
                  limit:
                    type: integer
                  offset:
                    type: integer
              example:
                data:
                  - createdAt: 1640995200
                    planId: 8f2e9d3c-1a4b-4c2d-9e5f-6a7b8c9d0e1f
                    investmentId: inv_7e2d9c3b-1a4b-4c2d-9e5f-6a7b8c9d0e1f
                    currency: USDT
                    amount: '15.75'
                    transaction_id: tx_9f3e0d4c-2b5c-4d3e-8f6g-7a8b9c0d1e2f
                    actionType: 1
                limit: 50
                offset: 0
        '400':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 0
                message: Validation failed
                errors:
                  plan:
                    - The selected plan is invalid.
                  investment:
                    - The selected investment is invalid.
                  transaction:
                    - The selected transaction is invalid.
                  dateFrom:
                    - The date from is invalid.
                  dateTo:
                    - The date to is invalid.
                  actionTypes:
                    - The action types must be an array.
                  actionTypes.0:
                    - The selected action type is invalid.
components:
  schemas:
    FlexInvestmentHistory:
      type: object
      properties:
        createdAt:
          type: integer
          description: Transaction creation timestamp
          example: 1588345560
        planId:
          type: string
          description: Flex plan identifier
          example: '12'
        investmentId:
          type: string
          description: Flex investment identifier
          example: '2765'
        currency:
          type: string
          description: Transaction currency
          example: USDT
        amount:
          type: string
          description: Transaction amount
          example: '100'
        transaction_id:
          type: string
          description: Transaction identifier
          example: tx_123456
        actionType:
          type: integer
          description: >-
            Action type: 1-INVEST, 2-REINVEST, 3-WITHDRAW_FROM_INVESTMENT,
            4-DAILY_EARNING, 5-CLOSE_INVESTMENT, 6-OPEN_INVESTMENT
          example: 1
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: The public WhiteBIT API key.
    PayloadAuth:
      type: apiKey
      in: header
      name: X-TXC-PAYLOAD
      description: Base64-encoded JSON request body.
    SignatureAuth:
      type: apiKey
      in: header
      name: X-TXC-SIGNATURE
      description: >-
        HMAC-SHA512 signature of the payload, hex-encoded. Computed as
        hex(HMAC-SHA512(payload, api_secret)).

````