List secret keys for a keyset

Retrieves all secret keys associated with a keyset. By default, all secret keys (including expired ones) are returned. Set activeOnly=true to return only active secret keys.

Path Parameters
keysetId string REQUIRED

a string to be decoded into a number

Query Parameters
activeOnly string

Possible values: [true, false]

Header Parameters
PubNub-Version string REQUIRED

Possible values: [2025-11-15]

Responses
200

Success

Schema OPTIONAL
secretKeys object[]
secretKey string

The secret key value

expiresAt date-time

Possible values: Value must match regular expression ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$

Expiration timestamp in ISO 8601 UTC format (e.g., "2025-12-31T23:59:59Z"). Null means the secret key never expires.

400

Bad Request Error

Schema OPTIONAL
statusCode number
error string

Possible values: [BadRequest]

message string[]
401

UnauthorizedError

Schema OPTIONAL
statusCode number
error string

Possible values: [Unauthorized]

message string[]
403

ForbiddenError

Schema OPTIONAL
statusCode number
error string

Possible values: [Forbidden]

message string[]
404

NotFoundError

Schema OPTIONAL
statusCode number
error string

Possible values: [NotFound]

message string[]
500

InternalErrorError

Schema OPTIONAL
statusCode number
error string

Possible values: [InternalError]

message string[]
* required
PubNub-Version*
Type: string
Possible values: [2025-11-15]
* required
keysetId*
Type: string
activeOnly
Type: string
secretKeys
Type: array
Array items:
items
Type: object
Example Response
{
  "secretKeys": [
    {
      "secretKey": "sec-c-abc123",
      "expiresAt": "2025-12-31T23:59:59Z"
    },
    {
      "secretKey": "sec-c-def456",
      "expiresAt": null
    }
  ]
}
statusCode
Type: number
error
Type: string
Enum (1 values)
View all values
"BadRequest"
message
Type: array
Array items:
items
Type: string
statusCode
Type: number
error
Type: string
Enum (1 values)
View all values
"Unauthorized"
message
Type: array
Array items:
items
Type: string
statusCode
Type: number
error
Type: string
Enum (1 values)
View all values
"Forbidden"
message
Type: array
Array items:
items
Type: string
statusCode
Type: number
error
Type: string
Enum (1 values)
View all values
"NotFound"
message
Type: array
Array items:
items
Type: string
statusCode
Type: number
error
Type: string
Enum (1 values)
View all values
"InternalError"
message
Type: array
Array items:
items
Type: string