Class UserProfile
-
- All Implemented Interfaces:
public final class UserProfileA record of an entity that the platform serves through the API, such as an end-user of the platform's product or a company that the platform resells Claude access to.
A Messages, Message Batches or token counting request can send a profile's
idin theanthropic-user-profile-idheader to attribute the request to that entity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classUserProfile.BuilderA builder for UserProfile.
public final classUserProfile.MetadataArbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
-
Method Summary
Modifier and Type Method Description final Stringid()Unique identifier for this user profile, prefixed uprof_.final UserProfileAccessTypeaccessType()How the platform uses the API for this entity: application(default) orpassthrough.final OffsetDateTimecreatedAt()When this user profile was created, in RFC 3339 format. final List<UserProfileEnforcementAction>enforcementActions()The enforcement actions open on this profile; empty when none is open. final UserProfileEnforcementStatusenforcementStatus()Anthropic's enforcement status of this profile, from its open enforcement actions and any identity check under review, by the first rule that applies: bannedwhile any open action is aban;pendingwhile a restriction that an identity check can clear is open, the end user has submitted that check, Anthropic's review of it has not ended, and no open action'sreasonisaccount_compromise;restrictedwhile any action is open;unrestrictedwhile none is.final UserProfileExternalUserDetailsexternalUserDetails()Details about the entity this profile represents, as the platform states them; not verified by Anthropic. final UserProfile.Metadatametadata()Arbitrary key-value metadata. final Optional<String>name()Real-world name of the entity this profile represents (company or individual). final UserProfileProgramsprograms()The profile's standing in each Anthropic program, such as the Cyber Verification Program. final OffsetDateTimeupdatedAt()When this user profile was last modified, in RFC 3339 format. final JsonValue_type()Object type. final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<UserProfileAccessType>_accessType()Returns the raw JSON value of accessType. final JsonField<OffsetDateTime>_createdAt()Returns the raw JSON value of createdAt. final JsonField<List<UserProfileEnforcementAction>>_enforcementActions()Returns the raw JSON value of enforcementActions. final JsonField<UserProfileEnforcementStatus>_enforcementStatus()Returns the raw JSON value of enforcementStatus. final JsonField<UserProfileExternalUserDetails>_externalUserDetails()Returns the raw JSON value of externalUserDetails. final JsonField<UserProfile.Metadata>_metadata()Returns the raw JSON value of metadata. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<UserProfilePrograms>_programs()Returns the raw JSON value of programs. final JsonField<OffsetDateTime>_updatedAt()Returns the raw JSON value of updatedAt. final Map<String, JsonValue>_additionalProperties()final UserProfile.BuildertoBuilder()final UserProfilevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static UserProfile.Builderbuilder()Returns a mutable builder for constructing an instance of UserProfile. -
-
Method Detail
-
accessType
final UserProfileAccessType accessType()
How the platform uses the API for this entity:
application(default) orpassthrough. Absent under the legacyuser-profiles-2026-03-24beta header.
-
createdAt
final OffsetDateTime createdAt()
When this user profile was created, in RFC 3339 format.
-
enforcementActions
final List<UserProfileEnforcementAction> enforcementActions()
The enforcement actions open on this profile; empty when none is open. Absent under the
user-profiles-2026-09-04and earlier beta headers.
-
enforcementStatus
final UserProfileEnforcementStatus enforcementStatus()
Anthropic's enforcement status of this profile, from its open enforcement actions and any identity check under review, by the first rule that applies:
bannedwhile any open action is aban;pendingwhile a restriction that an identity check can clear is open, the end user has submitted that check, Anthropic's review of it has not ended, and no open action'sreasonisaccount_compromise;restrictedwhile any action is open;unrestrictedwhile none is. Absent under theuser-profiles-2026-09-04and earlier beta headers.
-
externalUserDetails
final UserProfileExternalUserDetails externalUserDetails()
Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Every field is present,
nulluntil the platform supplies a value. Absent under the legacyuser-profiles-2026-03-24anduser-profiles-2026-08-18beta headers, which servereference_idas the top-levelexternal_idand, underuser-profiles-2026-08-18,onboarded_atasexternal_user_onboarded_at.
-
metadata
final UserProfile.Metadata metadata()
Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
-
name
final Optional<String> name()
Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (
access_typepassthrough) this is that company's name.nulluntil the platform supplies one.
-
programs
final UserProfilePrograms programs()
The profile's standing in each Anthropic program, such as the Cyber Verification Program. Present when the request sends no user-profiles beta header; absent under the
user-profiles-2026-09-04and earlier beta headers, which servetrust_grantsinstead.
-
updatedAt
final OffsetDateTime updatedAt()
When this user profile was last modified, in RFC 3339 format. It normally also updates shortly after Anthropic gives the profile an approval or withdraws one. Other changes to the statuses that Anthropic reports do not always update it, so read the status itself rather than watching this timestamp.
-
_type
final JsonValue _type()
Object type. Always
user_profile.Expected to always return the following:
JsonValue.from("user_profile")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_accessType
final JsonField<UserProfileAccessType> _accessType()
Returns the raw JSON value of accessType.
Unlike accessType, this method doesn't throw if the JSON field has an unexpected type.
-
_createdAt
final JsonField<OffsetDateTime> _createdAt()
Returns the raw JSON value of createdAt.
Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.
-
_enforcementActions
final JsonField<List<UserProfileEnforcementAction>> _enforcementActions()
Returns the raw JSON value of enforcementActions.
Unlike enforcementActions, this method doesn't throw if the JSON field has an unexpected type.
-
_enforcementStatus
final JsonField<UserProfileEnforcementStatus> _enforcementStatus()
Returns the raw JSON value of enforcementStatus.
Unlike enforcementStatus, this method doesn't throw if the JSON field has an unexpected type.
-
_externalUserDetails
final JsonField<UserProfileExternalUserDetails> _externalUserDetails()
Returns the raw JSON value of externalUserDetails.
Unlike externalUserDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_metadata
final JsonField<UserProfile.Metadata> _metadata()
Returns the raw JSON value of metadata.
Unlike metadata, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_programs
final JsonField<UserProfilePrograms> _programs()
Returns the raw JSON value of programs.
Unlike programs, this method doesn't throw if the JSON field has an unexpected type.
-
_updatedAt
final JsonField<OffsetDateTime> _updatedAt()
Returns the raw JSON value of updatedAt.
Unlike updatedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final UserProfile.Builder toBuilder()
-
validate
final UserProfile validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static UserProfile.Builder builder()
Returns a mutable builder for constructing an instance of UserProfile.
The following fields are required:
.id() .accessType() .createdAt() .enforcementActions() .enforcementStatus() .externalUserDetails() .metadata() .name() .programs() .updatedAt()
-
-
-
-