---
title: ユーザープロファイルを管理する
url: https://platform.claude.com/docs/ja/manage-claude/user-profiles/manage-profiles
description: Anthropicがお客様のエンドカスタマーのいずれかを制限または禁止しているかどうかを確認し、エンドカスタマーの詳細情報が変更されたときにユーザープロファイルを更新し、ユーザープロファイルを削除します。
---

[各エンドカスタマーのユーザープロファイルを作成](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#create-a-profile-for-each-end-customer)した後は、Anthropicがそのいずれかを制限または禁止しているかどうかを確認できます。また、エンドカスタマーの詳細情報が変更されたときにユーザープロファイルを更新することもできます。エンドカスタマーが離脱したときやデータの消去を求めてきたときには、ユーザープロファイルを削除できます。

## 始める前に

次の2つが必要です。

* **ユーザープロファイルのID：** ユーザープロファイルの作成時に保存した`uprof_` IDです。このページの例では、変数からIDを読み取ります。
* **ユーザープロファイルを作成した組織の認証情報：** ユーザープロファイルの作成に使用した認証情報を使用してください（[ユーザープロファイルを作成してリクエストを帰属させる](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#before-you-begin)を参照）。

## Anthropicがユーザープロファイルを制限または禁止しているかどうかを確認する

Anthropicは、お客様のエンドカスタマーのいずれかを制限または禁止することがあります。「enforcement action」（執行措置、以下「措置」）とは、そのエンドカスタマーのユーザープロファイルに対する制限または禁止です。措置が開いている間、AnthropicはユーザープロファイルのIDを含む推論リクエストの一部またはすべてを拒否します。お客様の他のエンドカスタマーのリクエストは影響を受けません。

* **制限**は、終了するまでAnthropicがエンドカスタマーにサービスを提供する方法を制限するもので、一部のリクエストは引き続き成功する場合があります。
* **禁止**は、禁止が適用される範囲でAnthropicがエンドカスタマーへのサービス提供を停止し、そこで再びサービスを提供する予定がないことを意味します。終了日はなく、エンドカスタマーが解除することはできません。

### 開いている措置があるユーザープロファイルを見つける

確認する方法は2つあります。

* **1つのユーザープロファイル：** [`GET /v1/user_profiles/{id}`](https://platform.claude.com/docs/ja/api/user_profiles/retrieve)で取得します。
* **開いている措置があるすべてのユーザープロファイル：** `enforcement_status[]=restricted`と`enforcement_status[]=banned`を指定して[ユーザープロファイルを一覧表示](https://platform.claude.com/docs/ja/api/user_profiles/list)します。

リストのレスポンスには、リストが終わる前でも`limit`より少ないユーザープロファイルしか含まれない場合や、1つも含まれない場合があるため、`next_page`が`null`になるまでページのリクエストを続けてください。

措置が開いたときや終了したときを把握するには、定期的にユーザープロファイルを一覧表示してください。`enforcement_status`と`enforcement_actions`を前回確認した値と比較します。ユーザープロファイルがリストから外れた場合、そのユーザープロファイルには開いている措置がないか、削除されています。これらのフィールドの変更によって`updated_at`が確実に更新されるとは限らないため、変更の検出をこの値に頼らないでください。

Anthropicは、これらの変更に対するWebhookイベントを送信しません。

### 執行措置のフィールドを読み取る

作成、取得、更新、または一覧表示のレスポンスに含まれる各ユーザープロファイルには、`enforcement_status`と`enforcement_actions`の2つのフィールドがあります。レスポンスにどちらも含まれていない場合は、[執行措置のフィールドがない場合](https://platform.claude.com/docs/ja/manage-claude/user-profiles/manage-profiles#if-the-enforcement-fields-are-missing)を参照してください。Claude Platform on AWSでは、これらのフィールドは措置を報告しません（[Claude Platform on AWSを使用する場合](https://platform.claude.com/docs/ja/manage-claude/user-profiles/manage-profiles#if-you-use-claude-platform-on-aws)を参照）。

両方のフィールドはAnthropicが設定するため、作成または更新のリクエストにいずれかのフィールドが含まれている場合、APIは`400`を返します。

次の例は、取得したユーザープロファイル上のこれら2つのフィールドを示しており、その他のフィールドの大部分は省略しています。

```json
{
  "type": "user_profile",
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "enforcement_status": "restricted",
  "enforcement_actions": [
    {
      "type": "restriction",
      "id": "enac_011CZkZEq4TnWb7xLfRgPm2v",
      "reason": "fraud_or_abuse",
      "action": null,
      "opened_at": "2026-10-02T19:30:00Z",
      "expires_at": null
    }
  ]
}
```

`enforcement_status`は、開いている措置を1つの値にまとめます。

* `unrestricted`：開いている措置はありません。
* `restricted`：少なくとも1つの措置が開いており、そのいずれも禁止ではありません。
* `banned`：禁止が開いています。

`enforcement_status`は、アカウントに関するお客様自身の判断を記録する`external_user_details.account_status`とは別のものです。

`enforcement_actions`は開いている措置を一覧表示し、措置がない場合は空になります。措置は終了するとリストから外れるため、履歴が必要な場合は、読み取った措置を保存してください。各措置には次のフィールドがあります。

* `type`：`restriction`または`ban`。
* `id`：措置のIDで、`enac_`で始まります。
* `reason`：Anthropicが措置を開いた理由です。`unsupported_region`、`fraud_or_abuse`、`high_harm`、`usage_policy_violation`、`account_compromise`、`unspecified`のいずれかです。
* `action`：エンドカスタマーが措置を解除するためにできることです。常に`null`です。
* `opened_at`：Anthropicが措置を開いた日時です。
* `expires_at`：措置が自動的に終了する日時です。措置に終了日がない場合は`null`です。

Anthropicはこれらのフィールドに値を追加する場合があるため、コードが[認識できない値](https://platform.claude.com/docs/ja/manage-claude/user-profiles/manage-profiles#if-a-field-has-a-value-that-you-dont-recognize)を処理できるようにしてください。

## ユーザープロファイルを更新する

エンドカスタマーの詳細情報やアカウントステータスが変更された場合、たとえば企業がブランド名を変更した場合やお客様がアカウントを停止した場合は、ユーザープロファイルを更新してください。[`POST /v1/user_profiles/{id}`](https://platform.claude.com/docs/ja/api/user_profiles/update)は、送信したフィールドのみを変更します。

* `name`と[`access_type`](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#decide-who-gets-a-profile)は、保存されている値を置き換えます。
* [`external_user_details`](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#what-to-tell-anthropic-about-an-end-customer)で送信した各フィールドは、保存されている値を置き換えます。APIは`null`を`400`で拒否するため、値をクリアすることはできません。
* `metadata`はキーごとにマージされます。送信したキーは保存されている値を上書きし、空の文字列はキーを削除し、省略したキーはそのまま残ります。

このページのcURLサンプルは、[workload identity federation](https://platform.claude.com/docs/ja/manage-claude/workload-identity-federation#authenticate-from-your-workload)（ワークロードアイデンティティフェデレーション）のトークンなどのアクセストークンを`ANTHROPIC_AUTH_TOKEN`から送信します。この変数はフェデレーション環境変数およびフェデレーションプロファイルよりも優先されるため、サンプルを実行するシェルでのみ設定してください。

次の例では、アカウントを停止済みとしてマークし、`trial_cohort`メタデータキーを削除します。

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/user_profiles/$PROFILE_ID" \
    -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2026-10-21" \
    -H "content-type: application/json" \
    -d '{
      "external_user_details": {"account_status": "suspended"},
      "metadata": {"trial_cohort": ""}
    }'
  ```

  ```bash CLI
  ant user-profiles update \
    --user-profile-id "$PROFILE_ID" \
    --external-user-details '{account_status: suspended}' \
    --metadata '{trial_cohort: ""}'
  ```

  ```python Python
  client = anthropic.Anthropic()

  profile = client.user_profiles.update(
      profile_id,
      external_user_details={"account_status": "suspended"},
      metadata={"trial_cohort": ""},
  )

  print(profile)
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const profile = await client.userProfiles.update(profileId, {
    external_user_details: { account_status: "suspended" },
    metadata: { trial_cohort: "" }
  });

  console.log(profile);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var profile = await client.UserProfiles.Update(profileId, new()
  {
      ExternalUserDetails = new()
      {
          AccountStatus = UserProfileExternalUserAccountStatus.Suspended
      },
      Metadata = new Dictionary<string, string> { ["trial_cohort"] = "" }
  });

  Console.WriteLine(profile);
  ```

  ```go Go
  client := anthropic.NewClient()

  profile, err := client.UserProfiles.Update(
  	context.Background(),
  	profileID,
  	anthropic.UserProfileUpdateParams{
  		ExternalUserDetails: anthropic.UserProfileExternalUserDetailsParams{
  			AccountStatus: anthropic.UserProfileExternalUserAccountStatusSuspended,
  		},
  		Metadata: map[string]string{"trial_cohort": ""},
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(profile)
  ```

  ```java Java
  import com.anthropic.core.JsonValue;
  import com.anthropic.models.userprofiles.UserProfileExternalUserAccountStatus;
  import com.anthropic.models.userprofiles.UserProfileExternalUserDetailsParams;
  import com.anthropic.models.userprofiles.UserProfileUpdateParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = UserProfileUpdateParams.builder()
          .userProfileId(profileId)
          .externalUserDetails(UserProfileExternalUserDetailsParams.builder()
              .accountStatus(UserProfileExternalUserAccountStatus.SUSPENDED)
              .build())
          .metadata(UserProfileUpdateParams.Metadata.builder()
              .putAdditionalProperty("trial_cohort", JsonValue.from(""))
              .build())
          .build();
      var profile = client.userProfiles().update(params);

      IO.println(profile);
  }
  ```

  ```php PHP
  $client = new Client();

  $profile = $client->userProfiles->update(
      $profileId,
      externalUserDetails: ['accountStatus' => 'suspended'],
      metadata: ['trial_cohort' => ''],
  );

  echo json_encode($profile, JSON_PRETTY_PRINT), PHP_EOL;
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  profile = client.user_profiles.update(
    profile_id,
    external_user_details: { account_status: :suspended },
    metadata: { trial_cohort: "" }
  )

  puts profile
  ```
</CodeGroup>

## ユーザープロファイルを削除する

[`DELETE /v1/user_profiles/{id}`](https://platform.claude.com/docs/ja/api/user_profiles/delete)は、ユーザープロファイルと、`name`、`external_user_details`、`metadata`を含むそのユーザープロファイルに対して提供した詳細情報を削除します。ただし、AnthropicがそのユーザープロファイルIDについて保持している信頼と安全に関する記録は削除されません。ユーザープロファイルは、Claude APIとClaude Platform on AWSで削除できます。

エンドカスタマーがアカウントを閉鎖した場合、またはデータの消去を求めてきた場合は、ユーザープロファイルを削除してください。

* **顧客が離脱する場合：** その顧客のリクエストでユーザープロファイルのIDを送信するのを停止してから、ユーザープロファイルを削除してください。
* **消去リクエストの後も顧客が引き続きサービスを利用する場合：** 新しいユーザープロファイルを作成し、その顧客のリクエストを新しいIDに切り替えてから、古いユーザープロファイルを削除してください。

顧客が引き続き利用し、ワークスペースに古いユーザープロファイルがアタッチされている場合、そのワークスペースは新しいIDを含むリクエストを拒否します。切り替える前に、[ワークスペースにユーザープロファイルがアタッチされている場合](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#if-a-workspace-has-a-profile-attached)を参照してください。

<Warning>
  削除は元に戻せません。
</Warning>

次の例では、ユーザープロファイルを削除します。

<CodeGroup>
  ```bash cURL
  curl -X DELETE "https://api.anthropic.com/v1/user_profiles/$PROFILE_ID" \
    -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \
    -H "anthropic-version: 2026-10-21"
  ```

  ```bash CLI
  ant user-profiles delete --user-profile-id "$PROFILE_ID"
  ```

  ```python Python
  client = anthropic.Anthropic()

  deleted = client.user_profiles.delete(profile_id)

  print(deleted.id)
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const deleted = await client.userProfiles.delete(profileId);

  console.log(deleted.id);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var deleted = await client.UserProfiles.Delete(profileId);

  Console.WriteLine(deleted.ID);
  ```

  ```go Go
  client := anthropic.NewClient()

  deleted, err := client.UserProfiles.Delete(
  	context.Background(),
  	profileID,
  	anthropic.UserProfileDeleteParams{},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(deleted.ID)
  ```

  ```java Java
  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var deleted = client.userProfiles().delete(profileId);

      IO.println(deleted.id());
  }
  ```

  ```php PHP
  $client = new Client();

  $deleted = $client->userProfiles->delete($profileId);

  echo $deleted->id, PHP_EOL;
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  deleted = client.user_profiles.delete(profile_id)

  puts deleted.id
  ```
</CodeGroup>

レスポンスは、`"type": "user_profile_deleted"`とともにIDを返します。削除でサーバーエラーが返された場合は、再試行してください。再試行で`404`が返された場合は、最初の削除が完了していることを意味します。

削除後、ユーザープロファイルエンドポイントはそのIDに対して`404`を返します。最大約10分間は、削除されたIDを含む推論リクエストが引き続き成功する場合があります。その後、[すべてのリクエストでIDを確認するプラットフォーム](https://platform.claude.com/docs/ja/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400)は、そのリクエストを`400`で拒否します。Claude Models on Google Cloud (Google managed)はユーザープロファイルを照会しないため、引き続きそのIDを受け入れます。Amazon Bedrockも、[ユーザープロファイルIDを受け入れるモデル](https://platform.claude.com/docs/ja/manage-claude/user-profiles/platforms#amazon-bedrock-models)では同様です。

## ルールと特殊なケース

### フィールドに認識できない値がある場合

認識できない値は、次のように扱ってください。

| フィールド | 値の扱い |
| ----- | ----- |
| `enforcement_status` | `restricted` |
| `enforcement_actions[].type` | `restriction` |
| `enforcement_actions[].reason` | `unspecified` |
| `enforcement_actions[].action` | `null` |

### 執行措置のフィールドがない場合

レスポンスに`enforcement_status`も`enforcement_actions`も含まれていない場合は、リクエストの`anthropic-beta`ヘッダーを確認してください。`user-profiles-2026-09-04`ベータおよびそれ以前のユーザープロファイルベータでは、両方のフィールドが省略され、`enforcement_status[]`リストフィルターが`400`を返します。そのベータを削除し、その他のベータはそのまま残してください。

SDKまたはCLIでは、`client.beta.user_profiles` (typescript: `client.beta.userProfiles`; csharp, go: `client.Beta.UserProfiles`; java: `client.beta().userProfiles()`; php: `$client->beta->userProfiles`; cli: `ant beta:user-profiles`)の代わりに`client.user_profiles` (typescript: `client.userProfiles`; csharp, go: `client.UserProfiles`; java: `client.userProfiles()`; php: `$client->userProfiles`; cli: `ant user-profiles`)を呼び出してください。ベータ名前空間は`user-profiles-2026-08-18`ベータを送信するためです。

### Claude Platform on AWSを使用する場合

[Claude Platform on AWS](https://platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws)では、執行措置のフィールドは措置を報告しません。`enforcement_status`は常に`unrestricted`であり、`enforcement_actions`は常に空です。また、そこでは、Anthropicは開いている措置を理由にリクエストを拒否しません。
