# Token Rotation

## Overview

You can rotate your Panther API token by calling the `rotateAPIToken` GraphQL API endpoint.

You can invoke Panther's API by using your Console's API Playground, or the GraphQL-over-HTTP API. Learn more about these methods on [Panther API](https://docs.panther.com/panther-developer-workflows/api/..#step-1-choose-a-method-for-invoking-the-api).

#### Rotate an API token

To rotate your Panther API token:

1. Perform the operation below to rotate the token.
   * ```graphql
     mutation rotateAPIToken() {
       rotateAPIToken() {
         token{ value }
       }
     }
     ```
   * Use the API token you'd like to rotate in the request headers.
   * The response payload will display the refreshed API token.
2. Copy the refreshed token—it will only be shown this once.

#### Example in the API Playground

Performed in the Panther Console's API Playground, `rotateAPIToken` looks like the following:

<figure><img src="https://4011785613-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LgdiSWdyJcXPahGi9Rs-2910905616%2Fuploads%2Fgit-blob-a7c0b9b35fd122d7b2567fdcd7974b1e3c040c20%2FScreenshot%202023-03-21%20at%2011.04.19%20AM.png?alt=media" alt="The API Playground page in the Console shows a rotateAPIToken call and response. There is a section at the bottom for Request Headers, and on the right a Documentation Explorer."><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.panther.com/panther-developer-workflows/api/graphql/token-rotation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
