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

# Request to unstake a wallet

> Creates an execution request to unstake delegated or staked funds in a wallet



## OpenAPI

````yaml POST /v1/portfolios/{portfolio_id}/wallets/{wallet_id}/staking/unstake
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/portfolios/{portfolio_id}/wallets/{wallet_id}/staking/unstake:
    post:
      tags:
        - Staking
      summary: Request to unstake a wallet
      description: >-
        Creates an execution request to unstake delegated or staked funds in a
        wallet
      operationId: PrimeRESTAPI_StakingUnstake
      parameters:
        - name: portfolio_id
          in: path
          description: The portfolio ID
          required: true
          schema:
            type: string
        - name: wallet_id
          in: path
          description: The wallet ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              required:
                - idempotency_key
              type: object
              properties:
                idempotency_key:
                  type: string
                  description: >-
                    The client generated idempotency key for requested
                    execution. Subsequent requests using the same key will fail
                inputs:
                  $ref: >-
                    #/components/schemas/coinbase.public_rest_api.WalletUnstakeInputs
              description: >-
                StakingUnstakeRequest represents a request to initiate an
                unstaking operation.
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.StakingUnstakeResponse
components:
  schemas:
    coinbase.public_rest_api.WalletUnstakeInputs:
      type: object
      properties:
        amount:
          type: string
          description: >-
            Optional amount to unstake (ETH only). If omitted, the wallet will
            unstake the maximum amount available
        validator_allocations:
          type: array
          description: >-
            (Alpha) Optional validator-level allocations for ETH V2 unstaking.
            Allows specifying which validators to unstake from and how much.
            This feature is in alpha. Please reach out to your Coinbase Prime
            account manager for more information
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorAllocation'
      description: >-
        WalletUnstakeInputs contains the custom inputs for unstaking operations
        on a wallet.

        Requirements and supported fields vary by asset type.
    coinbase.public_rest_api.StakingUnstakeResponse:
      required:
        - activity_id
        - transaction_id
        - wallet_id
      type: object
      properties:
        wallet_id:
          type: string
          description: The wallet ID
        transaction_id:
          type: string
          description: >-
            ID of the newly created transaction, can be used to fetch details of
            the current state of execution
        activity_id:
          type: string
          description: The ID for the activity generated for this request
      description: >-
        StakingUnstakeResponse contains the response data from initiating an
        unstaking operation.
    coinbase.public_rest_api.ValidatorAllocation:
      required:
        - amount
        - validator_address
      type: object
      properties:
        validator_address:
          type: string
          description: The validator address for performing staking operations
        amount:
          type: string
          description: Amount for performing staking operations with this validator
      description: >-
        ValidatorAllocation specifies the validator and amount for staking or
        unstaking.

        Used for granular ETH V2 validator-level staking or unstaking
        operations.

````