Rotate a Valkey instance's credentials

Generate a new auth_token. The previous token keeps working for 24 hours, until rotating_until. A second rotation in that time stops the oldest token at once. Open connections stay open. The instance must be running or degraded.

POST https://{availability_zone}.betterstackcloud.com/v1/valkey/{id}/credentials/rotate
id string required

The ID of the Valkey instance to rotate.

Authorization string required

Bearer $TOKEN

202 Accepted
{
  "user": "jane@example.com",
  "auth_token": "abcdef123456",
  "uri": "example",
  "tls_uri": "example",
  "ca_certificate": "example",
  "rotating_until": "2026-07-01T12:00:00.000Z"
}

Returns the new credentials as one object.

user string

The username, always default.

auth_token string

The new AUTH token.

uri string

A valkey:// URI for your private networks, with the new auth_token in it.

tls_uri string or null

A valkeys:// URI for the public TLS endpoint, with the new auth_token in it, or null when public_access is off.

ca_certificate string or null

The CA certificate to verify the public TLS endpoint with, in PEM format, or null when public_access is off.

rotating_until datetime or null

Until when the previous token still works, 24 hours from now. In ISO 8601 format, such as 2026-07-01T12:00:00Z.