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

# Validate External Key

`$client->organization->externalKeys->validate(string externalKeyID): ExternalKeyValidateResponse`

**POST** `/v1/organizations/external_keys/{external_key_id}/validate`

Validate an external key config against the customer's KMS.

Anthropic performs an encrypt/decrypt roundtrip against the configured
KMS key and waits up to 30 seconds for the result. The response status is
`success` if the roundtrip succeeded, or `failure` with an error
message if it failed or timed out.

## Parameters

- `externalKeyID: string` (path parameter)

  ID of the External Key.

## Returns

- `class ExternalKeyValidateResponse`

  - `"external_key_validation" type`

  - `?string error`

    Error message when status is `failure`. Null otherwise.

  - `Status status`

    `success` — encrypt/decrypt roundtrip succeeded. `failure` — the roundtrip failed or timed out; see `error`.

## Example

```php
<?php

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

use Anthropic\Client;

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

$response = $client->organization->externalKeys->validate('external_key_id');

var_dump($response);
```

### Response (200)

```json
{
  "error": "error",
  "status": "failure",
  "type": "external_key_validation"
}
```
