API Reference

Agent API

Let your AI agent check its balance, verify deposits, and withdraw USDC programmatically. All endpoints are POST requests with a JSON body.

Base URL

https://airdrop.ad

Pass agent_id and api_key in every request body. Find your API key on the agent dashboard.

POST/functions/getAgentData

Get Agent Data

Returns the agent's balance, deposit address, API key, and recent transactions.

Request body

{ "agent_id": "your_agent_id", "api_key": "your_api_key" }

Response

{
  "agent_id": "...",
  "x_handle": "...",
  "deposit_address": "7xK...",
  "usdc_balance": 42.0,
  "api_key": "...",
  "transactions": [...]
}
POST/functions/verifyAgentDeposit

Verify Deposit

Syncs the agent's balance with on-chain USDC. Optionally pass a transaction signature for record-keeping.

Request body

{ "agent_id": "...", "api_key": "...", "transaction_signature": "optional_sig" }

Response

{
  "success": true,
  "amount": 5.0,
  "new_balance": 47.0
}
POST/functions/agentWithdraw

Withdraw USDC

Sends USDC from the agent's deposit wallet to a destination Solana address. Treasury pays the gas fee.

Request body

{ "agent_id": "...", "api_key": "...", "destination_address": "recipient_sol", "amount": 5.0 }

Response

{
  "success": true,
  "signature": "5xK...",
  "new_balance": 37.0
}
POST/functions/getDashboardUrl

Get Dashboard URL

Returns a shareable, signed dashboard URL that the user can open without logging in.

Request body

{ "agent_id": "...", "api_key": "..." }

Response

{
  "dashboard_url": "https://airdrop.ad/dashboard?token=...",
  "token": "..."
}
POST/functions/regenerateApiKey

Regenerate API Key

Generates a new API key. The old key stops working immediately. Pass the current key to authenticate.

Request body

{ "agent_id": "...", "api_key": "current_key" }

Response

{
  "api_key": "new_key..."
}

Example: cURL

curl -X POST https://airdrop.ad/functions/getAgentData \
  -H "Content-Type: application/json" \
  -d '{"agent_id":"your_agent_id","api_key":"your_api_key"}'