> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alvys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to View the API Key Access Log and Rotate a Secret

> See when, from where, and with what result your company's Public API keys requested access tokens, and replace a key's client secret.

> [!NOTE]
>
> The Access Log shows every token request made with your company's Public API keys: successful requests, failed requests, and rate-limited requests. Use it to check which keys are in use, from which IP addresses, and which requests failed. If a secret may be exposed, you can rotate it from the same place.

## Overview

You open the Access Log from **Settings** → **API Access** → **Access Log**. The page lists the newest token requests first. Each row shows one request made with one API key. Select a row to see the full details of that request.

**Rotate secret** replaces the client secret of an API key. You can rotate a secret from the key's page or from the details panel of the Access Log.

Synonyms: API access log, API key activity, API token log, client credentials log, API audit log, rotate API secret, reset API secret, regenerate client secret, leaked API key.

## Before You Start

Your user account must have one of these roles: **Admin**, **Partner Admin**, or **Support**. If you have any other role, you cannot open the Access Log or rotate a secret.

> [!NOTE]
>
> The Access Log shows only your own company's API keys. Keys managed by Alvys, for example the key used by Alvys Voice, are shown only to Alvys Support. Activity from deleted keys is not shown.

## Open the Access Log

1. Open **Settings** from the main navigation.
2. Select **API Access**.
3. Click **Access Log**.

The Access Log page opens. It shows the token requests of the last 7 days.

To see the requests of one key only, open the key's page and click **View Access Log**. The page opens with the **API key** filter set to that key.

**Result check:** The path at the top of the page ends with **Access Log**, and the table shows your company's token requests with the newest first. If the table shows **No API key activity matches these filters**, no key requested a token in the date range. Widen the date range to check an earlier period.

## Read the table

Each row has these columns:

| Column | What it shows |
| - | - |
| **Time** | The date and time of the request. |
| **API key** | The name of the API key that made the request. |
| **Result** | **Success**, **Failure**, or **Rate limited**. |
| **IP address** | The IP address the request came from. |
| **Country (failed requests)** | The country of that IP address. It shows only for failed requests. |
| **User agent** | The tool or library that sent the request, when it identified itself. |

The footer shows how many days back the page reads. Activity from deleted keys is not shown.

## Find a request

1. To find one key, type part of its name in **Search API keys**.
2. To narrow the list by a column, open the filter on the column header and click **Apply**. You can filter by **Time**, **API key**, **Result**, and **IP address**. The **IP address** filter needs the full address, for example `203.0.113.7`.
3. To remove all search text and filters, click **Clear all**.

## See the details of a request

1. Click a row in the table. A details panel opens on the right.
2. Read the sections of the panel:
   * **Event:** the time, the event (**Token issued**, **Token request failed**, or **Rate limit reached**), the result, and the log ID.
   * **API key:** the name and the client ID of the key.
   * **Request:** the audience and the scopes the request asked for.
   * **Source:** the IP address, the country for a failed request, and the client that sent the request.
3. Close the panel to return to the table.

> [!TIP]
>
> When you contact Alvys Support about a request, include the **Log ID** from the details panel.

## Rotate a secret

Rotate a secret when it may be exposed, for example when you see failed or unexpected requests from an IP address you do not know.

> [!WARNING]
>
> Rotating is a destructive action. The current secret stops working immediately. Integrations that use it cannot get new access tokens until you update them with the new secret. Access tokens that were already issued are not revoked. They keep working until they expire.

1. Open the key's page from **Settings** → **API Access**, or click a row of that key in the Access Log.
2. Click **Rotate secret**.
3. Read the message, then click **Rotate secret** to confirm.
4. The new secret shows with a copy button. Copy it and update every integration that uses this key.
5. Click **Done**.

**Result check:** The key's page shows the new secret. Integrations that still use the old secret get failed requests, which show as **Failure** in the Access Log.

You cannot rotate the secret of these keys:

* Keys managed by Alvys.
* Legacy keys created in the older credential format.
* Deactivated or expired keys. Update the key to reactivate it first.

Every rotation is recorded with the user who did it and the time.

## Troubleshooting

If the page or the rotation shows a message, find it here.

| Message | What to do |
| - | - |
| **Too many requests** | Wait one minute, then try again. The Access Log shares a request limit with Login Activity. |
| **Access Log is temporarily unavailable** | Wait a short time, then click **Retry**. If the message stays, contact Alvys Support. |
| **Couldn't load the access log** with **Some filters aren't valid. Clear the filters and try again.** | Click **Clear all**, then set the filters again. |
| **Couldn't load the access log** with **Enter a full IP address, for example 203.0.113.7.** | Type the full IP address in the **IP address** filter. |
| **This API key isn't available** | The key may have been deleted. Click **Clear all** to see your other keys. |
| **This key's secret can't be rotated here.** | The key is managed by Alvys, legacy, deactivated, or expired. See the list in **Rotate a secret**. |
| **A rotation is already in progress for this key.** | Another user is rotating the same key. Wait a moment, then check the key's secret on its page. |
| **Too many rotations. Try again in a minute.** | Your company can rotate up to 5 secrets each minute. Wait, then try again. |
| **Auth0 didn't answer in time. The old secret may no longer work. Rotate again.** | Rotate the secret again, then update your integrations with the new secret. |
| **Your company has more API keys than the access log can search at once** | Filter by **API key** to see the requests of one key. |

## Frequently Asked Questions

**Q: How far back can I look?**

**A:** The footer of the table shows how many days back the page reads. Requests older than that are not available.

**Q: Why is the country empty for successful requests?**

**A:** Location is reported only for failed token requests. For a successful request, use the IP address.

**Q: Does a failed request show why it failed?**

**A:** The Access Log shows that the request failed and where it came from. It does not show the reason. If you need the reason, contact Alvys Support with the **Log ID**.

**Q: Does rotating a secret stop requests that already have a token?**

**A:** No. Access tokens that were already issued keep working until they expire. New token requests with the old secret fail.

**Q: Why do I not see a key that was deleted?**

**A:** When a key is deleted, its activity is no longer shown.

## Go Deeper

* [Alvys API](https://docs.alvys.com/en/help/integrations/alvys-api.md)
* [How to View Login Activity in Alvys](https://docs.alvys.com/en/help/administration/how-to-view-login-activity-in-alvys.md)
* [User Roles in Alvys](https://docs.alvys.com/en/help/administration/user-roles-in-alvys.md)
