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

# JWT credentials: refresh app credentials after changing the JWT signing secret

> See which secret signed each app's Teable access token and AI access key, re-sign and redeploy in bulk after a JWT signing secret change, and confirm that live apps run on the new credentials.

> [!TIP]
>
> Available for self-hosted Business plan and above

Path: System Admin → Key rotation → JWT credentials

Apps built with [App Builder](https://help.teable.ai/en/basic/ai/app-builder.md) hold two long-lived credentials: the Teable access token stored on the app, and the AI access key written into its runtime when it is deployed. Both are signed with the JWT signing secret (`BACKEND_JWT_SECRET`, or `SECRET_KEY` when that is not set). After that secret changes, an app needs new credentials to keep reaching Teable. This page does that in bulk.

## When to use it

* The JWT signing secret changed. That includes removing `BACKEND_JWT_SECRET` so that it follows `SECRET_KEY`, and changing `SECRET_KEY` itself. See [Secret convergence](https://help.teable.ai/en/deploy/secret-convergence.md) for the order of the steps.
* Variables in an app's deployment environment may have leaked, and its AI access key has to be invalidated.

## See where each app stands

For each app the list shows whether its Teable token was signed with the current secret or the old one, its publish state, when it was last deployed, and when its AI key expires. Filter with the buttons above the list:

| Filter | Apps in it |
| - | - |
| Needs attention | The Teable token was not signed with the current secret |
| Live credentials outdated | The credentials were replaced but the app was not redeployed, so the live app still uses the old ones, which no longer work |
| Refresh failed | The last refresh did not succeed |
| Published / Unpublished changes / All | By publish state |

## Refresh credentials after a secret change

1. When you change the secret, put the old value in `BACKEND_JWT_SECRET_OLD`. Existing tokens then stay valid until the refresh is done. Leave it out if the old value is public or has leaked: a value in `_OLD` is still accepted, so tokens forged with it would keep working. Apps then cannot reach Teable until they are refreshed, so do that right after the restart.
2. Under **Needs attention**, select all apps, click **Refresh app credentials**, and tick only **Teable access token**.
3. Wait for the queue to finish. A published app gets a new token and is redeployed when its turn comes, and its live AI key is signed with the new secret along the way. An unpublished app gets a new token, and its running preview picks it up in place.
4. Remove `BACKEND_JWT_SECRET_OLD` only after **Needs attention**, **Refresh failed** and **Live credentials outdated** are all empty. Use **Refresh app envs** for the apps in the last two.

Teable stores each app's token encrypted with a key derived from the JWT signing secret. Once the old value is gone, an app the refresh has not reached stops working; refreshing its token brings it back.

What to expect during a refresh:

* Each published app is redeployed once and fails requests only while its own redeploy runs.
* For an app with unpublished changes, the published version is redeployed and the unpublished changes stay as they are.
* Visitors of an app with sign-in enabled are signed out, because the app's sessions are signed with this token.

If variables in a deployment environment may have leaked, tick **AI access key** as well. The old key stops working at once, including the copies in the owner's local `.env` and in downloaded code.

## Spread out the redeploys

Deploy providers usually limit how many deployments one account can start. With **Spread out the redeploys** ticked, redeploys start in batches by time window, each window starting at most the number you set. The page tells you roughly when the last batch starts.

By default each server redeploys one published app at a time. With many apps, set the `APP_ENV_REFRESH_CONCURRENCY` environment variable (default `1`) to go faster, at the cost of that many builds running on each server at once.

## Handle apps that are not updated live

There are two ways to handle the apps under **Live credentials outdated**:

* **Refresh app envs** rebuilds the live runtime of a published app in place, with the current Teable token and a newly signed AI key. It creates no new version and does not affect the app's owner.
* **Check with deploy provider** is for apps you have already redeployed at the provider. It reads when the live deployment was built and when the credential variables were last updated, and moves the apps whose new credentials are confirmed live out of this filter. It only reads: nothing is redeployed and no variable value is read. Only apps deployed on Vercel are supported for now.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.