---
updatedAt: 2026-11-10T18:08:54.000Z
agentTools:
  projectIndex: https://docs.flexfactor.io/llms.txt
---

# Delete an API key

This endpoint revokes a specific API key in your partner account, identified by its unique API Key ID ({id}).

> ❗️ Not yet available
>
> `DELETE /v1/api-keys/{id}` returns `404` in Sandbox and Production until the endpoint is enabled on the FlexFactor API. This page describes the request and response the endpoint uses once it is enabled. This page is hidden until then.

* [Request](#request)
* [Response](#response)
* [Payload examples](#payload-examples)

***

# Request

## Details

| Environment                | HTTP Method | Endpoint                                             |
| :------------------------- | :---------- | :--------------------------------------------------- |
| **Sandbox testing**        | DELETE      | `https://api-sandbox.flexfactor.io/v1/api-keys/{id}` |
| **Production environment** | DELETE      | `https://api.flexfactor.io/v1/api-keys/{id}`         |

***

## Required Keys

| Parameter          | Description                                                                                                                       |
| :----------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
| **`{id}`**         | Path parameter. The `id` (GUID) of the API key to revoke, as returned by [List of API keys](https://docs.flexfactor.io/docs/list-of-api-keys).              |
| **`bearer token`** | The authentication token returned by `/oauth2/token` for your partner credentials. The token needs the `api-client.manage` scope. |

***

## Body

This API does not require body parameters.

***

# Response

A successful request returns `200 OK` with the standard envelope.

### Field Definitions

| Field Name         | Type    | Description                                              |
| :----------------- | :------ | :------------------------------------------------------- |
| `success`          | Boolean | `true` when the key was revoked.                         |
| `result`           | String  | `null` on this endpoint.                                 |
| `status`           | String  | `null` on this endpoint.                                 |
| `statusCode`       | String  | `null` on this endpoint. It is not the HTTP status code. |
| `errors`           | Array   | Empty on success.                                        |
| `customProperties` | Object  | Empty on this endpoint.                                  |

***

> ❗️ Notes
>
> * Deleting a key revokes it. The key stays in [List of API keys](https://docs.flexfactor.io/docs/list-of-api-keys) for your partner account with `status: Revoked` and a `revokedAt` timestamp, and it no longer appears in the merchant's key list.
> * A revoked key cannot be restored. Use this endpoint with caution.
> * Ensure proper handling of key deletions to avoid disrupting active integrations.

***

## HTTP status codes

| Situation                                              | HTTP  | Body                                                                             |
| :----------------------------------------------------- | :---- | :------------------------------------------------------------------------------- |
| Key revoked                                            | `200` | The envelope with `success: true`                                                |
| No key matches `{id}` in your partner account          | `400` | Validation problem details with the message `API key not found or access denied` |
| The key is already revoked                             | `400` | Validation problem details with the message `API key is already revoked`         |
| The bearer token is not a partner token                | `400` | The message `Partner ID not found in token claims`                               |
| Missing, invalid, or expired bearer token              | `401` | —                                                                                |
| The token does not carry the `api-client.manage` scope | `403` | —                                                                                |
| `{id}` is not a GUID                                   | `404` | —                                                                                |

***

# Payload Examples

## Request

#### cURL Request Example

```bash
curl --request DELETE \
     --url https://api-sandbox.flexfactor.io/v1/api-keys/{id} \
     --header 'Authorization: Bearer {the token returned by /oauth2}' \
     --header 'accept: application/json'
```

***

## Response

#### JSON Example for a Successful Deletion

```json
{
   "success": true,
   "result": null,
   "status": null,
   "statusCode": null,
   "errors": [],
   "customProperties": {}
}
```

#### JSON Example for a Failed Deletion

```json
{
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "": [
      "API key is already revoked"
    ]
  }
}
```

***

## Example for Handling Errors

* If no key matches the API Key ID in your partner account, the API returns a 400 error with the message `API key not found or access denied`.
* If the bearer token is missing, invalid, or expired, the API returns a 401 error with an empty body.