CorefinityCorefinityDocs
Open the Control PanelControl Panel
SSH keys · 7 of 14

Rotate an environment's host keys

Starts or moves on a host-key rotation of a CoreStack or CoreCluster environment: stage offers new host keys beside the current ones, finish switches to them, cancel drops a staged rotation and now switches at once, so every client then sees a changed host key. Type the environment's name in confirm_environment; an environment takes six rotation steps an hour.

POST/api/environments/{environment}/ssh/host-keys/rotation

Path parameters

environmentintegerRequired

The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.

Body

actionstringRequired

stage offers new host keys beside the current ones. finish switches to the staged keys. cancel drops a staged rotation. now makes new keys and switches at once.

stagenowfinishcancel
confirm_environmentstringRequired

The environment's name, exactly as GET /environments/{environment}/ssh answers it.

Returns

202 The rotation step was started. rotation_id is the rotation's id and rotation is the rotation as it stands. Follow it by reading GET /environments/{environment}/ssh/host-keys until rotation.state is done, cancelled, aborted or failed for the same rotation.rotation_id; a staged rotation waits in offered until it is finished or its day comes. change_id is always 0: a rotation is not a change that GET /ssh/changes/{change} answers. Poll the operation until it finishes.

Fields of the 202 answer
change_idintegerRequired

Always 0. A rotation is followed by its rotation_id, not as a change.

rotationobject or any or nullRequired

The rotation as it stands. Null only when it could not be read back; read the host keys instead.

rotation_idstringRequired

The rotation's id, the same value as rotation.rotation_id in the host keys.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
404not_foundNot found.
409ssh_rotation_in_progressA host-key rotation is already in progress. Wait for it to finish, or finish or cancel it.
422confirm_mismatchSend the confirmation exactly as the field named in field asks for it.
422invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
422ssh_host_keys_unmanagedHost keys on this environment are managed by Corefinity. Nothing to rotate here.
422ssh_rotation_unavailableThe environment cannot rotate its host keys now, or there is no staged rotation to finish or cancel. Read the host keys again.
429ssh_throttledToo many host-key rotations on this environment. Try again later.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/environments/1311/ssh/host-keys/rotation \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "now",
    "confirm_environment": "Production"
  }'
{
  "change_id": 0,
  "rotation": {
    "id": 3301,
    "last_error_public": null,
    "mode": "staged",
    "offered_at": "2026-11-06T09:20:00+00:00",
    "promote_after": "2026-11-13T09:20:00+00:00",
    "rotation_id": "hkr-0f1e2d3c4b5a",
    "state": "offered"
  },
  "rotation_id": "hkr-0f1e2d3c4b5a"
}
Try it

Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT