---
title: "Delete a user's key"
url: https://docs.corefinity.com/api/reference/access/delete-site-access-key
type: endpoint
last_updated: 2026-11-13
feature: access
related:
  - https://docs.corefinity.com/guides/sites/access-and-security/connection-details.md
---
# Delete a user's key

Removes a key of one of the site's users. `confirm_fingerprint` is optional; when you send it, it must be the
key's fingerprint. On the built-in `web` user, only a key the list marks `can_delete` is removed here,
answered as `DELETE /ssh/keys/{key}` answers and counted against the limit on key changes (30 a minute for
you, 120 for your company); company, website and personal keys are removed where they were added.

```http
DELETE /api/corestack/sites/{site}/access/keys/{key}
```

- Scope: `write`
- Two-factor: required on your account (all)
- Rate limit: 30 a minute; 30 a minute for each person; 120 a minute for each company
- Long-running: answers with an operation to poll
- Try it in the console: off. It deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.
- `key` (integer, required): The id of a key, as a user's `keys` list answers it. Digits only.

## Body

- `confirm_fingerprint` (string): The key's fingerprint, exactly. Checked only while SSH keys are on for your company.

## Request

### curl

```bash
curl -X DELETE https://manage.corefinity.com/api/corestack/sites/1042/access/keys/7312 \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "confirm_fingerprint": "SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0"
  }'
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->delete('https://manage.corefinity.com/api/corestack/sites/1042/access/keys/7312', [
        'confirm_fingerprint' => 'SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0',
    ]);

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/access/keys/7312', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
    Accept: 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    confirm_fingerprint: 'SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0',
  }),
});

// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);
```

### Python

```python
import os
import requests

res = requests.delete(
    "https://manage.corefinity.com/api/corestack/sites/1042/access/keys/7312",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
    json={
        "confirm_fingerprint": "SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0",
    },
)

data = res.json() if res.content else None
```

## Responses

### 202 The removal was started. For a named user's key the answer is the key, with the status `removing`, and its `operation`. For a key of the built-in `web` user, while SSH keys are on, it is a `change_id`.

```json
{
  "key": {
    "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": "removing",
    "status_label": "Removing",
    "type": "ssh-ed25519"
  },
  "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": 147,
    "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 key \"Supplier laptop\" from supplier",
    "to_version": null,
    "type": "keys_change",
    "type_label": "SSH keys"
  }
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use: `write`, or `exec` for a generated password), your company requires two-factor authentication and you have not set it up, your account has no company that can use Managed Clusters (`company_not_enabled`), or the key carries restrictions that only Corefinity changes (`restricted`).

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 409 The change was refused because of the site's state. `reason` says why: `busy` (another change to this site is running), `in_use` (the user or key is still being removed, or the key is a company, website or personal key that is removed where it was added), `not_imported` (the site's keys are not managed here yet), `removed` (the site has been removed), `conflict` (the site changed while the change was being saved) or `managed_elsewhere` (another control panel manages the site). A change that could not be saved answers a message only, and a refusal after the change was recorded also carries the failed `operation`. A key of the built-in `web` user, while SSH keys are on, is refused as the SSH keys API refuses it: `ssh_key_duplicate` or `ssh_managed_on_another_environment`.

```json
{
  "code": "busy",
  "message": "Another change to this site is in progress. Wait for it to finish.",
  "reason": "busy"
}
```

### 422 `confirm_fingerprint` is not the key's fingerprint (`confirm_mismatch`), the request body is not valid JSON (`invalid_arguments` on `body`), or the key belongs to a person's own SSH username (`ssh_person_managed_elsewhere`).

```json
{
  "code": "confirm_mismatch",
  "errors": {
    "confirm_fingerprint": [
      "Type the key's fingerprint exactly to remove it."
    ]
  },
  "field": "confirm_fingerprint",
  "message": "Type the key's fingerprint exactly to remove it.",
  "reason": "confirm_mismatch"
}
```

### 429 Too many requests (`rate_limited`): wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats. A key of the built-in `web` user, while SSH keys are on, also counts against the limit on key changes, 30 a minute for you and 120 a minute for your company (`ssh_throttled`, with no wait given: try again in a minute).

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

### 502 The platform could not be reached, or did not save the change. Try again in a minute.

```json
{
  "message": "The platform could not be reached. Try again in a minute."
}
```

### 503 The platform is not ready to apply changes to users and keys. The change was recorded and failed, and the failed `operation` is in the answer. There is no `reason` or `code`. Contact support.

```json
{
  "message": "The platform deploy key is not configured. Contact support."
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | Send a valid token as `Authorization: Bearer <token>`. |
| 403 | `company_unavailable` | Your company is unavailable. |
| 403 | `scope_required` | Use a token with the scope named in `scope`. |
| 403 | `restricted` | Restricted keys are changed by staff. |
| 403 | `two_factor_required` | Turn on two-factor on your account, then send again. |
| 404 | `feature_off` | This feature is not on for your organisation yet. |
| 409 | `busy` | Another operation is running on the site. Wait for it to finish. |
| 409 | `in_use` | It 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. |
| 409 | `managed_elsewhere` | This site is read-only here. Change it in the control panel that manages it. |
| 409 | `ssh_key_duplicate` | The key is already added here. Use the existing one. |
| 422 | `confirm_mismatch` | Send the confirmation exactly as the field named in `field` asks for it. |
| 422 | `invalid_arguments` | The 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. |
| 422 | `ssh_person_managed_elsewhere` | That username belongs to a person's own SSH login, managed in their profile. Choose another name. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |
| 429 | `ssh_throttled` | Too many SSH key changes — try again in a minute. |
| 502 |  | Read the message; it says what happened. |
| 503 |  | Try again shortly. |

## The same task elsewhere

- Guide: [Connection details](https://docs.corefinity.com/guides/sites/access-and-security/connection-details.md)
