Skip to main content

KnowBe4 | Error : Request failed with status code 401

Overview ✨

KnowBe4 has updated its API settings interface, which now provides multiple options for generating API tokens. Although these options may appear similar, the API tokens are intended for different purposes and are not interchangeable.

The Liongard KnowBe4 Inspector requires a specific type of API token to authenticate successfully and retrieve data from KnowBe4.

If an API token is generated from the incorrect section of the KnowBe4 administration console, the inspector may encounter an HTTP 401 (Unauthorized) error because the token does not provide the authentication required to access the corresponding API endpoint.

Error Message

Inspection failed at https://us.api.knowbe4.com/v1/account with status code 401: Request failed with status code 401. This is a problem with your permissions within the target system, not the Liongard inspector.

ℹ️ This article explains how to identify the correct API token, generate it from the appropriate section of the KnowBe4 administration console, and update the Liongard Inspector to resolve this authentication issue.


Why This Happens

The KnowBe4 Security Awareness Training (KSAT) console provides multiple options for generating API tokens under Account Settings > Account Integrations > API, including the Reporting API and Product API sections.

Although both sections provide an option to create an API token, the tokens serve different purposes and are not interchangeable for the Liongard KnowBe4 Inspector.

  • Reporting API: Used to retrieve reporting data from the KnowBe4 console. The Liongard KnowBe4 Inspector requires a valid and enabled Reporting API token to authenticate and collect data.

  • Product API: Used for product-specific API integrations and functionality. Tokens generated from this section are not supported by the Liongard KnowBe4 Inspector.

If a Product API token is configured in place of a Reporting API token, KnowBe4 may reject the inspector's authentication request, resulting in an HTTP 401 (Unauthorized) error.

⚠️ Important: If the API token creation form prompts you to select Products, configure Scopes, or assign a User, you are likely in the Product API section. Navigate to the Reporting API section to generate the appropriate token for the Liongard KnowBe4 Inspector.

For additional information, refer to KnowBe4's Reporting API Overview and Product API Overview.


Steps To Resolve

To resolve the HTTP 401 (Unauthorized) error caused by an incorrect API token, generate a valid Reporting API token in KnowBe4 and update the existing Liongard KnowBe4 Inspector configuration.

Step 1: Generate a Reporting API Token in KnowBe4

  1. Log in to the customer's KnowBe4 Security Awareness Training (KSAT) console using an administrator account.

  2. Select your email address in the top-right corner of the console and select Account Settings.

  3. Navigate to Account Integrations > API.

  4. Under the Reporting API section, ensure that Enable Report API Access is enabled.

  5. Select Reporting API to open the Reporting API subtab.

  6. Select + Create New API Token in the top-right corner.

  7. Configure the following fields:

    • Name: Enter a descriptive name, such as Liongard Reporting API.

    • Status: Ensure the API token is enabled.

⚠️ Important: If the token creation form prompts you to select Products, configure Scopes, or assign a User, verify that you are in the Reporting API section rather than the Product API section.

Step 2: Update the KnowBe4 Inspector in Liongard

  1. Log in to your Liongard instance.

  2. Locate the affected KnowBe4 Inspector and open its configuration settings.

  3. Replace the existing API token in the KnowBe4 API Key field with the newly generated Reporting API token.

  4. Verify that the KnowBe4 Account Location matches the region where the customer's KnowBe4 account is hosted.

  5. Save the updated inspector configuration.

  6. Manually run the inspector to verify that the authentication issue has been resolved.

Verify the KnowBe4 Account Location

KnowBe4 uses region-specific API endpoints. The account location configured in Liongard must correspond to the customer's KnowBe4 hosting region to ensure successful authentication and data collection.

To identify the account location, refer to the URL displayed in your browser after logging in to the customer's KnowBe4 console.

KnowBe4 Console URL

Account Location

training.knowbe4.com

United States (US)

eu.knowbe4.com

European Union (EU)

ca.knowbe4.com

Canada (CA)

uk.knowbe4.com

United Kingdom (UK)

de.knowbe4.com

Germany (DE)

