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

# Delete External Key

`client.Organization.ExternalKeys.Delete(ctx, externalKeyID) (*OrganizationExternalKeyDeleteResponse, error)`

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

  maxLength: 2048

## Returns

- `type OrganizationExternalKeyDeleteResponse`

  - `Type ExternalKeyDeleted`

    default: external_key_deleted

  - `ID string`

    ID of the deleted External Key.

## Example

```go
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	externalKey, err := client.Organization.ExternalKeys.Delete(context.TODO(), "external_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", externalKey.ID)
}
```

### Response (200)

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