Events / Webhooks
Send POST requests to external systems when events occur in the API Hub.
Events and webhooks allow you to set up integrations with external systems. Any time an event in RapidAPI is triggered, an HTTP POST payload is sent to the webhook URLs provided during the event configuration. Webhooks can be used for a variety of reasons, for example:
- Integration to your AR/AP platform
- Trigger API updates in your gateway
- Sync your CRM software to new subscriptions made in your API Hub
- Send a Slack message
- Integrate your internal approvals workflows system with RapidAPI
- Deploy to your production server
Use them however it you want!
How does it work?
When a specific action is triggered in your API Hub, RapidAPI sends out HTTP requests to the webhook URLs that you have configured.
For example, when an API is created in your API Hub, the following webhooks will be called - API Created, API Updated, API Version Created, Billing Plan Created, Subscription Created and other events depending on what was configured for the API (for example, Target Group Created if a base URL was added). For a list of events that will trigger, see below .
Configuring events
To configure events and webhooks, navigate to the Events tab of the Admin Panel. Enable events by sliding the Enable event triggers toggle to the right.
Under Callback URL (up to 5), click Add a URL and add the URL to the external system that will receive the HTTP payload. Click Save after adding your webhook(s). You can add up to five URLs. Each one of these URLs will receive the events.
You must add a callback URL to begin seeing events
To begin seeing events in the event logs, you must enter a callback URL, even if it is temporary (for example, example.com).
In every webhook request, the API Hub includes secret key passed in the x-rapidapi-webhook-secret header. The purpose of the secret key is to ensure that the request is coming from your API Hub. You can use the Generate new button to create a new key if necessary.
Testing events
To ensure that the events are being triggered and for you to obtain a proper sample request, you can send test events. Click the Test event link next to the event that you would like to test (see the screenshot above). A dialog will open with a Test URL dropdown, a Request area (including a Test event button), and a Response area.
The event/webhook should be triggered for you, showing the response received from the POST event. To test other webhook URLs that you have configured above, you can change the dropdown to a different Test URL and click Test event.
Event logs
The purpose of the Event logs tab is to help you keep track and search for any events/webhooks that have been sent. The Event logs tab will begin populating with entries once you have enabled event triggers and added at least one callback URL.
In the screenshot below, you can see the events that are triggered when an API is created. You can also see the the response status indicating if your API Hub received a successful response from the webhook URL. Click Details associated with an event to see the event's request and response details.
List of events
Event Type | Events Triggered |
---|---|
API Created | API Created, API Updated, API Version Created, Billing Plan Created, Subscription Created (others depending on the API) |
API Updated | API Updated, API Version Updated |
API Deleted | API Deleted, Billing Plan Deleted |
Subscription Created | Subscription Created, Subscription Updated |
Subscription Updated | Subscription Created, Subscription Updated |
Subscription Deleted | Subscription Updated |
Billing Plan Created | API Updated, API Version Updated, Billing Plan Created |
Billing Plan Updated | API Updated, API Version Updated, Billing Plan Updated |
Billing Plan Deleted | Billing Plan Updated |
API Version Created | API Version Created, Billing Plan Updated |
API Version Updated | API Updated, API Version Updated |
API Version Deleted | none |
User Created | App Created, App Key Created, User Created |
User Updated | User Updated |
User Deleted | Delete User |
Team Created | App Created, App Key Created, Team Created |
Team Updated | Team Updated |
Team Deleted | App Deleted, App Key Deleted, Team Deleted |
App Created | App Created, App Keys Created |
App Updated | App Updated |
App Deleted | App Deleted |
App Key Created | App Key Created |
App Key Updated | App Key Updated |
App Key Deleted | App Key Deleted |
Organization Created | App Created, App Key Created, Organization Created, Team Created, Subscription Created |
Organization Updated | Organization Updated, Team Updated |
Organization Deleted | Organization Deleted, Subscription Deleted, App Deleted, Team Deleted |
API Endpoint Created | API Endpoint Created |
API Endpoint Updated | API Endpoint Updated |
API Endpoint Deleted | API Endpoint Deleted |
Base URL Created | Target Group Created |
Base URL Updated | Target Group Updated |
Base URL Deleted | Target Group Deleted |
Documentation Created | Documentation Created |
Documentation Updated | Documentation Updated |
Documentation Deleted | DOCUMENTATION.DELETED |
Billing Plan Created | BILLINGPLAN.CREATED |
Billing Plan Updated | BILLINGPLAN.UPDATED |
Billing Plan Deleted | BILLINGPLAN.DELETED |
Approval Created | WORKFLOW.CREATED |
Approval Updated | WORKFLOW.UPDATED |
Updated over 1 year ago