How can we help?

Fixing repeated 401 Unauthorized after regenerating an Auvik API key

Follow

Overview

If you continue receiving 401 Unauthorized responses after generating a new Auvik API key, the issue may be related to the authentication method, API family, region, tenant access, or an integration that is still using the previous key.

Confirm the authentication method

Use the authentication method required by the API family.

Unified Auvik API

Use HTTP Basic Authentication with:

  • The Auvik user’s email address as the username.
  • The user’s Auvik API key as the password.

Example:

curl -i \
  -u "USER_EMAIL:NEW_API_KEY" \
  "https://auvikapi.<region>.my.auvik.com/authentication/verify"

Auvik SaaS Management API

Use the ASM Integration Key and Secret in the headers required by the ASM API documentation.

Do not use ASM Integration credentials with Unified API endpoints or Unified API credentials with ASM endpoints.

Confirm the new key is being used

After generating a new key:

  • Replace the previous key in the integration, script, connector, or secrets manager.
  • Check for environment variables or configuration files that may still contain the previous key.
  • Restart or reload the integration if it caches credentials.
  • Confirm that the key was copied completely and does not contain spaces, line breaks, or surrounding quotation marks.
  • Verify that the key belongs to the intended Auvik user and account.

Generating a new key does not automatically update integrations that stored the previous key.

Confirm the region and API endpoint

Verify that:

  • The request uses the correct regional API base URL.
  • The endpoint belongs to the API family associated with the credentials.
  • The API version is correct.
  • The request is being sent to the intended production or test environment.
  • The tenant or site identifier is valid and accessible to the API user.

Confirm account and permissions

Ask an Auvik administrator to verify that:

  • The user account that owns the key is active.
  • The user has API access.
  • The user has the required permission for the endpoint.
  • The user or service account can access the requested site, client, or tenant.
  • The API key was not revoked or regenerated again after it was added to the integration.

If the user’s role or site access recently changed, confirm that the integration is still using a key owned by the correctly scoped account.

Test a minimal request

Test a simple, read-only request using the correct authentication method and regional endpoint.

If the minimal request succeeds, the key and basic authentication are working. The original request may have an endpoint, tenant-scope, or permission issue.

If the minimal request still returns 401:

  • Recheck the authentication format.
  • Confirm the new key is being used.
  • Verify the API family and region.
  • Confirm the account is active.
  • Generate a replacement key only after confirming the previous key is not being used elsewhere.

Common causes

The integration still uses the old key

Update the stored credential in the integration, script, connector, or secrets manager and reload the integration.

The wrong authentication method is being used

Confirm whether the endpoint requires Unified API Basic Authentication or ASM API headers.

The wrong regional endpoint is being used

Update the client to use the regional API base URL associated with the tenant.

The key belongs to the wrong account

Generate the key from an active Auvik user or service account with access to the required sites or tenants.

The key was copied incorrectly

Re-copy the key and check for truncation, whitespace, or hidden line breaks.

The account or key is no longer active

Ask an Auvik administrator to confirm the user account and key status.

When to contact Support

Provide:

  • The API family.
  • The endpoint and HTTP method.
  • The regional base URL.
  • The timestamp of the failed request, including timezone.
  • The exact 401 response body.
  • Any request or correlation ID.
  • Confirmation that the same request was tested with the newly generated key.
  • The steps already completed.

Do not include API keys, secrets, passwords, or authorization headers in a support request.

Related articles

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Auvik System Status

Check system status