Skip to main content

Webhook Authentication

Partners can set up webhooks to receive notifications from Kindly whenever predefined events occur.

By configuring the appropriate webhook URLs, partners receive payloads containing relevant data, such as new user registrations, event updates, and shift changes.

To ensure the security and reliability of webhook payloads, we've taken several key measures. These safeguards are designed to protect sensitive data and verify the authenticity of webhook requests.

All webhook payloads are transmitted securely over HTTPS, and webhook request authentication is achieved using an API key. To authenticate the received webhook requests, expect the APIKEY header. This approach ensures both security and authentication for your communications.

Authenticate received Webhooks

import aiohttp
from aiohttp import web

PARTNER_API_KEY = 'valid token'

async def handle_volunteer_registered(request):
# Check if the 'APIKEY' header is present in the request
if 'APIKEY' not in request.headers:
return web.Response(status=401, text='Unauthorized: APIKEY header missing')

# Verify the 'APIKEY' header value matches the expected API key
api_key = request.headers['APIKEY']
if api_key != PARTNER_API_KEY:
return web.Response(status=401, text='Unauthorized: Invalid APIKEY')

# Continue processing or handling the webhook data
pass

app = web.Application()
app.router.add_post('/volunteer-registered', handle_volunteer_registered)

web.run_app(app, host=base_url, port=443)