> For the complete documentation index, see [llms.txt](https://docs.guestway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guestway.io/account-and-administration/api-access/how-to-rotate-or-revoke-an-api-token.md).

# How to rotate or revoke an API token

This guide shows you how to replace an API token without downtime, and how to delete a token you no longer trust.

{% hint style="info" %}
**Before you start**

* You have the **Super admin** role.
  {% endhint %}

## Rotate a token

Guestway has no button to rotate a token. You replace it with a new token.

{% stepper %}
{% step %}

### Create a new token

Create a token with the same permissions as the old one. See [How to create an API access token](https://docs.guestway.io/account-and-administration/api-access/how-to-create-an-api-access-token.md).

{% hint style="success" %}
Rotate tokens on a schedule, and always after a token may have leaked.
{% endhint %}
{% endstep %}

{% step %}

### Update your integration

Put the new token in your integration.
{% endstep %}

{% step %}

### Check that it works

Make sure the requests succeed. On the **API Access** tab, **Last Used** of the new token shows when it was used.
{% endstep %}

{% step %}

### Delete the old token

Delete the old token as described below.
{% endstep %}
{% endstepper %}

## Revoke a token

{% stepper %}
{% step %}

### Find the token

Go to **Settings** → **Organization** → **API Access**, tab **API Access**.

{% hint style="success" %}
Check **Last Used**. A token that has not been used for months can probably go.
{% endhint %}
{% endstep %}

{% step %}

### Delete the token

Click the trash icon on the token, then **Delete**. In the table view, click **Delete Access Token**, then **Confirm**.

{% hint style="danger" %}
A deleted token is gone for good and cannot be restored. Every integration that uses it stops working at once.
{% endhint %}
{% endstep %}
{% endstepper %}

## Change the permissions instead

{% stepper %}
{% step %}

### Edit the token

If the token only needs other permissions, keep it. Click the token, click the pencil on **Information**, change the **Permissions** and save with the check icon.
{% endstep %}
{% endstepper %}

## Related

* [API access](https://docs.guestway.io/account-and-administration/api-access.md)
* [How to create an API access token](https://docs.guestway.io/account-and-administration/api-access/how-to-create-an-api-access-token.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.guestway.io/account-and-administration/api-access/how-to-rotate-or-revoke-an-api-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
