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

# Portfolio Withdraw as ETH

> Convert and withdraw specified assets as ETH

Converts and withdraws specified assets as ETH.

<ParamField path="portfolioId" type="string" required>
  The unique identifier of the portfolio
</ParamField>

<ParamField body="strategyInstanceId" type="string" required>
  The ID of the portfolio (same as portfolioId in path)
</ParamField>

<ParamField body="assets" type="object[]" required>
  Array of assets to withdraw
</ParamField>

<ParamField body="assets[].assetId" type="string" required>
  The asset ID in format "0xContractAddress:chainId"
</ParamField>

<ParamField body="assets[].amount" type="string" required>
  The amount to withdraw in raw units (no decimals), or "max" to withdraw all
</ParamField>

<ParamField body="assets[].decimals" type="number" required>
  The number of decimals for the token
</ParamField>

<ParamField header="X-API-KEY" type="string" required>
  Your API key for authentication
</ParamField>

<ParamField header="Content-Type" type="string" default="application/json">
  The format of the request body
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.glider.fi/v1/portfolio/port_abc123/withdraw-as-eth' \
    --header 'Content-Type: application/json' \
    --header 'X-API-KEY: your_api_key_here' \
    --data '{
      "strategyInstanceId": "port_abc123",
      "assets": [
        {
          "assetId": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453",
          "amount": "500000",
          "decimals": 6
        },
        {
          "assetId": "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb:8453",
          "amount": "500000000000000000",
          "decimals": 18
        }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const portfolioId = "port_abc123";
  const withdrawAsEthResponse = await fetch(
    `https://api.glider.fi/v1/portfolio/${portfolioId}/withdraw-as-eth`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "X-API-KEY": "your_api_key_here",
      },
      body: JSON.stringify({
        strategyInstanceId: portfolioId,
        assets: [
          {
            assetId: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913:8453", // USDC on Base
            amount: "500000", // 0.5 USDC (USDC has 6 decimals)
            decimals: 6,
          },
          {
            assetId: "0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb:8453", // DAI on Base
            amount: "500000000000000000", // 0.5 DAI (DAI has 18 decimals)
            decimals: 18,
          },
        ],
      }),
    }
  );

  const withdrawAsEthResult = await withdrawAsEthResponse.json();
  console.log(
    `Withdraw-as-ETH workflow ID: ${withdrawAsEthResult.data.workflowId}`
  );
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "workflowId": "swap-withdraw_abc123",
      "runId": "run_def456",
      "message": "Withdraw-as-ETH request submitted successfully",
      "status": "submitted"
    },
    "correlationId": "corr_abc123",
    "requestId": "req_xyz789",
    "timestamp": "2023-05-21T13:45:12.345Z"
  }
  ```
</ResponseExample>
