Claude Platform Docs

Manage user profiles

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, 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).

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}Preview with links to the API reference available — press Tab until focus enters the card, Escape to return..
  • Every user profile that has an open action: List your user profilesPreview with links to the API reference available — press Tab until focus enters the card, Escape to return. 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. On Claude Platform on AWS, the fields don’t report actions (see 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:

{
  "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.

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}Preview with links to the API reference available — press Tab until focus enters the card, Escape to return. changes only the fields you send:

  • name and access_type replace the stored value.
  • Each field you send in external_user_details 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 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:

client = anthropic.Anthropic()

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

print(profile)

Delete a user profile

DELETE /v1/user_profiles/{id}Preview with links to the API reference available — press Tab until focus enters the card, Escape to return. 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.

The following example deletes a user profile:

client = anthropic.Anthropic()

deleted = client.user_profiles.delete(profile_id)

print(deleted.id)

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

Rules and special cases

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

Treat a value you don’t recognize as follows:

FieldTreat the value as
enforcement_statusrestricted
enforcement_actions[].typerestriction
enforcement_actions[].reasonunspecified
enforcement_actions[].actionnull

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 instead of client.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, 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.

Was this page helpful?