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

# Step an action

> Return the stored action for a multi-step flow once its previous step is confirmed.

No current Borrow action is multi-step. Every integration returns `hasNextStep: false` and `totalSteps: 1`, so today this route responds `400` `Action <id> has no pending next step` for every action. You do not need it to complete any action.

The route is part of the contract for future multi-step flows. When `hasNextStep` is `true` it returns the stored action; it does not build transactions itself. Check `hasNextStep` on every action response rather than assuming.


## OpenAPI

````yaml openapi-borrow.json POST /v1/actions/{id}/step
openapi: 3.0.0
info:
  title: 'Yield API: Borrow'
  description: API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://borrow.yield.xyz
    description: Production
security: []
tags:
  - name: Discovery
    description: Browse and discover lending markets, integrations, and supported networks
  - name: Positions
    description: User-specific supply and borrow positions
  - name: Actions
    description: >-
      Execute actions (supply, borrow, repay, withdraw) and manage multi-step
      flows
  - name: Transactions
    description: Submit signed transactions and track status
externalDocs:
  description: For more information
  url: https://docs.yield.xyz
paths:
  /v1/actions/{id}/step:
    post:
      tags:
        - Actions
        - Actions
      summary: Get next step transaction(s)
      description: >-
        For async multi-step actions (e.g., cross-chain bridges, delayed
        withdrawals), retrieve the next transaction(s) after the previous step
        has been confirmed on-chain. Call this when hasNextStep is true on the
        action response.
      operationId: ActionsController_step_v1
      parameters:
        - name: id
          required: true
          in: path
          description: Action UUID
          schema:
            example: 550e8400-e29b-41d4-a716-446655440000
            type: string
      responses:
        '200':
          description: Updated action with next transaction(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionDto'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invalid API key
                  error:
                    type: string
                    example: Unauthorized
                  statusCode:
                    type: number
                    example: 401
        '404':
          description: Action not found
        '429':
          description: Rate limit exceeded
          headers:
            x-ratelimit-limit:
              description: Request limit per window
              schema:
                type: string
            x-ratelimit-remaining:
              description: Remaining requests (will be 0)
              schema:
                type: string
            x-ratelimit-reset:
              description: Unix timestamp when window resets
              schema:
                type: string
            retry-after:
              description: Seconds to wait before retrying
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Rate limit exceeded
                  error:
                    type: string
                    example: Too Many Requests
                  statusCode:
                    type: number
                    example: 429
                  retryAfter:
                    type: number
                    example: 30
      security:
        - ApiKey: []
components:
  schemas:
    ActionDto:
      type: object
      properties:
        id:
          type: string
          description: Unique action identifier (UUID)
          example: 550e8400-e29b-41d4-a716-446655440000
        integrationId:
          type: string
          description: Integration identifier
          example: aave-borrow
        action:
          type: string
          description: Action type executed
          enum:
            - supply
            - borrow
            - repay
            - withdraw
            - enableCollateral
            - disableCollateral
            - supplyAndBorrow
          example: supply
        address:
          type: string
          description: User wallet address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fB28'
        status:
          type: string
          description: Current action status
          enum:
            - CANCELED
            - CREATED
            - WAITING_FOR_NEXT
            - PROCESSING
            - FAILED
            - SUCCESS
            - STALE
          example: CREATED
        transactions:
          description: Transactions to sign (current step only)
          type: array
          items:
            $ref: '#/components/schemas/TransactionDto'
        hasNextStep:
          type: boolean
          description: >-
            Whether there are more transactions to sign after the current step
            completes. When true, call POST /actions/:id/step after confirming
            to get the next transaction(s). Used for async multi-step flows such
            as cross-chain bridges or delayed withdrawals.
          example: false
        currentStep:
          type: number
          description: Current step number (1-indexed)
          example: 1
        totalSteps:
          type: number
          description: >-
            Total number of steps in this action. Most actions are single-step.
            Multi-step actions occur when an async operation (e.g., bridge
            confirmation) must complete before the next transaction can be
            constructed.
          example: 1
        rawArguments:
          description: Raw arguments as submitted
          allOf:
            - $ref: '#/components/schemas/ArgumentsDto'
        metadata:
          description: >-
            Action metadata with predicted position impact (health factor, LTV,
            USD totals)
          allOf:
            - $ref: '#/components/schemas/ActionMetadataDto'
        createdAt:
          format: date-time
          type: string
          description: When the action was created
      required:
        - id
        - integrationId
        - action
        - address
        - status
        - transactions
        - hasNextStep
        - currentStep
        - totalSteps
        - createdAt
    TransactionDto:
      type: object
      properties:
        id:
          type: string
          description: Transaction ID (UUID)
          example: 550e8400-e29b-41d4-a716-446655440000
        network:
          type: string
          description: Network identifier
          enum:
            - ethereum
            - ethereum-goerli
            - ethereum-holesky
            - ethereum-sepolia
            - ethereum-hoodi
            - arbitrum
            - base
            - base-sepolia
            - gnosis
            - optimism
            - polygon
            - polygon-amoy
            - starknet
            - zksync
            - linea
            - unichain
            - plume
            - monad-testnet
            - monad
            - robinhood
            - robinhood-testnet
            - arc-testnet
            - arc
            - avalanche-c
            - avalanche-c-atomic
            - avalanche-p
            - binance
            - celo
            - fantom
            - harmony
            - moonriver
            - okc
            - viction
            - core
            - sonic
            - plasma
            - katana
            - hyperevm
            - tempo
            - pharos
            - agoric
            - akash
            - axelar
            - band-protocol
            - bitsong
            - canto
            - chihuahua
            - comdex
            - coreum
            - cosmos
            - crescent
            - cronos
            - cudos
            - desmos
            - dydx
            - evmos
            - fetch-ai
            - gravity-bridge
            - injective
            - irisnet
            - juno
            - kava
            - ki-network
            - mars-protocol
            - nym
            - okex-chain
            - onomy
            - osmosis
            - persistence
            - quicksilver
            - regen
            - secret
            - sentinel
            - sommelier
            - stafi
            - stargaze
            - stride
            - teritori
            - tgrade
            - umee
            - sei
            - mantra
            - celestia
            - saga
            - zetachain
            - dymension
            - humansai
            - neutron
            - polkadot
            - kusama
            - westend
            - bittensor
            - aptos
            - binancebeacon
            - cardano
            - near
            - solana
            - solana-devnet
            - stellar
            - stellar-testnet
            - sui
            - tezos
            - tron
            - ton
            - ton-testnet
            - hyperliquid
          example: ethereum
        chainId:
          type: string
          description: Chain ID
          example: '1'
        type:
          type: string
          description: Transaction type
          enum:
            - APPROVAL
            - AUTHORIZE
            - DEAUTHORIZE
            - SUPPLY
            - BORROW
            - REPAY
            - WITHDRAW
            - ENABLE_COLLATERAL
            - DISABLE_COLLATERAL
            - BUNDLE
            - WRAP
          example: SUPPLY
        status:
          type: string
          description: Current transaction status
          enum:
            - NOT_FOUND
            - CREATED
            - BLOCKED
            - WAITING_FOR_SIGNATURE
            - SIGNED
            - BROADCASTED
            - PENDING
            - CONFIRMED
            - FAILED
            - SKIPPED
          example: CREATED
        address:
          type: string
          description: User address
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f8fB28'
        signingFormat:
          type: string
          description: Signing format required
          enum:
            - EVM_TRANSACTION
            - EIP712_TYPED_DATA
            - SOLANA_TRANSACTION
            - COSMOS_TRANSACTION
          example: EVM_TRANSACTION
        signablePayload:
          description: >-
            Unsigned transaction payload to sign. For EVM transactions, this is
            a JSON string containing from, to, data, gasLimit, and value fields.
          oneOf:
            - type: string
            - type: object
          example: >-
            {"from":"0x6877BB79...","gasLimit":"350000","to":"0xA238Dd80...","data":"0x617ba037..."}
      required:
        - id
        - network
        - chainId
        - type
        - status
        - address
    ArgumentsDto:
      type: object
      properties:
        amount:
          type: string
          description: >-
            Amount in human-readable units (e.g. "1.5" for 1.5 USDC). Provide
            either amount or amountRaw.
          example: '1.5'
        amountRaw:
          type: string
          description: >-
            Amount in raw token units (e.g. "1500000" for 1.5 USDC with 6
            decimals). Provide either amount or amountRaw.
          example: '1500000'
        repayAll:
          type: boolean
          description: >-
            Repay the full outstanding debt using protocol-specific full-repay
            semantics. Only valid for repay actions. When true, omit amount and
            amountRaw.
          example: true
        tokenAddress:
          type: string
          description: Token address to supply/borrow/repay/withdraw
          example: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
        collateralTokenAddress:
          type: string
          description: >-
            Collateral token address. Required when providing collateralAmount
            for pool-based protocols (Aave). Inferred from marketId for
            isolated-market protocols (Morpho Blue).
          example: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
        collateralAmount:
          type: string
          description: >-
            Optional collateral amount in human-readable units (e.g. "0.5" for
            0.5 ETH). For borrow: collateral to deposit before borrowing. For
            repay: collateral to withdraw after repaying. Provide either
            collateralAmount or collateralAmountRaw.
          example: '0.5'
        collateralAmountRaw:
          type: string
          description: >-
            Optional collateral amount in raw token units (e.g. "50000000" for
            0.5 ETH with 8 decimals). Provide either collateralAmount or
            collateralAmountRaw.
          example: '50000000'
        borrowAmount:
          type: string
          description: >-
            Supply action only. Desired borrow amount in human-readable units of
            the market loan token. Provide together with targetLtv to have the
            API derive the required collateral (post-fee). Mutually exclusive
            with amount/amountRaw.
          example: '100'
        targetLtv:
          type: string
          description: >-
            Supply action only. Target loan-to-value as a decimal (e.g. "0.1" =
            10%). Provide together with borrowAmount. Must not exceed the market
            max LTV.
          example: '0.1'
        marketId:
          type: string
          description: >-
            Market ID as returned by GET /v1/markets. Identifies the specific
            lending market for the action.
          example: morpho-blue-borrow-base-cbbtc-usdc-86
      required:
        - marketId
    ActionMetadataDto:
      type: object
      properties:
        currentHealthFactor:
          type: string
          description: Current health factor. Null when there is no debt.
          example: '1.85'
          nullable: true
        predictedHealthFactor:
          type: string
          description: >-
            Predicted health factor after the action. Null when predicted debt
            is zero.
          example: '1.42'
          nullable: true
        currentLtv:
          type: string
          description: Current loan-to-value ratio as decimal
          example: '0.55'
        predictedLtv:
          type: string
          description: Predicted loan-to-value ratio after the action
          example: '0.72'
        liquidationThreshold:
          type: string
          description: Liquidation threshold as decimal
          example: '0.85'
        predictedTotalSupplyUsd:
          type: string
          description: Predicted total supply in USD after the action
          example: '10000.00'
        predictedTotalDebtUsd:
          type: string
          description: Predicted total debt in USD after the action
          example: '7200.00'
        originationFeeBps:
          type: number
          description: Origination fee in basis points when a borrow wrapper is applied
          example: 100
        originationFeeAmount:
          type: string
          description: >-
            Origination fee amount in borrowed-token units when a borrow wrapper
            is applied
          example: '1.00'
        effectivePrincipalAmount:
          type: string
          description: >-
            Actual principal recorded onchain in borrowed-token units when a
            borrow wrapper is applied
          example: '101.00'
        feeAmount:
          type: string
          description: >-
            Fee charged on supplied collateral, in human-readable units of the
            supplied token. Present on supply actions; may also be present on
            borrow actions that bundle a collateral leg, depending on the
            integration. "0" when no supply fee wrapper is configured or its
            rate is 0.
          example: '0.0005'
        feeBps:
          type: number
          description: >-
            Fee rate in basis points on supplied collateral. Present on supply
            actions; may also be present on borrow actions that bundle a
            collateral leg, depending on the integration. 0 when no supply fee
            wrapper is configured or its rate is 0.
          example: 50
        effectiveCollateralAmount:
          type: string
          description: >-
            Collateral derived from borrowAmount + targetLtv, in human-readable
            units of the collateral token (post-fee). Present only when a supply
            action is called in borrow-derived mode.
          example: '0.0125'
      required:
        - currentHealthFactor
        - predictedHealthFactor
        - currentLtv
        - predictedLtv
        - liquidationThreshold
        - predictedTotalSupplyUsd
        - predictedTotalDebtUsd
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.