# Remove an SFTP key

Page: https://app.myclaimhouse.com/docs/api/removeSftpKey

`DELETE /api/v1/sftp-account/keys/{id}`

Removes the key: it can no longer log in. A session already open stays open until the client disconnects or has been idle 15 minutes. Removing a key that is already gone is not found.

Needs a key with `submit` permission.

## Request

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | An SFTP key ID (sfk_...). |

## Response

The key that was removed. Status `200`.

| Name | Type | Description |
| --- | --- | --- |
| `id` | string | An ID that starts with sfk_. |
| `object` | string | Always `sftp_key`. |
| `deleted` | boolean | Always `true`. |

## Errors

| HTTP status | Code | What it means |
| --- | --- | --- |
| 401 | `UNAUTHORIZED` | A valid API key is required. Send it as "Authorization: Bearer <key>". |
| 403 | `PERMISSION_DENIED` | This API key is not allowed to do that. |
| 404 | `NOT_FOUND` | Not found. |
| 422 | `INVALID_REQUEST` | The request is not valid. |
| 429 | `TOO_MANY_REQUESTS` | Too many requests of this kind lately. Wait, then try again. |
| 504 | `TIMEOUT` | The request took too long. Send it again with the same Idempotency-Key and body after Retry-After seconds: a 409 means it is still finishing (wait and send again), and any other answer is final. If this 504 comes back, find what the request made by listing with ?idempotency_key=<the key>. |
| 500 | `INTERNAL` | Something went wrong on our side. Quote the request ID if you contact us. |

## Example

### Example request

```bash
curl -X DELETE "https://app.myclaimhouse.com/api/v1/sftp-account/keys/sfk_01JM000000E00800000000008H" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY"
```

### Example response: 200

```json
{
  "id": "sfk_01JM000000E00800000000008H",
  "object": "sftp_key",
  "deleted": true
}
```
