Class: Anthropic::Models::Beta::BetaUserProfile

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_user_profile.rb,
sig/anthropic/models/beta/beta_user_profile.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::UserProfiles#create

Defined Under Namespace

Modules: AccessType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, created_at:, metadata:, name:, trust_grants:, updated_at:, access_type: nil, external_id: nil, external_user_details: nil, external_user_onboarded_at: nil, type: :user_profile) ⇒ 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.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::BetaUserProfile for more details.

Parameters:

  • id (String) —

    Unique identifier for this user profile, prefixed uprof_.

  • created_at (Time) —

    When this user profile was created, in RFC 3339 format.

  • metadata (Hash{Symbol=>String}) —

    Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up t

  • name (String, nil) —

    Real-world name of the entity this profile represents (company or individual). F

  • trust_grants (Hash{Symbol=>Anthropic::Models::Beta::BetaUserProfileTrustGrant}) —

    Trust grants for this profile, keyed by grant name. Key omitted when no grant is

  • updated_at (Time) —

    When this user profile was last modified, in RFC 3339 format. It normally also u

  • access_type (Symbol, Anthropic::Models::Beta::BetaUserProfile::AccessType) (defaults to: nil) —

    How the platform uses the API for this entity: application (default) or

  • external_id (String, nil) (defaults to: nil) —

    Platform's own identifier for this user. Not enforced unique. Legacy field, pres

  • external_user_details (Anthropic::Models::Beta::BetaUserProfileExternalUserDetails) (defaults to: nil) —

    Details about the entity this profile represents, as the platform states them; n

  • external_user_onboarded_at (Time, nil) (defaults to: nil) —

    When the entity this profile represents opened its account with the platform, as

  • type (Symbol, :user_profile) (defaults to: :user_profile) —

    Object type. Always user_profile.

  • id: (String)
  • created_at: (Time)
  • metadata: (::Hash[Symbol, String])
  • name: (String, nil)
  • trust_grants: (::Hash[Symbol, Anthropic::Beta::BetaUserProfileTrustGrant])
  • updated_at: (Time)
  • access_type: (Anthropic::Models::Beta::BetaUserProfile::access_type) (defaults to: nil)
  • external_id: (String, nil) (defaults to: nil)
  • external_user_details: (Anthropic::Beta::BetaUserProfileExternalUserDetails) (defaults to: nil)
  • external_user_onboarded_at: (Time, nil) (defaults to: nil)
  • type: (:user_profile) (defaults to: :user_profile)


# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 96

Instance Attribute Details

#access_type ⇒ Symbol, ...

How the platform uses the API for this entity: application (default) or passthrough. Absent under the legacy user-profiles-2026-03-24 beta header.

Parameters:

  • (Anthropic::Models::Beta::BetaUserProfile::access_type)

Returns:



64
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 64

optional :access_type, enum: -> { Anthropic::Beta::BetaUserProfile::AccessType }

#created_at ⇒ Time

When this user profile was created, in RFC 3339 format.

Parameters:

  • value (Time)

Returns:

  • (Time)


18
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 18

required :created_at, Time

#external_id ⇒ String?

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


73
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 73

optional :external_id, String, nil?: true

#external_user_details ⇒ Anthropic::Models::Beta::BetaUserProfileExternalUserDetails?

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.

Parameters:

  • (Anthropic::Beta::BetaUserProfileExternalUserDetails)

Returns:



84
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 84

optional :external_user_details, -> { Anthropic::Beta::BetaUserProfileExternalUserDetails }

#external_user_onboarded_at ⇒ Time?

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.

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


94
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 94

optional :external_user_onboarded_at, Time, nil?: true

#id ⇒ String

Unique identifier for this user profile, prefixed uprof_.

Parameters:

  • value (String)

Returns:

  • (String)


12
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 12

required :id, String

#metadata ⇒ Hash{Symbol=>String}

Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

Parameters:

  • value (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String})


25
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 25

required :metadata, Anthropic::Internal::Type::HashOf[String]

#name ⇒ String?

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.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


34
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 34

required :name, String, nil?: true

#trust_grants ⇒ Hash{Symbol=>Anthropic::Models::Beta::BetaUserProfileTrustGrant}

Trust grants for this profile, keyed by grant name. Key omitted when no grant is active or in flight.

Parameters:

  • value (::Hash[Symbol, Anthropic::Beta::BetaUserProfileTrustGrant])

Returns:



41
42
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 41

required :trust_grants,
-> { Anthropic::Internal::Type::HashOf[Anthropic::Beta::BetaUserProfileTrustGrant] }

#type ⇒ Symbol, :user_profile

Object type. Always user_profile.

Parameters:

  • value (:user_profile)

Returns:

  • (Symbol, :user_profile)


48
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 48

required :type, const: :user_profile

#updated_at ⇒ Time

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.

Parameters:

  • value (Time)

Returns:

  • (Time)


57
# File 'lib/anthropic/models/beta/beta_user_profile.rb', line 57

required :updated_at, Time

Instance Method Details

#to_hash ⇒ { id: String, created_at: Time, metadata: ::Hash[Symbol, String], name: String?, trust_grants: ::Hash[Symbol, Anthropic::Beta::BetaUserProfileTrustGrant], type: :user_profile, updated_at: Time, access_type: Anthropic::Models::Beta::BetaUserProfile::access_type, external_id: String?, external_user_details: Anthropic::Beta::BetaUserProfileExternalUserDetails, external_user_onboarded_at: Time? }

Returns:

  • ({ id: String, created_at: Time, metadata: ::Hash[Symbol, String], name: String?, trust_grants: ::Hash[Symbol, Anthropic::Beta::BetaUserProfileTrustGrant], type: :user_profile, updated_at: Time, access_type: Anthropic::Models::Beta::BetaUserProfile::access_type, external_id: String?, external_user_details: Anthropic::Beta::BetaUserProfileExternalUserDetails, external_user_onboarded_at: Time? })


66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'sig/anthropic/models/beta/beta_user_profile.rbs', line 66

def to_hash: -> {
  id: String,
  created_at: Time,
  metadata: ::Hash[Symbol, String],
  name: String?,
  trust_grants: ::Hash[Symbol, Anthropic::Beta::BetaUserProfileTrustGrant],
  type: :user_profile,
  updated_at: Time,
  access_type: Anthropic::Models::Beta::BetaUserProfile::access_type,
  external_id: String?,
  external_user_details: Anthropic::Beta::BetaUserProfileExternalUserDetails,
  external_user_onboarded_at: Time?
}