> For the complete documentation index, see [llms.txt](https://api.senderwiz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.senderwiz.com/admin/customer-api/delete-a-customer-api-key.md).

# Delete a Customer API Key

Safely remove a customer API key via Admin API and revoke access tied to the deleted key. Supports fine-grained access control.

### 🗑️ Delete a Customer API Key

Remove a specific customer API key using the Admin API key. This revokes access associated with the deleted key.

#### 🔹 HTTP Request

`DELETE ADMIN-API-URL/customers/CUSTOMER-UID/api-keys/KEY-ID`&#x20;

#### 🔸 URL Segments

| Segment        | Type   | Required | Description                       |
| -------------- | ------ | -------- | --------------------------------- |
| `CUSTOMER-UID` | string | Yes      | Unique identifier of the customer |
| `KEY-ID`       | string | Yes      | ID of the API key to be deleted   |

#### 🔐 Authorization Header

`X-ADMIN-API-KEY: your-admin-api-key-here`

#### 🔄 Fields Available for Update

| Field         | Type      | Required | Description                             |
| ------------- | --------- | -------- | --------------------------------------- |
| name          | string    | No       | A label or title for the API key        |
| description   | string    | No       | Short description for internal use      |
| ip\_whitelist | string\[] | No       | List of IPs allowed to use this key     |
| ip\_blacklist | string\[] | No       | List of IPs blocked from using this key |

#### ✅ JSON Request Payload Example

```json
{
  "name": "My site",
  "description": "This key is used on my site",
  "ip_whitelist": ["123.123.123.123", "111.111.111.111"],
  "ip_blacklist": ["231.231.231.231", "222.222.222.222"]
}
```

#### 💻 PHP Example

```php
$response = $endpoint->deleteApiKey('ab382plq98zr7', '45');

echo '<hr /><pre>';
print_r($response->body);
echo '</pre>';
```

#### 📦 Sample JSON Response

```json
{
  "status": "success",
  "message": "Customer API key deleted successfully."
}
```
