Webhooks API
Receive real-time notifications for events in your application via webhooks.
Overview
Webhooks allow your application to receive real-time HTTP notifications when events occur. Configure webhook endpoints to listen for events like user registration, subscription changes, and more.
💡 Tip: All webhook requests include a signature header for verification to ensure requests are from AuthCore.
List Webhooks
/api/webhooks
List all configured webhooks. Requires admin role.
Response (200 OK)
Create Webhook
/api/webhooks
Register a new webhook endpoint. Requires admin role.
Request Body
Response (201 Created)
⚠️ Important: Save the webhook secret securely. You'll need it to verify webhook signatures.
Update Webhook
/api/webhooks/:webhookId
Update webhook configuration. Requires admin role.
Request Body
Response (200 OK)
Delete Webhook
/api/webhooks/:webhookId
Remove webhook endpoint. Requires admin role.
Response (200 OK)
Event Types
Available webhook event types:
User Events
user.created
- New user registereduser.updated
- User profile updateduser.deleted
- User account deleteduser.email_verified
- Email verified
Organization Events
organization.created
- New organization createdorganization.updated
- Organization updatedorganization.deleted
- Organization deletedorganization.member_added
- Member joinedorganization.member_removed
- Member left
Subscription Events
subscription.created
- New subscriptionsubscription.updated
- Subscription changedsubscription.canceled
- Subscription canceledsubscription.renewed
- Subscription renewed
Security Events
security.account_locked
- Account lockedsecurity.suspicious_login
- Suspicious activitysecurity.2fa_enabled
- 2FA enabledsecurity.2fa_disabled
- 2FA disabled
Webhook Payload
All webhooks are sent as POST requests with this structure:
Signature Verification
Verify webhook authenticity using the X-Webhook-Signature
header:
Best Practices
✅ Always Verify Signatures
Never trust webhook data without verifying the signature
⚡ Return 200 Quickly
Process webhooks asynchronously and return success immediately
🔄 Handle Idempotency
Use event IDs to prevent processing the same event twice
🔐 Use HTTPS
Webhook URLs must use HTTPS in production
Get Webhook Deliveries
/api/webhooks/:webhookId/deliveries
View webhook delivery history and status. Requires admin role.
Response (200 OK)
Retry Failed Delivery
/api/webhooks/deliveries/:deliveryId/retry
Manually retry a failed webhook delivery. Requires admin role.
Response (200 OK)