Webhooks
Receive real-time notifications when events occur in usmewe.Overview
Webhooks allow your application to receive HTTP POST requests when specific events happen, enabling real-time integrations.Register Webhook
Create a new webhook endpoint.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | HTTPS endpoint URL |
events | array | Yes | Events to subscribe to |
secret | string | Yes | Shared secret for verification |
List Webhooks
Get all registered webhooks.Update Webhook
Update webhook configuration.Delete Webhook
Remove a webhook.Webhook Payload
All webhooks receive payloads in this format:Verifying Webhooks
Verify webhook authenticity using the signature header:Available Events
Loan Events
| Event | Description |
|---|---|
loan.created | Loan request created |
loan.funded | Loan has been funded |
loan.repaid | Loan fully repaid |
loan.partial_payment | Partial payment received |
loan.overdue | Loan is overdue |
loan.defaulted | Loan marked as default |
Vault Events
| Event | Description |
|---|---|
vault.deposit | USDC deposited |
vault.withdraw | USDC withdrawn |
vault.yield_distributed | Yield distribution occurred |
Social Vault Events
| Event | Description |
|---|---|
social_vault.withdrawal_requested | Large withdrawal requested |
social_vault.withdrawal_approved | Withdrawal approved |
social_vault.withdrawal_executed | Withdrawal completed |
social_vault.locked | Vault locked (duress) |
User Events
| Event | Description |
|---|---|
user.trust_score_updated | Trust Score changed |
user.level_up | User leveled up |
user.guardian_added | Guardian relationship created |
Retry Policy
Failed webhook deliveries are retried:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
| 6 | 24 hours |
failing.
Get Delivery History
View webhook delivery attempts.Test Webhook
Send a test event to your webhook.Best Practices
Respond quickly
Respond quickly
Return 200 OK within 5 seconds. Process asynchronously if needed.
Handle duplicates
Handle duplicates
Use the
id field to deduplicate. We may retry successful deliveries.Verify signatures
Verify signatures
Always verify the
x-usmewe-signature header.Use HTTPS
Use HTTPS
Webhook URLs must use HTTPS with valid certificates.
Error Responses
| Code | Error | Description |
|---|---|---|
| 400 | INVALID_URL | URL is not valid HTTPS |
| 400 | INVALID_EVENTS | Unknown event types |
| 404 | WEBHOOK_NOT_FOUND | Webhook doesn’t exist |
| 409 | URL_EXISTS | URL already registered |