Claude Platform Docs

Update External Key

BetaExternalKey beta().organization().externalKeys().update(ExternalKeyUpdateParamsparams = ExternalKeyUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/organizations/external_keys/{external_key_id}

Partially update an external key config. Omitted fields are left unchanged.

display_name is always editable. geo and provider_config cannot be changed once any workspace references this config, because previously encrypted data requires the original key identity to decrypt.

Parameters
ExternalKeyUpdateParams params
Optional<String> externalKeyId

ID of the External Key.

maxLength2048
Optional<String> displayName

Human-friendly display name.

maxLength255
minLength1
Optional<Geo> geo

Data residency geo. Only us is supported.

US("us")
Optional<ProviderConfig> providerConfig

KMS provider identity and auth coordinates.

class BetaAwsExternalKeyConfig:
String kmsArn

Full ARN of the AWS KMS key.

maxLength2048
JsonValue type "aws"constant
Optional<String> region

AWS region. Derived from kms_arn if omitted.

Optional<String> roleArnDeprecated

IAM role ARN. Deprecated — Anthropic reaches the KMS key via a managed intermediate role; this field is ignored.

class BetaGcpExternalKeyConfig:
String keyName

Full resource name of the Cloud KMS key.

JsonValue type "gcp"constant
class BetaAzureExternalKeyConfigParam:

Azure Key Vault provider configuration.

String keyName

Name of the key within the vault.

String tenantId

Azure AD tenant ID.

JsonValue type "azure"constant
String vaultUri

Key Vault data-plane URI — https://{vault-name}.vault.azure.net or https://{hsm-name}.managedhsm.azure.net.

Optional<String> clientId

Azure AD application (client) ID. Omit to use Anthropic's multitenant app. Provide only if using a single-tenant app registration in the customer's directory.

Returns
class BetaExternalKey:

CMEK external key config belonging to the caller's organization.

Configs are organization-scoped. Workspaces attach to a config; once any workspace references it, the provider fields become effectively immutable (existing encrypted data needs the config for decrypt).

Update External Key

package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.externalkeys.BetaExternalKey;
import com.anthropic.models.beta.organization.externalkeys.ExternalKeyUpdateParams;

public final class Main {
    private Main() {}

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

        BetaExternalKey betaExternalKey = client.beta().organization().externalKeys().update("external_key_id");
    }
}
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
Returns Examples
{
  "id": "ekey_01SDCCSbTxrXDpWc1phhtcfK",
  "attachment": {
    "type": "attached"
  },
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "prod-us-key",
  "geo": "us",
  "provider_config": {
    "kms_arn": "arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222",
    "type": "aws",
    "region": "us-east-1",
    "role_arn": "arn:aws:iam::111122223333:role/anthropic-cmek"
  },
  "type": "external_key",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}