---
title: "API Key Management — Bearer Token & Basic Auth in AnyAPI"
description: "AnyAPI **API key management** lets you store authentication credentials in one place and reuse them across your WooCommerce API integrations. Instead of entering tokens, usernames, or passwords every time you create an integration, you can save the credentials once and…"
url: "https://anyapiplugin.com/docs/api-key-management/"
updated: "2026-10-11"
category: Core Features
---

# API Key Management — Bearer Token & Basic Auth in AnyAPI

AnyAPI **API key management** lets you store authentication credentials in one place and reuse them across your WooCommerce API integrations.

Instead of entering tokens, usernames, or passwords every time you create an integration, you can save the credentials once and select them when configuring an Order API Integration.

In this guide, you will learn how API key management works in AnyAPI, when to use Bearer Token or Basic Auth, how to add and manage credentials, and how to troubleshoot common authentication problems.

[![AnyAPI API key management dashboard](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-api-key-management-dashboard-1024x404.png)](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-api-key-management-dashboard.png)

## How API key management works in AnyAPI

AnyAPI stores reusable authentication credentials separately from individual integrations.

This makes it easier to manage credentials when several integrations use different external APIs. If a credential changes, you can update the stored key instead of recreating the integration from scratch.

AnyAPI currently supports two stored authentication types:

- Bearer Token
- Basic Auth

The authentication method you choose should match the requirements of the API you are connecting to.

## When do you need an API key?

Many third-party APIs require authentication before they accept requests.

For example, an API may require an access token, API token, username, password, or another credential to verify that the request is authorized.

However, not every endpoint requires authentication. Some webhook or testing endpoints may accept requests without credentials.

Always check the documentation for the destination API before choosing an authentication method.

| Scenario | Typical Authentication |
| --- | --- |
| API that provides an access token | Bearer Token |
| API that provides a username and password | Basic Auth |
| Public or test webhook endpoint | May not require authentication |
| Custom ERP or legacy API | Depends on the API provider |

If the destination API requires credentials, create the appropriate stored key in AnyAPI before connecting it to your integration.

## API key management: Bearer Token vs Basic Auth

AnyAPI supports Bearer Token and Basic Auth for stored API credentials.

### Bearer Token

Bearer Token authentication uses a single token supplied by the API provider.

The request normally includes an Authorization header in this format:

`Authorization: Bearer <your-token>`

Use Bearer Token when your API provider gives you an access token, API token, or similar token value.

For example, many modern REST APIs use Bearer Token authentication.

### Basic Auth

Basic Auth uses a username and password pair.

AnyAPI prepares the credentials for HTTP Basic Authentication and sends them using the standard Authorization header.

Use Basic Auth when the API provider gives you a username or application ID together with a password or secret.

Basic Auth is still used by some ERP systems, internal systems, and legacy APIs.

If you are unsure which authentication method to use, check the API provider's documentation for terms such as “Bearer Token”, “Access Token”, “Basic Authentication”, “Username”, or “Password”.

## API key management limits in Starter and Lite

The number of stored API keys depends on your current AnyAPI plan.

| Plan | API Key Limit | Price |
| --- | --- | --- |
| Starter | 1 key | $0 / forever |
| Lite | 5 keys | $79 / year |

Starter is suitable when you only need one set of credentials.

Lite supports up to five stored API keys, which is useful when your WooCommerce store connects to several external services with different authentication credentials.

For the latest plan information, see the AnyAPI Feature Comparison or Pricing page.

[AnyAPI Feature Comparison →](/docs/feature-comparison-free-vs-lite-vs-plus/)

[View AnyAPI Pricing →](/pricing/)

## How to add a new API key

Use the API Keys area in your WordPress admin to store a new credential.

[![Add Bearer Token or Basic Auth credentials in AnyAPI API key management](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-add-api-key-bearer-basic-auth-1024x668.png)](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-add-api-key-bearer-basic-auth.png)

### Step 1: Open API Keys

Open the AnyAPI API Keys area in your WordPress admin.

You should see your existing saved credentials and information about your current API key usage.

### Step 2: Add a new API key

Click **+ Add API Key** to create a new stored credential. If you have already reached the API key limit for your plan, you will need to remove an unused key or move to a plan with additional key capacity.

### Step 3: Enter a descriptive name

Give the credential a name that makes its purpose easy to recognize.

For example:

- ERP Production
- CRM API Token
- Fulfilment API
- Staging Bearer Token

Avoid generic names such as `Key 1` when you manage more than one integration.

### Step 4: Choose the authentication type

Select the authentication method required by the destination API.

Choose:

- **Bearer Token** for token-based authentication
- **Basic Auth** for username-and-password authentication

The available credential fields will depend on the authentication type you select.

### Step 5: Enter the credentials

For Bearer Token, enter the token supplied by the API provider.

For Basic Auth, enter the username and password supplied by the API provider.

Make sure the values exactly match the credentials provided by the external service.

Do not include production tokens, passwords, or other sensitive credentials in screenshots or public documentation.

### Step 6: Save the API key

Save the credential after checking the name, authentication type, and values.

The saved key can then be selected when you create or edit an Order API Integration.

## How to use a stored API key in an integration

After saving a credential, open the Order API Integration that requires authentication.

