# Rotate a Service Account Key

This article explains how to rotate the API key for a service account in the MSP Portal. Key rotation invalidates the existing key and generates a new one.

:::check Required Permissions
Only users with the **Rotate Service Account Secret** permission can rotate secrets.
:::

:::caution[]
Rotating a key will immediately invalidate the existing key. Existing integrations using the old key will stop working until updated.
:::

# Rotate a Service Account Key

:::note[]
**This is the only time the secret will be visible!** Please store it in a secure location. If you lose the secret, you will need to generate a new one and update all integrations that used the old one.
:::
To generate a new authentication key and invalidate the existing one for a service account, follow the steps below:
<Tabs>
  <Tab title="MSP Portal">
    <Steps>
      <Step>
        Sign in to the **[WatchDog MSP Portal](https://app.watchdogsecurity.io/)**
      </Step>
      <Step>
        From the account context switcher, select the MSP Portal
      </Step>
      <Step>
        From the Left Hand Navigation Menu, select **Users**
      </Step>
      <Step>
        Select the **Service Accounts** tab.
      </Step>
       <Step>
        (Optional) Under **Node,** select the node the user belongs under
      </Step>
       <Step>
        Locate the service account you want to edit.
      </Step>
       <Step>
        In the **Actions** column, click the **⋮ (Actions Menu)**.
      </Step>
       <Step>
        Select 🗘 **Rotate Token**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

A new API key is generated and displayed once.
