KnowBe4 fetchers in this repo use the KnowBe4 Reporting API (/v1/...) with Bearer authentication.
| Variable | Required | Description | Example |
|---|---|---|---|
KNOWBE4_API_KEY |
Yes | KnowBe4 Reporting API key | kb4_... |
KNOWBE4_REGION |
Yes | KnowBe4 region (used to form the API hostname for shell fetchers) | US |
KNOWBE4_BASE_URL |
No | Full API base URL (default https://us.api.knowbe4.com; used by rippling_vs_knowbe4_training.py when not using region-based hostnames) |
https://us.api.knowbe4.com |
KNOWBE4_CAMPAIGN_ID |
No | If set, only checks enrollment in this campaign (rippling_vs_knowbe4_training.py) |
123456 |
Shell scripts under fetchers/knowbe4/ build the host as https://{KNOWBE4_REGION}.api.knowbe4.com. The Rippling cross-reference script uses KNOWBE4_BASE_URL (set it to match your region, e.g. https://us.api.knowbe4.com).
security_awareness_training.shhigh_risk_training.shdeveloper_specific_training.shmodule_based_summary.sh../rippling/rippling_vs_knowbe4_training.py(live API mode)
All KnowBe4 shell fetchers call:
| Endpoint(s) | Method(s) |
|---|---|
https://{KNOWBE4_REGION}.api.knowbe4.com/v1/users |
GET |
https://{KNOWBE4_REGION}.api.knowbe4.com/v1/training/enrollments |
GET |
Some fetchers additionally call:
| Endpoint(s) | Method(s) |
|---|---|
https://{KNOWBE4_REGION}.api.knowbe4.com/v1/training/campaigns |
GET |
https://{KNOWBE4_REGION}.api.knowbe4.com/v1/groups |
GET |
https://{KNOWBE4_REGION}.api.knowbe4.com/v1/groups/{group_id}/members |
GET |
rippling_vs_knowbe4_training.py calls {KNOWBE4_BASE_URL}/v1/users and {KNOWBE4_BASE_URL}/v1/training/enrollments.
- Access level: KnowBe4 Reporting API access enabled for your account.
- Role: Admin access sufficient to generate a reporting API key.
- Scope: Read-only access to reporting endpoints (users, enrollments, campaigns, groups).
- Sign in to KnowBe4 as an Admin.
- Navigate to Account Settings → Account Integrations → API.
- Enable Reporting API Access (KnowBe4 notes this is typically available only to Platinum/Diamond customers).
- Copy the Secure API key.
- Determine your
KNOWBE4_REGION:- Log in to KnowBe4 and note the region in the browser URL / tenant hostname.
- Supported values used by these fetchers:
US,EU,CA,UK,DE.
- Store the key in your secrets manager and set:
export KNOWBE4_API_KEY="<your-key>"
export KNOWBE4_REGION="US"For rippling_vs_knowbe4_training.py, also set KNOWBE4_BASE_URL to the matching regional base (e.g. https://us.api.knowbe4.com).
- Generate a new key in the KnowBe4 console.
- Update
KNOWBE4_API_KEYin your secrets store/runtime environment. - Smoke test:
curl -s -H "Authorization: Bearer $KNOWBE4_API_KEY" \
"https://${KNOWBE4_REGION}.api.knowbe4.com/v1/users?page=1" \
| python3 -m json.tool | head -30- Revoke the old key once the smoke test succeeds.
- The KnowBe4 scripts paginate using
page=Nuntil an empty page is returned.