---
source_url: https://www.pubnub.com/docs/admin-api/update-secret-key-expiration-time
title: Update secret key expiration time
---

# Update secret key expiration time

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

Updates the expiration time of a rotated secret key.

**Requirements:**

* A paid plan
* Secret key prefix must be in format `sec-c-{5chars}` (exactly 5 alphanumeric characters)
* Requested secret key must already have an expiration date
* New expiration must be at least 60 seconds in the future
* New expiration must be at most 366 days in the future

## Request

Example

```
{
  "secretKey": {
    "secretKey": "string",
    "expiresAt": "2024-01-01T00:00:00.000Z"
  }
}
```

Example

```
{
  "statusCode": 0,
  "error": "BadRequest",
  "message": [
    "string"
  ]
}
```

Example

```
{
  "statusCode": 0,
  "error": "Unauthorized",
  "message": [
    "string"
  ]
}
```

Example

```
{
  "statusCode": 0,
  "error": "Forbidden",
  "message": [
    "string"
  ]
}
```

Example

```
{
  "statusCode": 0,
  "error": "NotFound",
  "message": [
    "string"
  ]
}
```

Example

```
{
  "statusCode": 0,
  "error": "InternalError",
  "message": [
    "string"
  ]
}
```
