Webhooks
Receive notifications when certain events occur.
The Keywords AI platform provides a webhook system that allows you to receive notifications when certain events occur.
For example, when Keywords AI logs a new request, your webhook and point can receive this notification as an API call from Keywords AI.
Create your webhook endpoint in your application, and then create a new webhook in the Keywords AI platform here.
Authentication
Keywords AI uses digital signature strategy for webhook data verification.
The data sent from Keywords AI undergoes the following process before you can use it:
- The data is ready in Keywords AI’s backend
- The Keywords AI encodes the data with your API Key string retrieved from the action’s header (we don’t store your API key) that triggers the webhook, using SHA-256 algorithm.
- The signature is then passed to
X-Keywordsai-Signature
. This is case sensitive.
- You can verify the data and accept or reject the payload
Example for using webhooks
- Define a webhook endpoint in your application.
This endpoint sends an email to the admin when a webhook event is received.
-
Create a new webhook in the Keywords AI platform.
- Go to the Webhooks page in the Keywords AI platform.
- Click on the “Create Webhook” button, and a modal will appear.
- Define the webhook URL. In this demo, it is
http://localhost:8000/api/webhook/
. - Define the event type that triggers the webhook. In this demo, it is
New request log
(when an API call is logged). - Define the API Key you want to associate this webhook with. In this demo, it is an admin development key.
- Click on the “Create” button.
-
Make an API call to the chat completion endpoint
-
Receive the email.