---
title: エンドカスタマーへの帰属のためのユーザープロファイル
url: https://platform.claude.com/docs/ja/manage-claude/user-profiles
description: プラットフォームがサービスを提供するエンドカスタマーにAPIリクエストを帰属させることで、安全上の措置を組織全体ではなく1つのプロファイルに適用できるようにします。
---

「user profile」（ユーザープロファイル、以下「プロファイル」）は、各APIリクエストがどのエンドカスタマーのためのものかをAnthropicに伝えます。これにより、保留やブロックなどの「safety enforcement action」（安全上の措置）を、組織全体ではなく1つのエンドカスタマーに適用できます。その場合、残りのトラフィックは影響を受けません。

プラットフォームやゲートウェイを運営している場合、またはAPIアクセスを再販している場合、エンドカスタマーのために送信するリクエストは、お客様の組織のリクエストとして届きます。Anthropicは、APIトラフィックに対して自動化された安全分類器を実行しています。リクエストにプロファイルがない場合、1つのエンドカスタマーが組織全体に適用される措置を引き起こす可能性があります。

各エンドカスタマーを`POST /v1/user_profiles`で一度登録し、返される`uprof_` IDを保存します。その後、そのエンドカスタマーに代わって行うすべてのリクエストで、そのIDを`anthropic-user-profile-id`ヘッダーで送信します。

プロファイルは課金対象ではなく、料金にも影響しません。

## プロファイルを作成する対象を決める

プロファイルが何を表すかは、Claudeをどのように販売しているかによって異なります。つまり、お客様の製品を使用する個人か、お客様がAPIアクセスを再販する相手の企業かです。この2つのケースで、ほとんどのプラットフォームをカバーできます。プロファイルの`access_type`フィールドは、どちらに該当するかを示します。