[![Select a stored API key for an AnyAPI WooCommerce integration](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-add-api-key-bearer-basic-auth-1-1024x668.png)](https://anyapiplugin.com/wp-content/uploads/2026/05/anyapi-add-api-key-bearer-basic-auth-1.png)

Select the appropriate stored credential from the authentication or API key option in the integration setup.

The integration can then reuse that credential when AnyAPI sends the request to the external API.

Because credentials are stored separately, you do not need to enter a separate copy of the same token or username and password every time you configure an integration.

For the full integration setup process:

[Order API Integration →](/docs/order-api-integration/)

If you are creating your first integration:

[WooCommerce API Integration Setup →](/docs/woocommerce-api-integration-setup/)

## How to edit an API key

If an API provider gives you a new token, password, or replacement credential, update the saved key in AnyAPI.

Open the existing credential and use the edit option.

Enter the new credential and save the changes.

An integration that references the stored key can then use the updated credentials without requiring you to rebuild the complete integration.

This is particularly useful when rotating Bearer Tokens or updating passwords.

## How to delete an API key

Delete credentials that are no longer needed.

Before deleting a key, first check whether an active Order API Integration still uses it.

Removing a credential that is referenced by an active integration may cause authentication to fail when the next request is sent.

Therefore, update the integration to use another credential first, or disable the integration if it is no longer required.

## API key management security best practices

API credentials should be treated as sensitive information.

AnyAPI uses stored credentials when making requests to the API endpoint configured in your integration.

To reduce unnecessary credential exposure:

- Do not publish production credentials in screenshots or documentation.
- Use separate credentials for different external services where possible.
- Remove credentials that are no longer used.
- Rotate tokens or passwords when required by the API provider.
- Give stored credentials descriptive names.
- Review the permissions granted to each API credential.

If an API provider supports restricted permissions or scopes, grant only the permissions required by your WooCommerce integration.

## Best practices for managing multiple API keys

As your integrations grow, consistent API key management makes troubleshooting and maintenance easier.

### Use descriptive names

A name such as `ERP Production` is easier to identify than `API Key 2`.

This becomes especially important when several integrations use different production and staging credentials.

### Keep production and staging credentials separate

If your API provider gives you separate development and production credentials, store them as separate keys.

For example:

- ERP Staging
- ERP Production

This helps reduce the risk of accidentally sending test data to a production system.

### Avoid unnecessary credential reuse

Where possible, use separate credentials for unrelated services.

If one credential must be rotated or revoked, this reduces the number of integrations affected by the change.

### Remove unused credentials

Delete old credentials after confirming that no active integration depends on them.

Keeping your stored credentials organized also makes it easier to identify which keys are still in use.

## Troubleshooting API authentication

If an API request fails after you configure a credential, check the HTTP response and the authentication requirements of the destination API.

| Problem | Possible Cause | What to Check |
| --- | --- | --- |
| 401 Unauthorized | Token, username, or password is incorrect or expired | Verify the stored credential and replace it if necessary |
| 403 Forbidden | Credential is valid but does not have permission | Check scopes, roles, or API permissions |
| Wrong authentication type | Bearer Token selected when Basic Auth is required, or vice versa | Confirm the authentication method in the API documentation |
| Integration stopped after deleting a key | The integration referenced the deleted credential | Assign a valid stored credential |
| New token does not work | Stored credential is outdated or provider configuration changed | Update the stored key and review the API provider settings |

For more detailed request and response information, review the AnyAPI API Logs.

[API Logs & Troubleshooting →](/docs/api-logs-troubleshooting/)

## Do I need a different API key for every integration?

Not necessarily.

If multiple integrations connect to the same external service and that service allows the same credential to be reused, they may reference the same stored key.

However, separate credentials can make access control, credential rotation, and troubleshooting easier when the API provider supports them.

## What happens if an API token expires?

If a Bearer Token expires, requests using that token may begin returning authentication errors such as HTTP 401.

When the API provider issues a replacement token, edit the stored key in AnyAPI and replace the expired value.

After saving the updated credential, integrations that reference that key can use the new token.

## Can I change an API key without rebuilding my integration?

Yes.

Because the credential is stored separately, you can update the saved API key instead of rebuilding the complete Order API Integration.

This is useful when rotating passwords or Bearer Tokens.

## Which AnyAPI plan supports multiple API keys?

Starter supports one stored API key.

Lite supports up to five stored API keys.

If you need credentials for several external APIs, review the current Lite features and pricing.

[AnyAPI Feature Comparison →](/docs/feature-comparison-free-vs-lite-vs-plus/)

[View AnyAPI Pricing →](/pricing/)

## Next steps after API key management

Once your API credentials are ready, you can connect them to a WooCommerce order integration.

[Set up an Order API Integration →](/docs/order-api-integration/)

If this is your first AnyAPI integration, follow the step-by-step setup guide:

[WooCommerce API Integration Setup →](/docs/woocommerce-api-integration-setup/)

For request failures or authentication errors:

[API Logs & Troubleshooting →](/docs/api-logs-troubleshooting/)

You can also install or review AnyAPI on the official WordPress.org Plugin Directory.

[AnyAPI on WordPress.org →](https://wordpress.org/plugins/anyapi/)
