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

# Exit a yield position

> Builds transactions for exiting a yield position (unstaking, withdrawing,
or redeeming).

This is a proxy to the Yield.xyz `POST /actions/exit` endpoint. The
response is wrapped under `data.rawResponse` and `network` fields on
transactions are converted to CAIP-2 format. For Solana yields where a
gas sponsor is configured for the environment, `arguments.feePayerAddress`
is auto-populated. For the full upstream response schema see
[docs.yield.xyz](https://docs.yield.xyz/reference/actionscontroller_exityield).




## OpenAPI

````yaml /openapi/client-api.yaml post /clients/me/integrations/yield-xyz/actions/exit
openapi: 3.1.0
info:
  title: Portal Client API
  version: '3.0'
  description: >
    The Portal Client API provides endpoints for managing wallets, building
    transactions,

    and interacting with blockchain networks. All endpoints require
    authentication via a

    Client API Key or Client Session Token (CST) passed as a Bearer token.


    ## Base URL

    `https://api.portalhq.io/api/v3`


    ## Authentication

    Include your Client API Key or Client Session Token as a Bearer token in the

    `Authorization` header of every request.


    ## Chain ID Format

    Chain parameters use either friendly names (e.g. `ethereum`, `solana`) or
    CAIP-2 format

    (e.g. `eip155:1`, `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`). When using
    CAIP-2 format

    in URLs, ensure the colon is URI-encoded (`%3A`).
servers:
  - url: https://api.portalhq.io/api/v3
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Clients
    description: Core client management endpoints
  - name: Wallet
    description: >-
      Read wallet state — balances, NFTs, transaction history, capabilities, and
      transaction details
  - name: Transactions
    description: Build, broadcast, and evaluate blockchain transactions
  - name: Funding
    description: Fund wallets with testnet tokens
  - name: Wallet Shares
    description: Manage signing and backup share pairs
  - name: Delegations
    description: Manage token approvals, revocations, and delegated transfers
  - name: Session Keys
    description: Manage EIP-7702 session keys for smart accounts
  - name: 0x
    description: Token swap endpoints powered by the 0x protocol
  - name: Yield.xyz
    description: Yield opportunities and staking actions powered by Yield.xyz
  - name: Li.Fi
    description: Cross-chain swaps and bridging powered by Li.Fi
  - name: Blockaid
    description: Transaction and address security scanning powered by Blockaid
  - name: Hypernative
    description: >-
      Transaction, address, token, and NFT security scanning powered by
      Hypernative
  - name: Noah
    description: KYC onboarding, payins, and payouts powered by Noah
  - name: Meld
    description: Buy and sell crypto with fiat through aggregated providers powered by Meld
  - name: EIP-7702
    description: EIP-7702 account type detection and authorization management
  - name: Deprecated
    description: >-
      Legacy endpoints scheduled for removal. Use the newer equivalents listed
      in each endpoint's description.
paths:
  /clients/me/integrations/yield-xyz/actions/exit:
    post:
      tags:
        - Yield.xyz
      summary: Exit a yield position
      description: >
        Builds transactions for exiting a yield position (unstaking,
        withdrawing,

        or redeeming).


        This is a proxy to the Yield.xyz `POST /actions/exit` endpoint. The

        response is wrapped under `data.rawResponse` and `network` fields on

        transactions are converted to CAIP-2 format. For Solana yields where a

        gas sponsor is configured for the environment,
        `arguments.feePayerAddress`

        is auto-populated. For the full upstream response schema see

        [docs.yield.xyz](https://docs.yield.xyz/reference/actionscontroller_exityield).
      operationId: exitYieldPosition
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/YieldExitRequest'
      responses:
        '200':
          description: Exit transactions built successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldActionResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    YieldExitRequest:
      type: object
      required:
        - yieldId
        - address
      properties:
        yieldId:
          type: string
          description: The yield opportunity ID to exit.
        address:
          type: string
          description: Wallet address exiting the yield position.
        arguments:
          $ref: '#/components/schemas/YieldArguments'
    YieldActionResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            rawResponse:
              type: object
              properties:
                transactions:
                  type: array
                  items:
                    type: object
                    additionalProperties: true
                  description: Array of transactions to sign and submit.
                yieldId:
                  type: string
                  description: The yield opportunity ID.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong
    YieldArguments:
      type: object
      description: >-
        Optional yield-specific arguments. Which fields are supported depends on
        the yield opportunity's mechanics.
      properties:
        amount:
          type: string
          description: >-
            Amount in token units (not raw). Optional for some yields (e.g.
            claim-rewards).
        validatorAddress:
          type: string
          description: Target validator address.
        validatorAddresses:
          type: array
          items:
            type: string
          description: Multiple target validator addresses.
        providerId:
          type: string
          description: Provider identifier (e.g. for staking providers).
        duration:
          type: number
          description: Lock duration in seconds.
        inputToken:
          type: string
          description: Input token symbol or address.
        subnetId:
          type: number
          description: Subnet ID (Avalanche only).
        tronResource:
          type: string
          enum:
            - BANDWIDTH
            - ENERGY
          description: Tron resource type (Tron only).
        feeConfigurationId:
          type: string
          description: Fee configuration ID for the action.
        cosmosPubKey:
          type: string
          description: Cosmos public key (Cosmos chains only).
        tezosPubKey:
          type: string
          description: Tezos public key (Tezos only).
        cAddressBech:
          type: string
          description: Avalanche C-Chain Bech32 address.
        pAddressBech:
          type: string
          description: Avalanche P-Chain Bech32 address.
        executionMode:
          type: string
          enum:
            - individual
            - batched
          description: Whether to execute transactions individually or batched.
        ledgerWalletApiCompatible:
          type: boolean
          description: Whether the action must be Ledger Wallet API compatible.
        skipPrechecks:
          type: boolean
          description: Skip pre-execution checks.
        feePayerAddress:
          type: string
          description: >-
            Fee payer address. For Solana yields, this is auto-populated from
            the environment's gas sponsor when enabled.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Client API Key or Client Session Token (CST). Pass as a Bearer token in
        the

        Authorization header.

````