| トラフィックの対象                                | プロファイル                                                                                                                                                    | `access_type`                                    |
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| お客様の製品に登録したユーザー                          | ユーザーごとに1つ。ユーザーの登録時に作成します。                                                                                                                                 | `application`（デフォルト。`access_type`を省略した場合に設定されます） |
| お客様がAPIアクセスを再販する相手の企業（ゲートウェイとして再販する場合など） | 企業ごとに1つ。企業内の個人ごとではありません。                                                                                                                                  | `passthrough`（デフォルトではないため、送信する必要があります）           |
| お客様自身の組織                                 | なし。Anthropicは、プロファイルIDのないリクエストをお客様自身の使用量としてカウントします。その使用は[別の組織](https://platform.claude.com/docs/ja/manage-claude/user-profiles#before-you-begin)で行ってください。 | 該当なし                                             |
| 組織内のワークスペース                              | 個別のプロファイルはありません。プロファイルは組織に属し、そのIDは組織内のどのワークスペースを経由するリクエストでも機能します。                                                                                         | 該当なし                                             |

## プロファイルの内容とAnthropicによる使用方法

プロファイルには、エンドカスタマーについてお客様が送信した情報と、Anthropicが設定する[プログラムステータス](https://platform.claude.com/docs/ja/manage-claude/user-profiles-verification-portal#after-the-end-customer-links-the-profile)のみが含まれます。会話の内容は含まれません。Anthropicは、お客様が送信した詳細情報を、リクエストの帰属、不正使用の監視、[利用ポリシー](https://www.anthropic.com/legal/aup)の執行のため、および信頼済みアクセスプログラムへの申請とアクセスを可能にするために使用します。Anthropicはこれらの詳細情報を検証しません。

Anthropicは[プライバシーポリシー](https://www.anthropic.com/legal/privacy)に従ってプロファイルを処理します。

## 始める前に

プロファイルは、次のいずれかで作成および管理します。

* Claude API上の組織。
* [Claude Platform on AWS](https://platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws)上の組織。呼び出し元のプリンシパルには[ユーザープロファイルのIAMアクション](https://platform.claude.com/docs/ja/api/claude-platform-on-aws-iam-actions#user-profiles)が必要です。
* Azureでホストされているものではなく、[Anthropicでホストされている](https://platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry#hosting-options)[Microsoft Foundry](https://platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry)デプロイメント。Claude APIまたはClaude Platform on AWS上の組織は必要ありません。推論に使用するのと同じベースURLと認証で、Foundryエンドポイントを使用してください。

Amazon BedrockとGoogle Cloudには`/v1/user_profiles`エンドポイントがありません。推論をそこで実行している場合は、Claude APIまたはClaude Platform on AWS上の組織でプロファイルを作成してください。Amazon Bedrockでは、プロファイルは[Claude in Amazon Bedrock](https://platform.claude.com/docs/ja/build-with-claude/claude-in-amazon-bedrock)でのみ機能します。[Amazon BedrockとGoogle Cloudでリクエストを帰属させる](https://platform.claude.com/docs/ja/manage-claude/user-profiles#attribute-requests-on-amazon-bedrock-and-google-cloud)を参照してください。

エンドカスタマーのために送信するトラフィックは1つの組織に、お客様自身の内部使用は別の組織に分けてください。プロファイルはワークスペースではなく組織に属するため、1つの組織内でワークスペースを分けるだけでは不十分です。ユーザープロファイルが必要なのは、エンドカスタマーのトラフィック用の組織だけです。Claude API上で別の組織を作成するには、Claudeヘルプセンターの[Creating and managing Workspaces in the Claude Console](https://support.claude.com/en/articles/9796807)の「How to create a new organization」セクションを参照してください。

例では、APIキーを使用してClaude APIを呼び出しています。[Admin APIキー](https://platform.claude.com/docs/ja/manage-claude/admin-api-keys)は必要ありません。Claude Platform on AWSでは、そのベースURLと認証を使用してください。

## 各エンドカスタマーのプロファイルを作成する

Claudeにトラフィックを送信するエンドカスタマーごとに、プロファイルを1つ作成します。顧客のオンボーディングフローで一度だけ作成してください。`POST /v1/user_profiles`は冪等ではないため、`reference_id`が既存のものと一致する場合でも、呼び出すたびに新しいプロファイルが作成されます。プロファイルのない既存のエンドカスタマーがいる場合は、このセクションの後半にある既存の顧客ベースの登録に関するガイダンスを参照してください。

次の例では、ゲートウェイを通じてAPIアクセスを購入する企業を登録するため、`access_type`を`passthrough`に設定しています。`application`プロファイルの場合は、`access_type`を省略し、`name`と`external_user_details`には企業ではなく1人のエンドユーザーについて記述します。2つのアクセスタイプの比較については、[プロファイルを作成する対象を決める](https://platform.claude.com/docs/ja/manage-claude/user-profiles#decide-who-gets-a-profile)を参照してください。

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/user_profiles \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "name": "Acme Analytics, Inc.",
      "access_type": "passthrough",
      "external_user_details": {
        "reference_id": "cust-8f2a1c",
        "country": "US"
      }
    }'
  ```

  ```bash CLI
  ant user-profiles create \
    --name "Acme Analytics, Inc." \
    --access-type passthrough \
    --external-user-details '{reference_id: cust-8f2a1c, country: US}'
  ```

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

  profile = client.user_profiles.create(
      name="Acme Analytics, Inc.",
      access_type="passthrough",
      external_user_details={"reference_id": "cust-8f2a1c", "country": "US"},
  )

  print(profile.id)
  ```

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

  const profile = await client.userProfiles.create({
    name: "Acme Analytics, Inc.",
    access_type: "passthrough",
    external_user_details: { reference_id: "cust-8f2a1c", country: "US" }
  });

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

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

  var profile = await client.UserProfiles.Create(new()
  {
      Name = "Acme Analytics, Inc.",
      AccessType = UserProfileAccessType.Passthrough,
      ExternalUserDetails = new()
      {
          ReferenceID = "cust-8f2a1c",
          Country = "US"
      }
  });

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

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

  profile, err := client.UserProfiles.New(context.Background(), anthropic.UserProfileNewParams{
  	Name:       anthropic.String("Acme Analytics, Inc."),
  	AccessType: anthropic.UserProfileAccessTypePassthrough,
  	ExternalUserDetails: anthropic.UserProfileExternalUserDetailsParams{
  		ReferenceID: anthropic.String("cust-8f2a1c"),
  		Country:     anthropic.String("US"),
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(profile.ID)
  ```

  ```java Java
  import com.anthropic.models.userprofiles.UserProfileAccessType;
  import com.anthropic.models.userprofiles.UserProfileCreateParams;
  import com.anthropic.models.userprofiles.UserProfileExternalUserDetailsParams;

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

      var params = UserProfileCreateParams.builder()
          .name("Acme Analytics, Inc.")
          .accessType(UserProfileAccessType.PASSTHROUGH)
          .externalUserDetails(UserProfileExternalUserDetailsParams.builder()
              .referenceId("cust-8f2a1c")
              .country("US")
              .build())
          .build();
      var profile = client.userProfiles().create(params);

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

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

  $profile = $client->userProfiles->create(
      name: 'Acme Analytics, Inc.',
      accessType: 'passthrough',
      externalUserDetails: ['referenceID' => 'cust-8f2a1c', 'country' => 'US'],
  );

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

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

  profile = client.user_profiles.create(
    name: "Acme Analytics, Inc.",
    access_type: :passthrough,
    external_user_details: { reference_id: "cust-8f2a1c", country: "US" }
  )

  puts profile.id
  ```
</CodeGroup>

レスポンスは新しいプロファイルです。

```json
{
  "type": "user_profile",
  "id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "name": "Acme Analytics, Inc.",
  "access_type": "passthrough",
  "external_user_details": {
    "reference_id": "cust-8f2a1c",
    "onboarded_at": null,
    "account_status": null,
    "entity_type": null,
    "country": "US",
    "name_hash": null,
    "email_hash": null
  },
  "metadata": {},
  "programs": {
    "cyber": null,
    "efs": null
  },
  "created_at": "2026-03-15T10:00:00Z",
  "updated_at": "2026-03-15T10:00:00Z"
}
```

`id`を顧客レコードに保存し、サービスインスタンスが独自にプロファイルを作成するのではなく、そこから読み取るようにしてください。プロファイルの取得、更新、削除はその`id`で行います。`programs`フィールドは読み取り専用で、帰属には使用されません。このフィールドには、Anthropicが運営する各プログラムにおけるエンドカスタマーのステータスが格納されます。値の意味については、[プロファイルに適用されるプログラム](https://platform.claude.com/docs/ja/manage-claude/user-profiles-verification-portal#after-the-end-customer-links-the-profile)を参照してください。

組織内のプロファイル数に上限はありませんが、プロファイルの作成にはレート制限があります。既存の顧客ベースを一括で登録する前に、Anthropicのアカウントチームにお問い合わせください。

### エンドカスタマーについてAnthropicに伝える内容

すべてのフィールドは任意です。`name`、`metadata`、および`external_user_details`内の次のフィールドを送信できます：`entity_type`、`country`、`reference_id`、`onboarded_at`、`account_status`、`name_hash`、`email_hash`。各フィールドの型、形式、長さの制限については、[プロファイルの作成](https://platform.claude.com/docs/ja/api/beta/user_profiles/create)リファレンスで説明しています。

フィールドを設定する際は、次のルールに従ってください。

* **不明な値：** 値がわからない場合は、プレースホルダーを送信するのではなく省略してください。`external_user_details`内の値は後で置き換えることができますが、クリアすることはできません。
* **企業名：** `passthrough`プロファイルの場合、わかっていれば企業の正式名称を`name`で送信してください。
* **国：** `country`には、お客様の国ではなく、エンドカスタマーの国を送信してください。
* **独自のID：** `reference_id`には、エンドカスタマーに対するお客様独自の安定した識別子を送信してください。一意である必要はありません。
* **共有できない名前とメールアドレス：** `name`を省略し、代わりに`external_user_details.name_hash`を送信してください。メールアドレスについては、`external_user_details.email_hash`を送信してください。プロファイルにはアドレス自体のフィールドはありません。
* **ハッシュ：** ハッシュは、お客様が選択した関数を使用してご自身で計算してください。ハッシュにより、どのプロファイルが名前やメールアドレスを共有しているかがAnthropicにわかります。同じ方法で計算された値のみが一致するため、すべてのプロファイルで同じ関数と、同じ大文字小文字および空白の正規化を使用してください。

## 各リクエストを帰属させる

エンドカスタマーに代わって行うすべてのリクエストで、プロファイルIDを`anthropic-user-profile-id`ヘッダーで送信してください。SDKとCLIには、このヘッダーを自動的に送信する引数があります：`user_profile_id` (java: `userProfileId`; php: `userProfileID`; csharp, go: `UserProfileID`; cli: `--user-profile-id`)。

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "anthropic-user-profile-id: uprof_011CZkZCu8hGbp5mYRQgUmz9" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "messages": [
        {"role": "user", "content": "Hello, Claude"}
      ]
    }'
  ```

  ```bash CLI
  ant messages create \
    --model claude-opus-5-5 \
    --max-tokens 1024 \
    --message '{role: user, content: "Hello, Claude"}' \
    --user-profile-id uprof_011CZkZCu8hGbp5mYRQgUmz9
  ```

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

  message = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      messages=[{"role": "user", "content": "Hello, Claude"}],
      user_profile_id="uprof_011CZkZCu8hGbp5mYRQgUmz9",
  )

  print(message)
  ```

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

  const message = await client.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello, Claude" }],
    user_profile_id: "uprof_011CZkZCu8hGbp5mYRQgUmz9"
  });

  console.log(message);
  ```

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

  var parameters = new MessageCreateParams
  {
      Model = Model.ClaudeOpus5_5,
      MaxTokens = 1024,
      Messages = [new() { Role = Role.User, Content = "Hello, Claude" }],
      UserProfileID = "uprof_011CZkZCu8hGbp5mYRQgUmz9"
  };
  var message = await client.Messages.Create(parameters);

  Console.WriteLine(message);
  ```

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

  message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
  	Model:     anthropic.ModelClaudeOpus5_5,
  	MaxTokens: 1024,
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(anthropic.NewTextBlock("Hello, Claude")),
  	},
  	UserProfileID: anthropic.String("uprof_011CZkZCu8hGbp5mYRQgUmz9"),
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Println(message)
  ```

  ```java Java
  import com.anthropic.models.messages.MessageCreateParams;
  import com.anthropic.models.messages.Model;

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

      var params = MessageCreateParams.builder()
          .model(Model.CLAUDE_OPUS_5_5)
          .maxTokens(1024L)
          .addUserMessage("Hello, Claude")
          .userProfileId("uprof_011CZkZCu8hGbp5mYRQgUmz9")
          .build();
      var message = client.messages().create(params);

      IO.println(message);
  }
  ```

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

  $message = $client->messages->create(
      maxTokens: 1024,
      messages: [['role' => 'user', 'content' => 'Hello, Claude']],
      model: Model::CLAUDE_OPUS_5_5,
      userProfileID: 'uprof_011CZkZCu8hGbp5mYRQgUmz9',
  );

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

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

  message = client.messages.create(
    model: Anthropic::Model::CLAUDE_OPUS_5_5,
    max_tokens: 1024,
    messages: [{ role: "user", content: "Hello, Claude" }],
    user_profile_id: "uprof_011CZkZCu8hGbp5mYRQgUmz9"
  )

  puts message
  ```
</CodeGroup>

このヘッダーは、[トークンカウント](https://platform.claude.com/docs/ja/build-with-claude/token-counting)、[Message Batches](https://platform.claude.com/docs/ja/build-with-claude/batch-processing)、および[OpenAI SDK互換](https://platform.claude.com/docs/ja/cli-sdks-libraries/libraries/openai-sdk)のリクエストでも同じように機能します。バッチでは、バッチ内のすべてのリクエストに適用されます。

Claude API、Claude Platform on AWS、およびAnthropicでホストされているMicrosoft Foundryデプロイメントは、すべてのリクエストでIDを確認します。IDの形式が不正な場合、またはリクエストを送信する組織に属していない場合、APIは`400` `invalid_request_error`を返します。デフォルトでは、これらのプラットフォームは、プロファイルを作成した組織からのリクエストでのみプロファイルIDを受け入れます。つまり、複数の組織（たとえばClaude API上の組織とClaude Platform on AWS上の組織）の下でトラフィックを送信する場合、プロファイルを作成していない組織からのリクエストには同じ`400`が返されます。

Message Batchesは例外です。バッチの作成時には、IDの形式のみが確認されます。形式が正しいIDがバッチを送信する組織に属していない場合でも、バッチは作成されますが、その中の各リクエストは同じ`invalid_request_error`を含む`errored`結果で失敗します。

### Amazon BedrockとGoogle Cloudでリクエストを帰属させる

どちらのアクセスタイプのプロファイルIDも、[Claude in Amazon Bedrock](https://platform.claude.com/docs/ja/build-with-claude/claude-in-amazon-bedrock)およびGoogle Cloudで機能します。`InvokeModel`または`Converse`で呼び出す[以前のAmazon Bedrock統合](https://platform.claude.com/docs/ja/build-with-claude/claude-on-amazon-bedrock-legacy)では機能しません。Anthropic組織の認証情報は、プロファイルの作成と管理にのみ使用します。推論には引き続き既存のAWSまたはGoogle Cloudの認証情報を使用します。

| プラットフォーム                                                                                                                         | プロファイルの作成                                        | プロファイルIDの送信先                    |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------- |
| Claude API                                                                                                                       | 可能                                               | `anthropic-user-profile-id`ヘッダー |
| [Claude Platform on AWS](https://platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws)                           | 可能                                               | `anthropic-user-profile-id`ヘッダー |
| [Microsoft Foundry](https://platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry)、Anthropicでホストされているデプロイメント | 可能                                               | `anthropic-user-profile-id`ヘッダー |
| [Google Cloud](https://platform.claude.com/docs/ja/build-with-claude/claude-on-vertex-ai)                                        | 不可。Claude APIまたはClaude Platform on AWSで作成してください。 | `anthropic-user-profile-id`ヘッダー |
| [Claude in Amazon Bedrock](https://platform.claude.com/docs/ja/build-with-claude/claude-in-amazon-bedrock)                       | 不可。Claude APIまたはClaude Platform on AWSで作成してください。 | リクエストボディの`user_profile_id`フィールド |

Claude in Amazon Bedrockでは、IDをリクエストボディのトップレベルに配置します。

```json
{
  "model": "anthropic.claude-opus-5-5",
  "max_tokens": 1024,
  "user_profile_id": "uprof_011CZkZCu8hGbp5mYRQgUmz9",
  "messages": [{ "role": "user", "content": "Hello, Claude" }]
}
```

Claude in Amazon Bedrockにリクエストを送信する各AWSアカウント、およびGoogle Cloudでリクエストを送信する各Google Cloudプロジェクトを、プロファイルを作成するAnthropic組織にリンクしてください。

1. その組織の管理者またはオーナーが、`portal.anthropic.com`のVerification Portalの**Linked accounts**でリンクを開始します。
2. AWSアカウントまたはGoogle CloudプロジェクトでIAMを管理できる担当者が、ポータルが提供するコマンドを実行します。
3. 管理者またはオーナーがポータルで検証を完了します。

プロファイルに適用されるプログラムは、アカウントがリンクされ、ポータルで**Linked**と表示された後にのみ、そのアカウントのリクエストに適用されます。エンドカスタマーが[プロファイルを自身の組織にリンク](https://platform.claude.com/docs/ja/manage-claude/user-profiles-verification-portal)した後は、その組織が承認されているプログラムもこれらのプログラムに含まれます。

Claude in Amazon BedrockとGoogle Cloudは、IDの形式を確認しますが、プロファイルの照会は行いません。形式が不正なIDは`400`で拒否されます。形式が正しいIDはすべて受け入れられるため、成功したレスポンスはIDがプロファイルと一致することを保証するものではありません。IDのないリクエストは帰属されずに処理され、それが措置を引き起こした場合、その措置は組織全体に適用されます。

### 企業内の個々のユーザーを識別する

`passthrough`プロファイルは、リクエストを行う個人ではなく企業を識別します。リクエストが識別可能な1人の個人からのものである場合は、Messagesリクエストの[`metadata.user_id`](https://platform.claude.com/docs/ja/api/messages/create)フィールドでその個人の識別子も送信してください。これはリクエスト自体の`metadata`オブジェクトであり、プロファイルの`metadata`フィールドではありません。この識別子は任意であり、Anthropicが1人の個人による不正使用を検出するのに役立ちます。

## プロファイルを最新の状態に保つ

エンドカスタマーの詳細情報やアカウントステータスが変更された場合はプロファイルを更新し、アカウントを閉鎖した場合やデータの消去を求められた場合はプロファイルを削除してください。

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

[`POST /v1/user_profiles/{id}`](https://platform.claude.com/docs/ja/api/beta/user_profiles/update)は、送信したフィールドのみを変更します。たとえば、企業がブランド名を変更した場合や、アカウントを停止した場合に使用します。

* `name`と`access_type`は、保存されている値を置き換えます。
* `external_user_details`で送信した各フィールドは、保存されている値を置き換えます。値をクリアすることはできません。APIは`null`を`400`で拒否します。
* `metadata`はキーごとにマージされます。送信したキーは保存されている値を上書きし、空の文字列はキーを削除し、省略したキーはそのまま残ります。

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

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/user_profiles/uprof_011CZkZCu8hGbp5mYRQgUmz9 \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "external_user_details": {"account_status": "suspended"},
      "metadata": {"trial_cohort": ""}
    }'
  ```

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

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

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

  print(profile)
  ```

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

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

  console.log(profile);
  ```

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

  var profile = await client.UserProfiles.Update("uprof_011CZkZCu8hGbp5mYRQgUmz9", 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(),
  	"uprof_011CZkZCu8hGbp5mYRQgUmz9",
  	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("uprof_011CZkZCu8hGbp5mYRQgUmz9")
          .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(
      'uprof_011CZkZCu8hGbp5mYRQgUmz9',
      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(
    "uprof_011CZkZCu8hGbp5mYRQgUmz9",
    external_user_details: { account_status: :suspended },
    metadata: { trial_cohort: "" }
  )

  puts profile
  ```
</CodeGroup>

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

`DELETE /v1/user_profiles/{id}`は、プロファイルと、そのプロファイルについてお客様が提供したすべての情報（`name`、`external_user_details`、`metadata`を含む）を完全に削除します。そのプロファイルIDについてAnthropicが保持している信頼と安全に関する記録は削除されません。

エンドカスタマーがアカウントを閉鎖した場合、またはデータの消去を求められた場合は、プロファイルを削除してください。プロファイルを削除する前に、そのエンドカスタマーのリクエストでそのIDを送信するのを停止してください。消去リクエストの後もエンドカスタマーが引き続きお客様のサービスを利用する場合は、新しいプロファイルを作成してそのIDに切り替えてから、古いプロファイルを削除してください。

<CodeGroup>
  ```bash cURL
  curl -X DELETE https://api.anthropic.com/v1/user_profiles/uprof_011CZkZCu8hGbp5mYRQgUmz9 \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant user-profiles delete --user-profile-id uprof_011CZkZCu8hGbp5mYRQgUmz9
  ```

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

  deleted = client.user_profiles.delete("uprof_011CZkZCu8hGbp5mYRQgUmz9")

  print(deleted.id)
  ```

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

  const deleted = await client.userProfiles.delete("uprof_011CZkZCu8hGbp5mYRQgUmz9");

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

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

  var deleted = await client.UserProfiles.Delete("uprof_011CZkZCu8hGbp5mYRQgUmz9");

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

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

  deleted, err := client.UserProfiles.Delete(
  	context.Background(),
  	"uprof_011CZkZCu8hGbp5mYRQgUmz9",
  	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("uprof_011CZkZCu8hGbp5mYRQgUmz9");

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

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

  $deleted = $client->userProfiles->delete('uprof_011CZkZCu8hGbp5mYRQgUmz9');

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

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

  deleted = client.user_profiles.delete("uprof_011CZkZCu8hGbp5mYRQgUmz9")

  puts deleted.id
  ```
</CodeGroup>

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

削除後、プロファイルエンドポイントはそのIDに対して`404`を返します。最大約10分間は、削除されたIDを含む推論リクエストが引き続き成功する場合があります。その後、すべてのリクエストでIDを確認するプラットフォームは、そのリクエストを`400`で拒否します。Claude in Amazon BedrockとGoogle Cloudはプロファイルを照会しないため、引き続きそのリクエストを受け入れます。

## 次のステップ

APIリファレンスには、各エンドポイントのフィールド、型、制限が記載されています：[プロファイルの作成](https://platform.claude.com/docs/ja/api/beta/user_profiles/create)、[プロファイルの取得](https://platform.claude.com/docs/ja/api/beta/user_profiles/retrieve)、[プロファイルの更新](https://platform.claude.com/docs/ja/api/beta/user_profiles/update)、[プロファイルの一覧表示](https://platform.claude.com/docs/ja/api/beta/user_profiles/list)。

エンドカスタマーがお客様のプラットフォームを通じてClaudeを使用する際に、そのエンドカスタマーのプログラム承認を適用する必要がある場合は、[エンドカスタマーにVerification Portalへのリンクを送信する](https://platform.claude.com/docs/ja/manage-claude/user-profiles-verification-portal)を参照してください。

<CardGroup cols={2}>
  <Card title="認証" href="https://platform.claude.com/docs/ja/manage-claude/authentication">
    サービスがClaude APIに認証する方法を選択します。
  </Card>

  <Card title="使用量とコストAPI" href="https://platform.claude.com/docs/ja/manage-claude/usage-cost-api">
    組織のAPIトークン使用量とコストを追跡します。
  </Card>

  <Card title="データレジデンシー" href="https://platform.claude.com/docs/ja/manage-claude/data-residency">
    モデル推論の実行場所とデータの保存場所を管理します。
  </Card>

  <Card title="Compliance API" href="https://platform.claude.com/docs/ja/manage-claude/compliance-api">
    組織全体のアクティビティを監査します。
  </Card>
</CardGroup>
