Management

Rolls (rotates) the secret API key associated with the specified project, generating a new key value while deprecating the previous one. The new key becomes immediately active. This endpoint requires the write:all scope.

If the project cannot be found, a 404 error response is returned. An optional expirationIn parameter can be provided in the request body to set when the previous key should expire.

post/management/projects/{projectId}/api-keys/secret/roll

Request

  • Base URL: https://api.liveblocks.io/v2
  • URL: https://api.liveblocks.io/v2/management/projects/{projectId}/api-keys/secret/roll
  • Auth: none declared

Path parameters

projectIdstring required

ID of the project

Example:683d49ed6b4d1cec5a597b13

Request body

expirationIn'now' | '1h' | '1hour' | '1 hour' | '24hrs' | '24hours' | '24 hours' | '3d' | '3days' | '3 days' | '7d' | '7days' | '7 days'
newKeyExpirationIn'now' | '5m' | '5min' | '5 minutes' | '3m' | '3min' | '3 minutes' | '1h' | '1hour' | '1 hour' | '48h' | '48hrs' | '48hours' | '48 hours' | '24hrs' | '24hours' | '24 hours' | '3d' | '3days' | '3 days' | '7d' | '7days' | '7 days' | '21d' | '21days' | '21 days' | '30d' | '30days' | '30 days' | '1y' | '1year' | '1 year' | 'one year'

Example request

{
  "expirationIn": "3 days",
  "newKeyExpirationIn": "30 days"
}

Response

Success. Returns the rolled secret key.

Example response

{
  "secretKey": {
    "createdAt": "2024-09-03T12:34:56.000Z",
    "value": "sk_dev_123"
  }
}

Changes

    • info

      added the new 21 days enum value to the request property

    • info

      added the new 21d enum value to the request property

    • info

      added the new 21days enum value to the request property

    • info

      added the new 3 minutes enum value to the request property

    • info

      added the new 3m enum value to the request property

    • info

      added the new 3min enum value to the request property

    • info

      added the new 48 hours enum value to the request property

    • info

      added the new 48h enum value to the request property

    • info

      added the new 48hours enum value to the request property

    • info

      added the new 48hrs enum value to the request property

    • info

      added the new 5 minutes enum value to the request property

    • info

      added the new 5m enum value to the request property

    • info

      added the new 5min enum value to the request property

    • info

      added the new optional request property