Written in python
uv run uvicorn main:app --port 8000 --reloadYou can simulate a pull trigger from Kindly using curl. The Kindly-HMAC header
must be a valid HMAC-SHA256 (base64) signature of the exact request body, signed
with your signing_key_from_kindly_platform.
The example below uses the hardcoded demo key (1234567890abcdef1234567890abcdef)
and a sample body — replace all placeholder values and recompute the HMAC when
using your own key.
curl -X POST http://localhost:8000/ \
-H "Content-Type: application/json" \
-H "Kindly-HMAC: MSH5annPK7Ho6F15nz0K/uGqqhQtnATkgtGoVUBBCxU=" \
-H "Kindly-HMAC-algorithm: HMAC-SHA-256 (base64 encoded)" \
-H "Kindly-Bot-Id: YOUR_BOT_ID" \
-H "Kindly-Config-Id: YOUR_CONFIG_ID" \
-d '{"bot_id": "YOUR_BOT_ID", "config_id": "YOUR_CONFIG_ID"}'Expected response: {"message": "ok"} with HTTP 200.
import hmac, hashlib, base64, json
key = b"YOUR_SIGNING_KEY"
body = json.dumps({"bot_id": "YOUR_BOT_ID", "config_id": "YOUR_CONFIG_ID"}).encode()
signature = base64.b64encode(hmac.new(key, body, hashlib.sha256).digest()).decode()
print(signature)Important: the body passed to
curl -dmust be byte-for-byte identical to the body used when computing the HMAC. Do not reformat or pretty-print it.