Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.magic.link/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

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

Sign Data

Sign data with the authenticated user’s Magic wallet.
cURL
curl -X POST 'https://uoa-server.magic.xyz/wallet/sign' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer USER_JWT_TOKEN' \
  -H 'X-MAGIC-SECRET-KEY: YOUR_MAGIC_SECRET_KEY' \
  -d '{
    "message": "Hello, world!"
  }'
Response:
{
  "success": true,
  "signature": "0xabcdef1234567890...",
  "raw_data_hash": "0x1234567890abcdef...",
  "app_user_id": "user-123"
}

Request Parameters

raw_data_hash
string
A 0x-prefixed hex hash to sign directly. Provide either this or message.
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

success
boolean
Whether the signing operation completed successfully.
signature
string
The hex-encoded signature.
raw_data_hash
string
The hash that was signed.
app_user_id
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
curl -X POST 'https://uoa-server.magic.xyz/withdraw' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer USER_JWT_TOKEN' \
  -H 'X-MAGIC-SECRET-KEY: YOUR_MAGIC_SECRET_KEY' \
  -d '{
    "to_address": "0xRecipientAddress...",
    "amount": "50",
    "token": "USDC",
    "chain": "ARB"
  }'
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.
{
  "success": true,
  "tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
  "from_address": "0x1234567890abcdef1234567890abcdef12345678",
  "to_address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
  "amount": "50",
  "token": "USDC",
  "chain": "ARB",
  "message": "Successfully sent 50 USDC on ARB"
}

Request Parameters

to_address
string
required
The recipient wallet address. EVM destinations are normalized to checksummed hex; Solana addresses are validated as base58.
amount
string
required
The amount to withdraw as a decimal string.
token
string
default:"USDC"
The token to withdraw. Values: ETH, USDC, USDC.E, POL, SOL
chain
string
default:"ARB"
The chain to withdraw on. Values: ETH, ARB, POL, SOL, INK
gas_sponsored
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

ChainSupported Tokens
ETHETH, USDC
ARBETH, USDC, USDC.E
POLPOL, USDC, USDC.E
SOLSOL, USDC
INKETH, USDC

Response Fields

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