---
title: Manage user profiles
url: https://platform.claude.com/docs/en/manage-claude/user-profiles/manage-profiles
description: Check whether Anthropic has restricted or banned one of your end customers, update a user profile when the end customer's details change, and delete a user profile.
---

After you [create a user profile for each end customer](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#create-a-profile-for-each-end-customer), you can check whether Anthropic has restricted or banned any of them. You can also update a user profile when an end customer’s details change. You can delete the user profile when they leave or ask you to erase their data.

## Before you begin

You need two things:

* **The user profile’s ID:** The `uprof_` ID you stored when you created the user profile. The examples on this page read it from a variable.
* **Credentials for the organization that created the user profile:** Use the ones you created the user profile with (see [Create user profiles and attribute requests](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#before-you-begin)).

## Check whether Anthropic has restricted or banned a user profile

Anthropic can restrict or ban one of your end customers. An enforcement action (“action”) is a restriction or a ban on that end customer’s user profile. While an action is open, Anthropic refuses some or all inference requests that carry the user profile’s ID. Your other end customers’ requests aren’t affected.

* **A restriction** limits how Anthropic serves the end customer until it ends, and some of their requests might still succeed.
* **A ban** means that Anthropic has stopped serving the end customer where the ban applies and doesn’t plan to serve them there again. It has no end date, and they can’t clear it.

### Find user profiles that have an open action

There are two ways to check:

* **One user profile:** Retrieve it with [`GET /v1/user_profiles/{id}`](https://platform.claude.com/docs/en/api/user_profiles/retrieve).
* **Every user profile that has an open action:** [List your user profiles](https://platform.claude.com/docs/en/api/user_profiles/list) with `enforcement_status[]=restricted` and `enforcement_status[]=banned`.

A list response might hold no user profiles or fewer than `limit` before the list ends, so keep requesting pages until `next_page` is `null`.

To find out when an action opens or ends, list your user profiles at regular intervals. Compare `enforcement_status` and `enforcement_actions` with what you saw last time. If a user profile drops out of the list, it either has no open action or was deleted. Don’t rely on `updated_at` to spot a change, because changes to these fields don’t reliably update it.

Anthropic doesn’t send webhook events for these changes.

### Read the enforcement fields

Each user profile in a create, retrieve, update, or list response carries two fields, `enforcement_status` and `enforcement_actions`. If a response has neither, see [If the enforcement fields are missing](https://platform.claude.com/docs/en/manage-claude/user-profiles/manage-profiles#if-the-enforcement-fields-are-missing). On Claude Platform on AWS, the fields don’t report actions (see [If you use Claude Platform on AWS](https://platform.claude.com/docs/en/manage-claude/user-profiles/manage-profiles#if-you-use-claude-platform-on-aws)).

Anthropic sets both fields, so if a create or update request includes either one, the API returns a `400`.

The following example shows these two fields on a retrieved user profile and leaves out most of its other fields:

```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` summarizes the open actions in one value:

* `unrestricted`: No action is open.
* `restricted`: At least one action is open and none of them is a ban.
* `banned`: A ban is open.

`enforcement_status` is separate from `external_user_details.account_status`, which records your own decision about the account.

`enforcement_actions` lists the open actions and is empty when there are none. An action drops off the list once it ends, so if you need a history, store the actions you read. Each action has these fields:

* `type`: `restriction` or `ban`.
* `id`: The action’s ID, which starts with `enac_`.
* `reason`: Why Anthropic opened the action. It’s one of `unsupported_region`, `fraud_or_abuse`, `high_harm`, `usage_policy_violation`, `account_compromise`, or `unspecified`.
* `action`: What the end customer can do to clear the action. It’s always `null`.
* `opened_at`: When Anthropic opened the action.
* `expires_at`: When the action ends by itself. It’s `null` when the action has no end date.

Anthropic can add values to these fields, so make sure your code can handle [a value it doesn’t recognize](https://platform.claude.com/docs/en/manage-claude/user-profiles/manage-profiles#if-a-field-has-a-value-that-you-dont-recognize).

## Update a user profile

Update a user profile when the end customer’s details or account status change, for example when a company rebrands or you suspend an account. [`POST /v1/user_profiles/{id}`](https://platform.claude.com/docs/en/api/user_profiles/update) changes only the fields you send:

* `name` and [`access_type`](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#decide-who-gets-a-profile) replace the stored value.
* Each field you send in [`external_user_details`](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#what-to-tell-anthropic-about-an-end-customer) replaces the stored value. You can’t clear a value, because the API rejects `null` with a `400`.
* `metadata` merges key by key. A key you send overwrites its stored value, an empty string deletes the key, and any key you leave out stays as it is.

The cURL samples on this page send an access token, such as a [workload identity federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation#authenticate-from-your-workload) token, from `ANTHROPIC_AUTH_TOKEN`. Because that variable takes precedence over federation environment variables and federation profiles, set it only in the shell where you run the samples.

The following example marks the account as suspended and deletes a `trial_cohort` metadata key:

<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 a user profile

[`DELETE /v1/user_profiles/{id}`](https://platform.claude.com/docs/en/api/user_profiles/delete) deletes a user profile and the details you supplied for it, including `name`, `external_user_details`, and `metadata`. It doesn’t remove the trust and safety records that Anthropic keeps about that user profile ID. You can delete user profiles on the Claude API and Claude Platform on AWS.

Delete a user profile when an end customer closes their account or asks you to erase their data:

* **The customer leaves:** Stop sending the user profile’s ID on their requests, and then delete the user profile.
* **The customer stays with you after an erasure request:** Create a new user profile, switch their requests to its ID, and then delete the old user profile.

If the customer stays and a workspace has the old user profile attached, that workspace rejects requests that carry the new ID. Before you switch, see [If a workspace has a user profile attached](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-workspace-has-a-profile-attached).

<Warning>
  You can’t undo a delete.
</Warning>

The following example deletes a user profile:

<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>

The response repeats the ID with `"type": "user_profile_deleted"`. If a delete returns a server error, retry it. If the retry returns a `404`, the first delete went through.

After a delete, the user profile endpoints return a `404` for that ID. For up to about 10 minutes, inference requests that carry the deleted ID can still succeed. After that, the [platforms that check the ID on every request](https://platform.claude.com/docs/en/manage-claude/user-profiles/attribute-requests#if-a-request-returns-a-400) reject them with a `400`. Claude Models on Google Cloud (Google managed) doesn’t look user profiles up, so it still accepts the ID. The same is true of Amazon Bedrock on the [models that accept a user profile ID](https://platform.claude.com/docs/en/manage-claude/user-profiles/platforms#amazon-bedrock-models).

## Rules and special cases

### If a field has a value that you don’t recognize

Treat a value you don’t recognize as follows:

| Field | Treat the value as |
| ----- | ----- |
| `enforcement_status` | `restricted` |
| `enforcement_actions[].type` | `restriction` |
| `enforcement_actions[].reason` | `unspecified` |
| `enforcement_actions[].action` | `null` |

### If the enforcement fields are missing

If a response has neither `enforcement_status` nor `enforcement_actions`, check the request’s `anthropic-beta` header. The `user-profiles-2026-09-04` beta and any earlier user profiles beta leave both fields out and make the `enforcement_status[]` list filter return a `400`. Remove that beta, but keep any others.

With the SDK or the CLI, call `client.user_profiles` (typescript: `client.userProfiles`; csharp, go: `client.UserProfiles`; java: `client.userProfiles()`; php: `$client->userProfiles`; cli: `ant user-profiles`) instead of `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`), because the beta namespace sends the `user-profiles-2026-08-18` beta.

### If you use Claude Platform on AWS

On [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws), the enforcement fields don’t report actions: `enforcement_status` is always `unrestricted`, and `enforcement_actions` is always empty. Anthropic also doesn’t refuse requests there because of an open action.
