This document contains all Admin APIs in the PocketBase + ThirdWeb Engine system. These APIs require Superuser authentication and are designed for administrative operations.
http://localhost:8090
The system uses API version 1 (/api/v1/) for all endpoints.
All Admin APIs require Superuser Bearer Token authentication.
Endpoint: GET /api/v1/admin/health
Authentication: β
Required (Superuser Token)
Description: Check system status for admin
{
"status": "healthy",
"timestamp": "2024-01-01T00:00:00.000Z",
"auth": {
"id": "admin-id",
"email": "admin@example.com",
"collectionName": "_superusers"
},
"database": "connected",
"version": "1.0.0"
}cURL:
curl -X GET http://localhost:8090/api/v1/admin/health \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN_HERE"Endpoint: POST /api/v1/admin/erc20/transfer
Authentication: β
Required (Superuser Token)
Description: Admin transfer ERC20 tokens
{
"to": "0x...",
"amount": "1000000000000000000",
"contractAddress": "0x...",
"tokenName": "USDT"
}{
"success": true,
"queueId": "string",
"message": "Admin transfer initiated successfully"
}cURL:
curl -X POST http://localhost:8090/api/v1/admin/erc20/transfer \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN_HERE" \
-d '{
"to": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
"amount": "1000000000000000000",
"contractAddress": "0x57e93049080C5ebeCcf97be7F2CFC619B3A76B04",
"tokenName": "USDT"
}'Endpoint: POST /api/v1/admin/erc20/pay
Authentication: β
Required (Superuser Token)
Description: Admin payment with ERC20 tokens using EIP-712 signature
{
"to": "0x...",
"amount": "1000000000000000000",
"contractAddress": "0x...",
"tokenName": "USDT",
"userWalletAddress": "0x..."
}{
"success": true,
"queueId": "string",
"message": "Admin payment completed successfully"
}cURL:
curl -X POST http://localhost:8090/api/v1/admin/erc20/pay \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN_HERE" \
-d '{
"to": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
"amount": "1000000000000000000",
"contractAddress": "0x57e93049080C5ebeCcf97be7F2CFC619B3A76B04",
"tokenName": "USDT",
"userWalletAddress": "0x1234567890123456789012345678901234567890"
}'Endpoint: POST /api/v1/admin/erc20/redeem
Authentication: β
Required (Superuser Token)
Description: Admin redeem ERC20 tokens using EIP-712 signature
{
"to": "0x...",
"amount": "1000000000000000000",
"contractAddress": "0x...",
"tokenName": "USDT",
"userWalletAddress": "0x..."
}{
"success": true,
"queueId": "string",
"message": "Admin redeem completed successfully"
}cURL:
curl -X POST http://localhost:8090/api/v1/admin/erc20/redeem \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN_HERE" \
-d '{
"to": "0x742d35Cc6634C0532925a3b8D4C9db96590c6C87",
"amount": "1000000000000000000",
"contractAddress": "0x57e93049080C5ebeCcf97be7F2CFC619B3A76B04",
"tokenName": "USDT",
"userWalletAddress": "0x1234567890123456789012345678901234567890"
}'Endpoint: POST /api/v1/admin/createwallet
Authentication: β
Required (Superuser Token)
Description: Create new wallet for admin purposes
{}{
"success": true,
"walletAddress": "0x...",
"message": "Wallet created successfully"
}cURL:
curl -X POST http://localhost:8090/api/v1/admin/createwallet \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ADMIN_TOKEN_HERE" \
-d '{}'All Admin APIs return consistent error responses:
{
"error": "Error message",
"code": "ERROR_CODE",
"details": {}
}SUPERUSER_REQUIRED: Superuser access requiredINVALID_PARAMS: Invalid parametersINSUFFICIENT_BALANCE: Insufficient token balanceTRANSACTION_FAILED: Blockchain transaction failed
- Admin APIs have higher rate limits compared to user APIs
- Superuser operations have additional validation layers
- All Admin APIs require Superuser authentication
- Additional validation for sensitive operations
- Private keys and sensitive data are never exposed in responses
- All operations are logged for audit purposes
- All token amounts should be provided in wei (smallest unit)
- Use appropriate conversion functions for different token decimals
- Example: 1 USDT = 1000000 (6 decimals)
- Use Queue Status API (
/api/v1/queue) to track transaction progress - Admin transactions may take time to confirm on blockchain
- Implement polling mechanism for real-time updates
- Always validate input parameters before making API calls
- Use proper error handling for all API responses
- Monitor transaction status using Queue Status API
- Keep admin credentials secure and rotate regularly
- Log all admin operations for audit trails
- Test on testnet before mainnet operations