Webhooks
Webhooks allow your application to receive real-time notifications when specific events occur in the M.O.N.K.Y ecosystem. Instead of continuously polling our API, webhooks push data to your endpoints as events happen.Overview
M.O.N.K.Y webhooks are HTTP callbacks that we send to your specified endpoints when triggered events occur. This enables you to:- Get instant notifications about transaction confirmations
- Receive real-time balance updates
- Monitor staking reward distributions
- Track price movements and alerts
- Handle user authentication events
Getting Started
1. Set Up Your Endpoint
Create an HTTPS endpoint on your server to receive webhook payloads:path=null start=null
2. Register Your Webhook
Register your endpoint with the M.O.N.K.Y API:3. Verify Webhook Signatures
Always verify webhook signatures to ensure authenticity:path=null start=null
Event Types
Transaction Events
transaction.pending
transaction.pending
Triggered when a transaction is submitted to the network
transaction.confirmed
transaction.confirmed
Triggered when a transaction receives network confirmation
transaction.failed
transaction.failed
Triggered when a transaction fails or is rejected
transaction.received
transaction.received
Triggered when the wallet receives an incoming transaction
Wallet Events
balance.updated
balance.updated
Triggered when wallet balance changes
wallet.connected
wallet.connected
Triggered when a new wallet is connected to the platform
wallet.disconnected
wallet.disconnected
Triggered when a wallet is disconnected from the platform
Price Alert Events
price.alert
price.alert
Triggered when a price alert condition is met
price.significant_change
price.significant_change
Triggered when token prices have significant movements
Staking Events
stake.delegated
stake.delegated
Triggered when SOL is delegated to a validator
stake.reward
stake.reward
Triggered when staking rewards are distributed
stake.undelegated
stake.undelegated
Triggered when stake is undelegated from a validator
Webhook Management
List All Webhooks
Update Webhook
Delete Webhook
Test Webhook
Send a test payload to verify your endpoint:Best Practices
1. Handle Idempotency
Webhooks may be delivered multiple times. Use thetransaction_id or event ID to implement idempotency:
path=null start=null
2. Implement Retry Logic
Handle failed webhook deliveries gracefully:path=null start=null
3. Secure Your Endpoint
Always verify webhook signatures and use HTTPS:path=null start=null
4. Log Webhook Events
Maintain detailed logs for debugging and monitoring:path=null start=null
Rate Limits
Webhook deliveries are subject to rate limits:- Maximum Attempts: 5 retry attempts per webhook
- Retry Delays: Exponential backoff (1s, 2s, 4s, 8s, 16s)
- Timeout: 30 seconds per delivery attempt
- Maximum Events: 10,000 webhook events per hour per endpoint
Troubleshooting
Common Issues
Webhook Not Receiving Events
Webhook Not Receiving Events
Possible Causes:
- Endpoint URL not accessible from the internet
- Firewall blocking incoming requests
- SSL certificate issues with HTTPS endpoint
- Webhook is inactive or misconfigured
- Test endpoint accessibility with tools like ngrok for development
- Check webhook status via API
- Verify SSL certificate is valid
- Use webhook test endpoint to verify configuration
Signature Verification Failing
Signature Verification Failing
Possible Causes:
- Incorrect webhook secret
- Body parsing changing the payload
- Clock synchronization issues
- Verify webhook secret matches registered value
- Use raw body for signature verification
- Check system time synchronization
Duplicate Events
Duplicate Events
Possible Causes:
- Network issues causing retries
- Multiple webhook endpoints registered
- Processing errors causing failed deliveries
- Implement idempotency using event IDs
- Check for duplicate webhook registrations
- Ensure proper HTTP status codes in responses
Webhook Monitoring
Monitor webhook health and performance:path=null start=null