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

Keep a Legacy SSH key

Keeps a Legacy key by giving it an owner, so it goes on working after the day Legacy keys end. owner is the environment the key is on, that environment's website or company, or yourself. Keeping it as a company key needs the Create Company SSH Keys permission.

POST/api/ssh/keys/{key}/keep

Path parameters

keyintegerRequired

The id of a key, as the key lists answer it in id. Digits only. At least 1.

Body

ownerobjectRequired

Where to keep the key. The owner of a key in a request.

Fields
idintegerRequired

The id of the environment, website or company. For user, your own user id, which GET /user/ssh answers in user_id. At least 1.

typestringRequired

The level the key is held at. user is yourself.

environmentwebsitecompanyuser

Returns

201 The key was kept. key is the key at its new owner.

Fields of the 201 answer
change_idinteger or nullRequired

The change to follow with GET /ssh/changes/{change}. Null when nothing needs applying.

converted_fromstring or nullRequired

The format the key was sent in, when it was converted to the one-line OpenSSH format: pem (BEGIN PUBLIC KEY), pem_rsa (BEGIN RSA PUBLIC KEY), ssh2 (BEGIN SSH2 PUBLIC KEY, RFC 4716), bare (the key data of one of those without its first and last lines) or wrapped (an OpenSSH line broken across lines). Null for a key sent as one OpenSSH line.

pempem_rsassh2barewrappednull
keyobjectRequired

A key held at one owner: a company, a website, an environment or a person.

Fields
added_atstringRequired

Format: date-time.

added_byobjectRequired

Who added a key or made a change.

Fields
formerbooleanRequired

True when the person has left the company.

namestring or nullRequired

Null when the person has been removed, or when Corefinity support made the change for nobody by name.

supportbooleanRequired

True when Corefinity support added the key or made the change. name is then the person it was done for, or null.

also_grantedarray of objectsRequired

Other places the same key is held that you can see.

Fields of each item
environmentsintegerRequired
layerstringRequired
agencycompanywebsiteenvironmentuserlegacysystem
ownerobjectRequired

Where a key is held: a company, a website, an environment or a person.

Fields
idintegerRequired

The id of the company, website, environment or user.

namestringRequired
typestringRequired
companywebsiteenvironmentuser
applies_toobject or any or nullRequired

Null for environment and personal keys.

bitsinteger or nullRequired

The key size, for RSA keys.

deliveryobjectRequired

Where the key works so far, counted over the environments it reaches.

Fields
appliedintegerRequired

Environments the key works on.

not_on_new_systemintegerRequired

Environments whose keys the Control Panel does not manage yet.

removedintegerRequired

For a key being removed, environments it no longer works on.

statestringRequired
appliedapplyingremovingfailedwaiting
totalintegerRequired

Environments the key reaches, without those in not_on_new_system.

waitingintegerRequired

Environments where the key, or its removal, waits for the environment to switch over or for a platform update.

waiting_platform_updateintegerRequired

How many of waiting wait for a platform update.

editablebooleanRequired

Whether you may rename the key or change where it applies.

fingerprintstringRequired

The SHA-256 fingerprint, as ssh-keygen -lf prints it. Removing the key, or narrowing where it applies, asks you to send it back.

idintegerRequired

The key id the /ssh/keys/{key} endpoints take.

last_used_atstring or nullRequired

Format: date-time.

layerstringRequired

The level the key is held at, as you see it. agency is a key of your agency.

agencycompanywebsiteenvironmentuserlegacysystem
legacyobject or any or nullRequired

Set for a Legacy key, else null.

lifecyclestringRequired

quarantined is a key Corefinity has stopped from working; quarantine_reason says why.

activeremovingquarantined
loginstring or nullRequired

The username the key logs in with: web, or the person's own username for a personal key (null until one is issued).

namestringRequired
ownerobjectRequired

Where a key is held: a company, a website, an environment or a person.

Fields
idintegerRequired

The id of the company, website, environment or user.

namestringRequired
typestringRequired
companywebsiteenvironmentuser
quarantine_reasonstring or nullRequired
reachobjectRequired

How far a key reaches.

Fields
clientsintegerRequired

Client companies an agency's key reaches.

environmentsintegerRequired
websitesintegerRequired
removablebooleanRequired

Whether you may remove the key.

restrictedbooleanRequired

True when the key carries restrictions from before it was imported.

restrictionsarray of stringsRequired

The restrictions as they are written in front of the key. Read-only.

typestringRequired

The key type, such as ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521 or ssh-rsa. A key imported from a server may carry an older type (ssh-dss) or a security-key type (sk-), which new keys may not.

ssh-ed25519ecdsa-sha2-nistp256ecdsa-sha2-nistp384ecdsa-sha2-nistp521ssh-rsassh-dss[email protected][email protected]
weakbooleanRequired

True for a key that would be refused if it were added today.

noticesarray of objectsRequired
Fields of each item
codestringRequired
also_grantedstays_restrictedconvertedweak_import
messagestringRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403forbiddenThe person is not allowed to do this.
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_key_duplicateThe key is already added here. Use the existing one.
409ssh_managed_on_another_environmentThis environment's SSH is managed on another environment. Make the change on the environment the answer names.
422ssh_legacy_endedThe Legacy key has already stopped working. Add the key again as a new key.
422ssh_not_legacyThat is not a Legacy key. Change it as an ordinary key.
429ssh_throttledToo many SSH key changes — try again in a minute.
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/ssh/keys/7305/keep \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "owner": {
      "id": 1204,
      "type": "company"
    }
  }'
{
  "change_id": 48214,
  "converted_from": null,
  "key": {
    "added_at": "2026-11-05T09:16:40+00:00",
    "added_by": {
      "former": false,
      "name": "Eleanor Finch",
      "support": false
    },
    "also_granted": [
      {
        "environments": 1,
        "layer": "environment",
        "owner": {
          "id": 1311,
          "name": "Production",
          "type": "environment"
        }
      }
    ],
    "applies_to": {
      "environment_ids": [],
      "mode": "all"
    },
    "bits": null,
    "delivery": {
      "applied": 0,
      "not_on_new_system": 0,
      "removed": 0,
      "state": "applying",
      "total": 1,
      "waiting": 0,
      "waiting_platform_update": 0
    },
    "editable": true,
    "fingerprint": "SHA256:Ploa6Hz7DwoHuC3xPgwJD+qGdTytelbFQ+lXDSmu+lY",
    "id": 7309,
    "last_used_at": null,
    "layer": "company",
    "legacy": null,
    "lifecycle": "active",
    "login": "web",
    "name": "deploy@build-server",
    "owner": {
      "id": 1204,
      "name": "Harbour & Finch",
      "type": "company"
    },
    "quarantine_reason": null,
    "reach": {
      "clients": 0,
      "environments": 1,
      "websites": 1
    },
    "removable": true,
    "restricted": false,
    "restrictions": [],
    "type": "ssh-ed25519",
    "weak": false
  },
  "notices": []
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT