Class BetaUserProfile
-
- All Implemented Interfaces:
public final class BetaUserProfileA 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 classBetaUserProfile.BuilderA builder for BetaUserProfile.
public final classBetaUserProfile.MetadataArbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
public final classBetaUserProfile.TrustGrantsTrust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.
public final classBetaUserProfile.AccessTypeHow the platform uses the API for this entity:
application(default) orpassthrough. Absent under the legacyuser-profiles-2026-03-24beta header.
-
Method Summary
Modifier and Type Method Description final Stringid()Unique identifier for this user profile, prefixed uprof_.final OffsetDateTimecreatedAt()When this user profile was created, in RFC 3339 format. final BetaUserProfile.Metadatametadata()Arbitrary key-value metadata. final Optional<String>name()Real-world name of the entity this profile represents (company or individual). final BetaUserProfile.TrustGrantstrustGrants()Trust grants for this profile, keyed by grant name. final OffsetDateTimeupdatedAt()When this user profile was last modified, in RFC 3339 format. final Optional<BetaUserProfile.AccessType>accessType()How the platform uses the API for this entity: application(default) orpassthrough.final Optional<String>externalId()Platform's own identifier for this user. final Optional<BetaUserProfileExternalUserDetails>externalUserDetails()Details about the entity this profile represents, as the platform states them; not verified by Anthropic. final Optional<OffsetDateTime>externalUserOnboardedAt()When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC). final JsonValue_type()Object type. final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<OffsetDateTime>_createdAt()Returns the raw JSON value of createdAt. final JsonField<BetaUserProfile.Metadata>_metadata()Returns the raw JSON value of metadata. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<BetaUserProfile.TrustGrants>_trustGrants()Returns the raw JSON value of trustGrants. final JsonField<OffsetDateTime>_updatedAt()Returns the raw JSON value of updatedAt. final JsonField<BetaUserProfile.AccessType>_accessType()Returns the raw JSON value of accessType. final JsonField<String>_externalId()Returns the raw JSON value of externalId. final JsonField<BetaUserProfileExternalUserDetails>_externalUserDetails()Returns the raw JSON value of externalUserDetails. final JsonField<OffsetDateTime>_externalUserOnboardedAt()Returns the raw JSON value of externalUserOnboardedAt. final Map<String, JsonValue>_additionalProperties()final BetaUserProfile.BuildertoBuilder()final BetaUserProfilevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaUserProfile.Builderbuilder()Returns a mutable builder for constructing an instance of BetaUserProfile. -
-
Method Detail
-
createdAt
final OffsetDateTime createdAt()
When this user profile was created, in RFC 3339 format.
-
metadata
final BetaUserProfile.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.
-
trustGrants
final BetaUserProfile.TrustGrants trustGrants()
Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.
-
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.
-
accessType
final Optional<BetaUserProfile.AccessType> accessType()
How the platform uses the API for this entity:
application(default) orpassthrough. Absent under the legacyuser-profiles-2026-03-24beta header.
-
externalId
final Optional<String> externalId()
Platform's own identifier for this user. Not enforced unique. Legacy field, present only under the
user-profiles-2026-03-24anduser-profiles-2026-08-18beta headers; without one of them, the value isexternal_user_details.reference_id.
-
externalUserDetails
final Optional<BetaUserProfileExternalUserDetails> 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.
-
externalUserOnboardedAt
final Optional<OffsetDateTime> externalUserOnboardedAt()
When the entity this profile represents opened its account with the platform, as stated by the platform, in RFC 3339 format (UTC).
nulluntil the platform supplies one. Legacy field, present only under theuser-profiles-2026-08-18beta header; without a legacy header, the value isexternal_user_details.onboarded_at.
-
_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.
-
_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.
-
_metadata
final JsonField<BetaUserProfile.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.
-
_trustGrants
final JsonField<BetaUserProfile.TrustGrants> _trustGrants()
Returns the raw JSON value of trustGrants.
Unlike trustGrants, 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.
-
_accessType
final JsonField<BetaUserProfile.AccessType> _accessType()
Returns the raw JSON value of accessType.
Unlike accessType, this method doesn't throw if the JSON field has an unexpected type.
-
_externalId
final JsonField<String> _externalId()
Returns the raw JSON value of externalId.
Unlike externalId, this method doesn't throw if the JSON field has an unexpected type.
-
_externalUserDetails
final JsonField<BetaUserProfileExternalUserDetails> _externalUserDetails()
Returns the raw JSON value of externalUserDetails.
Unlike externalUserDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_externalUserOnboardedAt
final JsonField<OffsetDateTime> _externalUserOnboardedAt()
Returns the raw JSON value of externalUserOnboardedAt.
Unlike externalUserOnboardedAt, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaUserProfile.Builder toBuilder()
-
validate
final BetaUserProfile 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 BetaUserProfile.Builder builder()
Returns a mutable builder for constructing an instance of BetaUserProfile.
The following fields are required:
.id() .createdAt() .metadata() .name() .trustGrants() .updatedAt()
-
-
-
-