> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.oktivo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate Token

> Invalidate current token and generate a new one.

## Path Parameters

**tokenId** `string` *required*

The unique identifier of the token to rotate.

## Response

The response is identical to [Create Token](https://stage-docs.oktivo.com/api-reference/authentication/create-token.md) a new plaintext token is returned exactly once.

**success** `boolean`

Indicates if the request was successful.

**data** `object`

**data properties**

**tokenId** `string`

The same token ID (unchanged).

**name** `string`

The token's name (unchanged).

**prefix** `string`

New prefix for the rotated token.

**plainToken** `string`

The new plaintext API token. **Store it securely the old token is immediately invalidated.**

**expiresAt** `string`

ISO 8601 timestamp expiry is reset based on original configuration.

```json 200 Success theme={null}
{
  "success": true,
  "data": {
    "tokenId": "tok_abc123def456",
    "name": "salesforce-integration",
    "prefix": "okt_n3w1",
    "plainToken": "okt_n3w1t0k3nv4lu3h3r3a1b2c3d4e5f6g7h8i9j0",
    "expiresAt": "2025-07-15T00:00:00.000Z"
  }
}
```

```json 404 Not Found theme={null}
{
  "success": false,
  "message": "Token not found or already deleted"
}
```

> [!WARNING]
>
> The old token **stops working immediately** after rotation. Update all integrations with the new token value before the old one is rotated.

> [!NOTE]
>
> This endpoint requires **JWT authentication**.


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