Class BetaUserProfile

  • All Implemented Interfaces:

    
    public final class BetaUserProfile
    
                        

    A 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 id in the anthropic-user-profile-id header to attribute the request to that entity.

    • Constructor Detail

    • Method Detail

      • id

         final String id()

        Unique identifier for this user profile, prefixed uprof_.

      • 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_type passthrough) this is that company's name. null until the platform supplies one.

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

      • 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-24 and user-profiles-2026-08-18 beta headers; without one of them, the value is external_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, null until the platform supplies a value. Absent under the legacy user-profiles-2026-03-24 and user-profiles-2026-08-18 beta headers, which serve reference_id as the top-level external_id and, under user-profiles-2026-08-18, onboarded_at as external_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). null until the platform supplies one. Legacy field, present only under the user-profiles-2026-08-18 beta header; without a legacy header, the value is external_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.

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

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

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

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

      • 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()