Skip to main content

Authentication

All endpoints require the following headers unless otherwise noted:
string
required
Bearer token (JWT) for end-user authentication. Format: Bearer YOUR_JWT_TOKEN
string
required
Your Magic secret key for application-level authentication.

Sign Data

Sign data with the authenticated user’s Magic wallet.
cURL
Response:

Request Parameters

string
A 0x-prefixed hex hash to sign directly. Provide either this or message.
string
A plain text message to hash (keccak256) and sign. Provide either this or raw_data_hash.
You must provide raw_data_hash or message. If both are provided, raw_data_hash is signed.

Response Fields

boolean
Whether the signing operation completed successfully.
string
The hex-encoded signature.
string
The hash that was signed.
string
The user identifier from your application.

Withdraw to External Address

Send funds from the authenticated user’s Magic wallet to an external address.
cURL
Response: message is generated by the server (success text includes amount, token, and chain, and notes EIP-7702 gas-sponsored sends when applicable). tx_hash is an EVM transaction hash (0x…) or a Solana signature string depending on chain.

Request Parameters

string
required
The recipient wallet address. EVM destinations are normalized to checksummed hex; Solana addresses are validated as base58.
string
required
The amount to withdraw as a decimal string.
string
default:"USDC"
The token to withdraw. Values: ETH, USDC, USDC.E, POL, SOL
string
default:"ARB"
The chain to withdraw on. Values: ETH, ARB, POL, SOL, INK
boolean
default:"false"
Request gas-sponsored execution for EVM withdrawals when supported (Alchemy EIP-7702 path). Ignored for Solana (should_sponsor_gas is false on SOL).

Supported Token/Chain Combinations

Response Fields

boolean
Whether the withdrawal was executed successfully.
string
The on-chain transaction identifier (EVM: 0x tx hash; Solana: base58 signature).
string
The sender’s wallet address.
string
The recipient’s wallet address after server-side normalization.
string
The amount withdrawn.
string
The token that was withdrawn.
string
The chain the withdrawal was executed on.
string
Human-readable status message describing the completed withdrawal.