Claude Platform Docs

Validar chave externa

$client->beta->organization->externalKeys->validate(string externalKeyID): ExternalKeyValidateResponse
POST/v1/organizations/external_keys/{external_key_id}/validate

Valide uma configuração de chave externa em relação ao KMS do cliente.

A Anthropic realiza um ciclo de criptografia/descriptografia com a chave KMS configurada e aguarda até 30 segundos pelo resultado. O status da resposta é success se o ciclo foi bem-sucedido, ou failure com uma mensagem de erro se falhou ou expirou.

Parameters
externalKeyID: string

ID of the External Key.

Returns
class ExternalKeyValidateResponse { $type = 'external_key_validation'; $error; $status; }
"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.

Validar chave externa
<?php

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

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

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

var_dump($response);
Returns Examples
Response 200
{
  "error": "error",
  "status": "failure",
  "type": "external_key_validation"
}