---
title: "Withdraw SPL Tokens"
method: POST
path: "/v1/spl/withdraw"
---

# Withdraw SPL Tokens

`POST /v1/spl/withdraw`

Wraps the SDK `withdrawSpl(...)` flow. The API generates `shuttleId` server-side.

## Request body

- object
  - `owner` string, required
  - `cluster` union — Optional. Use `mainnet` for BASE_RPC_URL and EPHEMERAL_RPC_URL, `devnet` for BASE_DEVNET_RPC_URL and EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC URL to override the base RPC while keeping the configured ephemeral RPC.
    - 'mainnet' | 'devnet'
    - string
  - `mint` string, required — SPL mint on Solana.
  - `amount` integer, required — Base-unit amount as an integer JSON value with minimum 1.
  - `validator` string — Optional. Defaults to the selected ephemeral RPC identity resolved via `getIdentity`.
  - `initIfMissing` boolean — Optional. Initialize the transfer queue if missing.
  - `initAtasIfMissing` boolean — Optional. Initialize associated token accounts if missing.
  - `escrowIndex` integer — Optional. Escrow index for the withdrawal.
  - `idempotent` boolean — Optional. When `true`, the API uses idempotent variants for any preparatory init instructions.

## Response `200`

Unsigned serialized transaction

- object
  - `kind` 'withdraw', required
  - `version` 'legacy' | 'v0', required
  - `transactionBase64` string, required
  - `sendTo` 'base' | 'ephemeral', required
  - `recentBlockhash` string, required
  - `lastValidBlockHeight` integer, required
  - `instructionCount` integer, required
  - `requiredSigners` string[], required
  - `validator` string

## Other responses

- `400` — Build error
- `422` — Validation error

---

[API](https://skmtc.dev/magicblock/apis/magicblock-router-api.md) · [All operations](https://skmtc.dev/magicblock/apis/magicblock-router-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/magicblock/magicblock-router-api/revisions/f024efa907c6/schema)
