> This page is for version 0.10.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.10: https://docs.nvidia.com/nemo-helix/v0.10/llms.txt
> - 0.9: https://docs.nvidia.com/nemo-helix/v0.9/llms.txt
> - 0.8: https://docs.nvidia.com/nemo-helix/v0.8/llms.txt
> - 0.7: https://docs.nvidia.com/nemo-helix/v0.7/llms.txt
> - 0.6: https://docs.nvidia.com/nemo-helix/v0.6/llms.txt
> - 0.5: https://docs.nvidia.com/nemo-helix/v0.5/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server.

# Rotate Access Key

POST http://localhost:8080/apis/auth/v2/access-keys/{jti}/rotate
Content-Type: application/json

Reference: https://docs.nvidia.com/nemo-helix/documentation/reference/api-reference/scoped-access-keys/rotate-access-key-apis-auth-v-2-access-keys-jti-rotate-post

## Authentication

- `Authorization` header (bearer token, required) — Supply a raw Helix access token. The Authorization header's Bearer prefix is added automatically.

## Request

### Path parameters

- `jti` (string, required) — Stable JWT ID of the Scoped Access Key for the lifecycle operation.

### Body (application/json)

This endpoint expects an AccessKeyRotateRequest.

- `grace_period_seconds` (integer, optional, nullable) — Grace period in seconds for the rotated-out key. Omit to use auth.access_keys.rotation_grace_period_seconds. Subject to auth.access_keys.max_rotation_grace_period_seconds.

## Response

### 200

Successful Response

- `new_key` (AccessKeyCreateResponse, required) — Newly minted successor Scoped Access Key. Its raw token is returned only once.
- `previous_jti` (string, required) — Stable JWT ID of the Scoped Access Key that was rotated out.
- `previous_status` (enum, required) — Effective status of the rotated-out key immediately after this request. Normally ROTATING, but may already read as REVOKED or EXPIRED if reconciling this request's outcome was itself delayed past the grace deadline or a concurrent revoke.
  - Allowed values: `ACTIVE`, `EXPIRED`, `REVOKED`, `SUSPENDED`, `ROTATING`
- `grace_period_seconds` (integer, required) — Seconds the rotated-out key remains usable before it is treated as revoked.
- `grace_period_expires_at` (datetime, optional, nullable) — Timestamp when the rotated-out key's grace period expires.

## Errors

### 400 Bad Request Error

Scoped Access Key rotation error

- `detail` (string, required)
- `code` ("access_keys_disabled", optional, nullable) — Set to access_keys_disabled when the Scoped Access Key feature is disabled.

### 404 Not Found Error

Scoped Access Keys are not enabled or the key was not found

- `detail` (string, required)
- `code` ("access_keys_disabled", optional, nullable) — Set to access_keys_disabled when the Scoped Access Key feature is disabled.

### 409 Conflict Error

Invalid or concurrent access-key state transition

- `detail` (string, required)
- `code` ("access_keys_disabled", optional, nullable) — Set to access_keys_disabled when the Scoped Access Key feature is disabled.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 501 Not Implemented Error

Not Implemented

- `detail` (string, required)

## Types

### AccessKeyCreateResponse

Create response. The token value is returned only once.

- `jti` (string, required) — Stable JWT ID for this Scoped Access Key.
- `principal` (string, required) — Principal ID stamped into the token.
- `status` (enum, required)
  - Allowed values: `ACTIVE`, `EXPIRED`, `REVOKED`, `SUSPENDED`, `ROTATING`
- `issuer` (string, required) — Issuer stamped into the Scoped Access Key JWT.
- `audiences` (list of string, required) — Audiences accepted for the Scoped Access Key JWT.
- `created_at` (datetime, required)
- `token` (string, required)
- `token_type` ("Bearer", required)
- `name` (string, optional, nullable) — Optional human-readable Scoped Access Key label.
- `description` (string, optional, nullable) — Human-readable description of the Scoped Access Key.
- `entity_type` (enum, optional, default: USER) — Whether the key is bound to a user or a non-human service account.
  - Allowed values: `USER`, `SERVICE_ACCOUNT`
- `scope` (list of string, optional) — Services this key is restricted to. An empty list means the key is unscoped.
- `expires_at` (datetime, optional, nullable)
- `grace_period_expires_at` (datetime, optional, nullable) — Timestamp when the rotated-out key's grace period expires.
- `last_used_at` (datetime, optional, nullable) — Timestamp of the most recent successful authentication with this Scoped Access Key.
- `service_attributes` (map from string to map from string to any, optional) — Attributes platform services signed into the key, by service name. Read-only to the key's owner.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "new_key": {
    "jti": "string",
    "principal": "string",
    "status": "ACTIVE",
    "issuer": "string",
    "audiences": [
      "string"
    ],
    "created_at": "2024-01-15T09:30:00Z",
    "token": "string",
    "token_type": "string",
    "name": "string",
    "description": "string",
    "entity_type": "USER",
    "scope": [
      "string"
    ],
    "expires_at": "2024-01-15T09:30:00Z",
    "grace_period_expires_at": "2024-01-15T09:30:00Z",
    "last_used_at": "2024-01-15T09:30:00Z",
    "service_attributes": {}
  },
  "previous_jti": "string",
  "previous_status": "ACTIVE",
  "grace_period_seconds": 1,
  "grace_period_expires_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/apis/auth/v2/access-keys/jti/rotate"

payload = {}
headers = {
    "Authorization": "Bearer <accessToken>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:8080/apis/auth/v2/access-keys/jti/rotate';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <accessToken>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```