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

# Delete External Key

`ExternalKeyDeleteResponse organization().externalKeys().delete(params = ExternalKeyDeleteParams.none(), requestOptions = RequestOptions.none())`

**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

- `ExternalKeyDeleteParams params`

  - `Optional<String> externalKeyId` (path parameter)

    ID of the External Key.

    maxLength: 2048

## Returns

- `class ExternalKeyDeleteResponse`

  - `JsonValue type = "external_key_deleted"`

  - `String id`

    ID of the deleted External Key.

## Example

```java
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.organization.externalkeys.ExternalKeyDeleteParams;
import com.anthropic.models.organization.externalkeys.ExternalKeyDeleteResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AnthropicClient client = AnthropicOkHttpClient.fromEnv();

        ExternalKeyDeleteResponse externalKey = client.organization().externalKeys().delete("external_key_id");
    }
}
```

### Response (200)

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