Select the corresponding account location from the available options in the Liongard Inspector configuration.

⚠️ Important: Reporting API tokens are account-specific. If you manage multiple KnowBe4 customer accounts, ensure that the API token is generated within the correct customer's KnowBe4 console and configured in the corresponding Liongard Inspector.

Step 3: Verify the Resolution

Once the inspection has completed, verify that:

  • The KnowBe4 Inspector completes successfully.

  • The HTTP 401 (Unauthorized) error no longer occurs.

  • The inspector successfully collects data from KnowBe4.

If the error persists, verify that the Reporting API token is enabled, the correct token value has been entered, and the configured account location matches the customer's KnowBe4 hosting region.

If the issue persists after completing these checks, contact Liongard Support for further assistance.

‼️ Security Note: API tokens are sensitive credentials. Do not include API tokens in support tickets, emails, or screenshots.

For additional information, refer to the following documentation:

Additional Troubleshooting

If the KnowBe4 Inspector continues to fail with an HTTP 401 (Unauthorized) error after completing the resolution steps, verify the following:

  • API Token Type: Ensure the API token was generated under the Reporting API section, not the Product API section.

  • Reporting API Access: Verify that the Enable Report API Access setting is enabled in the customer's KnowBe4 console.

  • API Token Status: Confirm that the Reporting API token is enabled and has not expired or been deleted.

  • Account Location: Ensure the account location configured in the Liongard KnowBe4 Inspector matches the customer's KnowBe4 hosting region.

  • API Token Value: Verify that the complete API token was copied and entered into Liongard without additional spaces or missing characters.

  • Customer Account: Ensure the API token was generated within the KnowBe4 account associated with the customer being inspected.

  • Subscription Requirements: Confirm that the customer's KnowBe4 subscription includes Reporting API access.

Subscription Requirements

According to KnowBe4's documentation, Reporting API access is available with the following subscriptions:

  • Platinum

  • Diamond

  • SAT Foundations

  • SAT Advanced

For additional information regarding subscription requirements and API availability, refer to KnowBe4's Reporting API Overview.

If the existing API token cannot be validated, generate a new Reporting API token, update the Liongard Inspector configuration, and manually run the inspector again.


Best Practices

To maintain a secure and reliable integration between Liongard and KnowBe4, follow these recommendations:

  • Use a dedicated API token: Generate a Reporting API token specifically for the Liongard integration.

  • Use descriptive token names: Assign a recognizable name, such as Liongard Reporting API, to simplify token identification and management.

  • Store API tokens securely: Store newly generated tokens in an approved password manager or secure credential management solution.

  • Monitor token validity: Periodically review the token's status and validity to prevent unexpected authentication failures.

  • Remove unused API tokens: Disable or delete Product API tokens that were mistakenly created for Liongard, after confirming they are not being used by another integration.

  • Maintain account-specific configurations: When managing multiple KnowBe4 customer accounts, ensure each Liongard Inspector is configured with a valid Reporting API token associated with the corresponding customer account.

‼️ Security Note: API tokens are sensitive authentication credentials. Never include API token values in support tickets, emails, screenshots, or other unsecured communications.


When to Contact Liongard Support 🦁

If the KnowBe4 Inspector continues to fail with an HTTP 401 (Unauthorized) error after completing all the troubleshooting steps outlined in this article, contact Liongard Support for further assistance.

To help expedite the investigation, provide the following information when submitting a support request:

  • Affected Environment and KnowBe4 Inspector name.

  • KnowBe4 account hosting region or console URL.

  • KnowBe4 subscription type.

  • Confirmation that a valid and enabled Reporting API token is configured.

  • A summary of the troubleshooting steps already performed.

  • Relevant screenshots of the configuration settings, with sensitive information redacted.


Related Articles and References ⭐️

Liongard Documentation

KnowBe4 Documentation

🚨 Note : We may occasionally provide links to third-party tools or resources for additional reference. These resources are offered for convenience only, and Liongard does not control, maintain, or guarantee their functionality, accuracy, or availability. Please review and use any third-party resources at your own discretion.

Did this answer your question?