CorefinityCorefinityDocs
Open the Control PanelControl Panel
Access · 6 of 7

Delete an SSH or SFTP user

Removes a named user and its keys. confirm_username is optional; when you send it, it must be the user's username. The built-in web user cannot be removed.

DELETE/api/corestack/sites/{site}/access/users/{user}

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

userintegerRequired

The id of one of the site's users, as GET /corestack/sites/{site}/access answers it. Digits only. At least 1.

Body

confirm_usernamestring

The user's username, exactly. Checked only while SSH keys are on for your company.

Returns

202 The removal was started. user.status is removing until the operation completes. Poll the operation until it finishes.

Fields of the 202 answer
operationobjectRequired

A change the Control Panel is making or has made. A save or an action that starts work answers one in operation; read it again by id with GET /corestack/operations/{operation} until status is completed or failed. Both answers have this shape; the few endpoints that answer a different one say so.

Fields
applied_atstring or null
can_retryboolean or null
clusterobject or any or null

The cluster the operation runs on.

committed_atstring or null
completed_atstring or nullRequired
created_atstring or nullRequired
environmentobject or any or null
errorstring or nullRequired

Why the operation failed, in plain words. Null unless status is failed.

failure_reasonstring or null

A stable code for the failure.

from_versionstring or null
hotboolean or null

True when the change applies without a maintenance window.

idintegerRequired
installobject or null
labelstring or null
notesarray of objects

What the operation did differently on purpose. Empty when nothing.

Fields of each item
codestringRequired
textstringRequired
parent_operation_idinteger or null
requested_byany

Who asked for the change.

reset_targetany

Present on some site creations and copies.

resultany

Always null here. A one-time result is read once with the reveal endpoint.

result_statestring
nonependingavailableviewed
retried_by_operation_idinteger or null
retries_operation_idinteger or null
retry_requiresany

What a retry needs first, if anything.

revealedany

Who revealed a one-time result and when, when there was one.

scopestringRequired
siteclusterbatch
siteobject or any or null

The website the operation belongs to. Null for a cluster's own operation.

statusstringRequired

Where a change is. completed and failed are final; every other status means the change is still running and blocks another change to the same site.

pendingcommittedrolling_outexecutingcompletedfailed
status_labelstringRequired
stepstring or null

The key of the step the operation is at. Null once it has completed.

stepsarray of objectsRequired
Fields of each item
keystring
labelstring
statestring

One of done, current, todo, failed or skipped.

subjectobject or null
summarystring or null
to_versionstring or null
typestringRequired

The kind of change, such as crons_change or redirects_change.

type_labelstringRequired
userobjectRequired

The built-in web user, or a named SSH or SFTP user.

Fields
can_changebooleanRequired
can_deletebooleanRequired
connectionobjectRequired
Fields
commandstring or nullRequired

The ssh command. Null for an SFTP user.

sftp_commandstring or nullRequired
created_atstring or nullRequired
created_byobject or any or nullRequired
idintegerRequired

The id the /access/users/{user} endpoints take.

keysarray of objectsRequired

The user's keys. While SSH keys are on for your company, web lists every key that can log in as it, from every level.

Fields of each item
added_atstring or nullRequired
added_byobject or any or nullRequired
bitsinteger or nullRequired
can_deletebooleanRequired

Whether this endpoint group can remove the key. Other keys are removed where they were added.

commentstring or nullRequired

The comment at the end of the key line, when it had one.

company_key_idinteger or nullRequired
fingerprintstringRequired

The SHA-256 fingerprint, as ssh-keygen -lf prints it.

idintegerRequired

The id DELETE /corestack/sites/{site}/access/keys/{key} takes. 0 for the Corefinity deploy key.

namestringRequired
originobject

Sent while SSH keys are on for your company. The level the key comes from.

Fields
layerstringRequired
agencycompanywebsiteenvironmentuserlegacysystem
ownerobject or any or nullRequired
restrictedbooleanRequired

True when the key carries restrictions from before it was imported. Only Corefinity changes those.

restrictionsarray of stringsRequired
sourcestringRequired

company is a company key. system is the Corefinity deploy key. Everything else reads user.

usercompanysystem
statusstringRequired
pendingappliedfailedremoving
status_labelstringRequired
typestringRequired

The key type, such as ssh-ed25519 or ssh-rsa.

