---
updatedAt: 2026-05-13T09:04:27.000Z
---

# Refresh JWT

Refresh the JWT used to authenticate calls to the Bot v3 API

# Details

[block:callout]
{
  "type": "success",
  "title": "Best Practice",
  "body": "We *strongly* recommend automating the JWT refresh so that bots do not make calls with a stale token."
}
[/block]

Refresh the [JWT](https://developer.khoros.com/khoroscaredevdocs/docs/jwt-authentication) used for HTTP authentication to Bot APi v3 by making a PUT request to `/bots/v3/tokens/appId/appId`.

The call returns a new token with a new expiration stamp (`expiresAtMillis`). The token may be refreshed at any time prior to expiration. Once an old token is submitted for a refresh, it will remain valid for a grace period of 10 minutes. Once the 10-minute window passes, only the new token returned by the call will be valid.

# Related endpoints

| Action | Endpoint                                                                                                                     |
| ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| GET    | [/tokens/khorosapi/ownerId/{ownerId}](https://developer.khoros.com/khoroscaredevdocs/reference/tokenskhorosapiowneridownerid-get)<br />Return whether a JWT exists for an entity  |
| POST   | [/tokens/khorosapi/ownerId/{ownerId}](https://developer.khoros.com/khoroscaredevdocs/reference/tokenskhorosapiowneridownerid-post)<br />Generate a JWT token                      |
| DELETE | [/bots/v3/tokens/appId/{appId}](https://developer.khoros.com/khoroscaredevdocs/reference/tokensappid-delete)<br />Invalidate the JWT used to authenticate calls to the Bot v3 API |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "bot-api-v3",
    "version": "1.1"
  },
  "servers": [
    {
      "url": "https://api.app.lithium.com/bots/v3"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/tokens/appId/{appId}": {
      "put": {
        "summary": "Refresh JWT",
        "description": "Refresh the JWT used to authenticate calls to the Bot v3 API",
        "operationId": "tokensappid-put",
        "parameters": [
          {
            "name": "appId",
            "in": "path",
            "description": "The `appId` of the bot defined in the bot registration",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"data\": {\n    \"token\": \"[NEW TOKEN]\",\n    \"expiresAtMillis\": 1560276824632\n  },\n  \"requestId\": \"bcefbedf-45bb-11e9-b37c-1b28a88f8a21\"\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "token": {
                          "type": "string",
                          "example": "[NEW TOKEN]"
                        },
                        "expiresAtMillis": {
                          "type": "integer",
                          "example": 1560276824632,
                          "default": 0
                        }
                      }
                    },
                    "requestId": {
                      "type": "string",
                      "example": "bcefbedf-45bb-11e9-b37c-1b28a88f8a21"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"message\": \"Unauthorized\",\n    \"requestId\": \"d3cf183a-4f30-11e9-bc72-cd9609519b63\"\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "example": "Unauthorized"
                        },
                        "requestId": {
                          "type": "string",
                          "example": "d3cf183a-4f30-11e9-bc72-cd9609519b63"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "security": [],
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X PUT \\\n  https://api.app.lithium.com/bots/v3/tokens/appId/appId \\\n  -H \"Content-type: application/json; charset=utf-8\" \\\n  -H \"Authorization: Bearer [TOKEN TO BE REFRESHED]\""
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "Authorization",
        "value": "Bearer [TOKEN]"
      },
      {
        "key": "Content-type",
        "value": "application/json; charset=utf-8"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```