Skip to content

API Reference / Workspaces

Rotate a workspace encryption key

Generates a fresh encryption key for the workspace so new sensitive data is protected under the latest key. Returns the previous and new key versions.

POST/accounts.v1.Accounts/RotateWorkspaceKey

Request body

application/jsonRequired

Request to generate a new version of the caller's current workspace encryption key, the key that protects the workspace's stored secrets. Rotation fails once the key version reaches 255.

No fields.

Response body

application/json

Success

fromVersion?integer

Previously-current DEK version.

Format"int32"

toVersion?integer

Newly-current DEK version.

Format"int32"

workspaceId?string

Opaque 16-byte identifier of the workspace whose key was rotated, base64-encoded in JSON.

Format"byte" base64

curl -X POST "https://api.goldmine.to/accounts.v1.Accounts/RotateWorkspaceKey" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "workspaceId": "AAECAwQFBgcICQoLDA0ODw==",
  "fromVersion": 1,
  "toVersion": 2
}