POST
/
v1
/
portfolio
/
:portfolioId
/
withdraw
curl --request POST \
  --url 'https://api.glider.fi/v1/portfolio/port_abc123/withdraw' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "strategyInstanceId": "port_abc123",
    "assets": [
      {
        "assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
        "amount": "50000000000000000",
        "decimals": 18
      }
    ]
  }'
{
  "success": true,
  "data": {
    "withdrawId": "withdraw_abc123",
    "workflowId": "withdraw_abc123",
    "runId": "run_def456",
    "message": "Withdraw request submitted successfully",
    "status": "submitted"
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T13:45:12.345Z"
}
Initiates a withdrawal of specific assets from a portfolio.

Path Parameters

portfolioId
string
required
The unique identifier of the portfolio

Request Headers

X-API-KEY
string
required
Your API key
Content-Type
string
default:"application/json"
Application JSON content type (usually set automatically)

Request Body

strategyInstanceId
string
required
The ID of the portfolio (same as portfolioId in path)
assets
object[]
required
Array of assets to withdraw
assets[].assetId
string
required
The asset ID in format “0xContractAddress:chainId” or “0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:chainId” for native tokens
assets[].amount
string
required
The amount to withdraw in raw units (no decimals), or “max” to withdraw all
assets[].decimals
number
required
The number of decimals for the token
recipient
string
Optional address to receive the withdrawn assets (defaults to portfolio owner)
validateNonzeroBalance
boolean
default:"false"
If true, will validate that all specified assets have non-zero balances
curl --request POST \
  --url 'https://api.glider.fi/v1/portfolio/port_abc123/withdraw' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "strategyInstanceId": "port_abc123",
    "assets": [
      {
        "assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
        "amount": "50000000000000000",
        "decimals": 18
      }
    ]
  }'
{
  "success": true,
  "data": {
    "withdrawId": "withdraw_abc123",
    "workflowId": "withdraw_abc123",
    "runId": "run_def456",
    "message": "Withdraw request submitted successfully",
    "status": "submitted"
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T13:45:12.345Z"
}

Using Max Withdrawals

You can use "max" as the amount to withdraw the entire balance of an asset:
curl --request POST \
  --url 'https://api.glider.fi/v1/portfolio/port_abc123/withdraw' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: your_api_key_here' \
  --data '{
    "strategyInstanceId": "port_abc123",
    "assets": [
      {
        "assetId": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:8453",
        "amount": "max",
        "decimals": 18
      }
    ],
    "validateNonzeroBalance": true
  }'
{
  "success": true,
  "data": {
    "withdrawId": "withdraw_def456",
    "workflowId": "withdraw_def456",
    "runId": "run_ghi789",
    "message": "Withdraw request submitted successfully",
    "status": "submitted"
  },
  "correlationId": "corr_abc123",
  "requestId": "req_xyz789",
  "timestamp": "2023-05-21T13:45:12.345Z"
}