---
title: Delete External Key
url: https://platform.claude.com/docs/en/api/php/organization/external_keys/delete
---

# Delete External Key

`$client->organization->externalKeys->delete(string externalKeyID): ExternalKeyDeleteResponse`

**DELETE** `/v1/organizations/external_keys/{external_key_id}`

Delete an external key config.

The request is rejected if any workspace still references this config.

## Parameters

- `externalKeyID: string` (path parameter)

  ID of the External Key.

## Returns

- `class ExternalKeyDeleteResponse`

  - `"external_key_deleted" type`

  - `string id`

    ID of the deleted External Key.

## Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$externalKey = $client->organization->externalKeys->delete('external_key_id');

var_dump($externalKey);
```

### Response (200)

```json
{
  "id": "ekey_01AbCdEfGhIjKlMnOpQrStUv",
  "type": "external_key_deleted"
}
```