kindstringRequired

built_in is web. It cannot be changed or removed.

built_innamed
labelstring or nullRequired
passwordobjectRequired

Whether the user has a password. The password itself is never answered here.

Fields
setbooleanRequired
set_atstring or nullRequired
set_byobject or any or nullRequired
root_pathstring or nullRequired

The folder an SFTP user is limited to, relative to the site.

root_path_absolutestring or nullRequired

The same folder as a path on the server.

statusstringRequired

pending until the change that made or changed the user is live.

pendingappliedfailedremoving
status_labelstringRequired
typestringRequired
sshsftp
type_labelstringRequired
uidinteger or nullRequired

The user's numeric id on the server.

usernamestringRequired

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.
403restrictedRestricted keys are changed by staff.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409busyAnother operation is running on the site. Wait for it to finish.
409in_useIt is still in use, still being removed, or managed somewhere else. Read the message: wait for the removal, remove what uses it first, or remove it where the message says.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409ssh_key_duplicateThe key is already added here. Use the existing one.
422invalidFix the field named in field; errors says why.
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_person_managed_elsewhereThat username belongs to a person's own SSH login, managed in their profile. Choose another name.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.
503noneTry again shortly.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X DELETE https://manage.corefinity.com/api/corestack/sites/1042/access/users/3418 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm_username": "supplier"
  }'
{
  "operation": {
    "applied_at": null,
    "can_retry": false,
    "cluster": {
      "id": 17,
      "name": "WordPress Cluster 1"
    },
    "committed_at": "2026-11-05T09:16:40Z",
    "completed_at": null,
    "created_at": "2026-11-05T09:16:40Z",
    "environment": {
      "env_id": "rs-northwind-harbourandfinch-example-com",
      "hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
      "id": 1042,
      "name": "Production",
      "role": "production",
      "role_label": "Production",
      "slug": "production"
    },
    "error": null,
    "failure_reason": null,
    "from_version": null,
    "hot": true,
    "id": 145,
    "install": null,
    "label": "Picked up by the platform",
    "notes": [],
    "parent_operation_id": null,
    "requested_by": {
      "id": 2011,
      "name": "Maya Okafor"
    },
    "reset_target": null,
    "result": null,
    "result_state": "none",
    "retried_by_operation_id": null,
    "retries_operation_id": null,
    "retry_requires": null,
    "revealed": null,
    "scope": "site",
    "site": {
      "domain": "harbourandfinch.example.com",
      "id": 1042
    },
    "status": "committed",
    "status_label": "Waiting for the platform",
    "step": "applied",
    "steps": [
      {
        "key": "saved",
        "label": "Saved",
        "state": "done"
      },
      {
        "key": "applied",
        "label": "Picked up by the platform",
        "state": "current"
      },
      {
        "key": "live",
        "label": "Live",
        "state": "todo"
      }
    ],
    "subject": null,
    "summary": "Remove user supplier",
    "to_version": null,
    "type": "users_change",
    "type_label": "SSH / SFTP users"
  },
  "user": {
    "can_change": false,
    "can_delete": false,
    "connection": {
      "command": "ssh -p 20101 [email protected]",
      "sftp_command": "sftp -P 20101 [email protected]"
    },
    "created_at": "2026-11-02T10:15:00+00:00",
    "created_by": {
      "id": 2011,
      "name": "Maya Okafor"
    },
    "id": 3418,
    "keys": [
      {
        "added_at": "2026-11-03T10:02:44+00:00",
        "added_by": null,
        "bits": null,
        "can_delete": true,
        "comment": null,
        "company_key_id": null,
        "fingerprint": "SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0",
        "id": 7312,
        "name": "Supplier laptop",
        "restricted": false,
        "restrictions": [],
        "source": "user",
        "status": "applied",
        "status_label": "Applied",
        "type": "ssh-ed25519"
      }
    ],
    "kind": "named",
    "label": "Print supplier",
    "password": {
      "set": false,
      "set_at": null,
      "set_by": null
    },
    "root_path": null,
    "root_path_absolute": null,
    "status": "removing",
    "status_label": "Removing",
    "type": "ssh",
    "type_label": "SSH + SFTP",
    "uid": 20001,
    "username": "supplier"
  }
}
Try it

Try it is off for this endpointIt deletes 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