Class: Anthropic::Resources::Beta::UserProfiles

Inherits:
Object
  • Object
show all
Defined in:
lib/anthropic/resources/beta/user_profiles.rb,
sig/anthropic/resources/beta/user_profiles.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ UserProfiles

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of UserProfiles.

Parameters:



166
167
168
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 166

def initialize(client:)
  @client = client
end

Instance Method Details

#create(access_type: nil, external_id: nil, metadata: nil, name: nil, relationship: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile

Create User Profile

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

Parameters:

Returns:

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 31

def create(params = {})
  parsed, options = Anthropic::Beta::UserProfileCreateParams.dump_request(params)
  header_params = {betas: "anthropic-beta"}
  @client.request(
    method: :post,
    path: "v1/user_profiles?beta=true",
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::BetaUserProfile,
    options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **options}
  )
end

#create_enrollment_url(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfileEnrollmentURL

Create Enrollment URL

Parameters:

Returns:

See Also:



152
153
154
155
156
157
158
159
160
161
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 152

def create_enrollment_url(, params = {})
  parsed, options = Anthropic::Beta::UserProfileCreateEnrollmentURLParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/user_profiles/%1$s/enrollment_url?beta=true", ],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Beta::BetaUserProfileEnrollmentURL,
    options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **options}
  )
end

#list(limit: nil, order: nil, page: nil, betas: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaUserProfile>

List User Profiles

Parameters:

Returns:

See Also:



124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 124

def list(params = {})
  query_params = [:limit, :order, :page]
  parsed, options = Anthropic::Beta::UserProfileListParams.dump_request(params)
  query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params))
  @client.request(
    method: :get,
    path: "v1/user_profiles?beta=true",
    query: query,
    headers: parsed.except(*query_params).transform_keys(betas: "anthropic-beta"),
    page: Anthropic::Internal::PageCursor,
    model: Anthropic::Beta::BetaUserProfile,
    options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **options}
  )
end

#retrieve(user_profile_id, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile

Get User Profile

Parameters:

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 57

def retrieve(, params = {})
  parsed, options = Anthropic::Beta::UserProfileRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/user_profiles/%1$s?beta=true", ],
    headers: parsed.transform_keys(betas: "anthropic-beta"),
    model: Anthropic::Beta::BetaUserProfile,
    options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **options}
  )
end

#update(user_profile_id, access_type: nil, external_id: nil, metadata: nil, name: nil, relationship: nil, betas: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile

Update User Profile

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

Parameters:

  • user_profile_id (String)

    Path param: Path parameter user_profile_id

  • access_type (Symbol, Anthropic::Models::Beta::UserProfileUpdateParams::AccessType, nil)

    Body param: How the platform uses the API on behalf of the entity this profile r

  • external_id (String, nil)

    Body param: If present, replaces the stored external_id. Omit to leave unchanged

  • metadata (Hash{Symbol=>String})

    Body param: Key-value pairs to merge into the stored metadata. Keys provided ove

  • name (String, nil)

    Body param: If present, replaces the stored name. Omit to leave unchanged. Maxim

  • relationship (Symbol, Anthropic::Models::Beta::UserProfileUpdateParams::Relationship, nil)

    Body param: How the entity behind a user profile relates to the platform that ow

  • betas (Array<String, Symbol, Anthropic::Models::AnthropicBeta>)

    Header param: Optional header to specify the beta version(s) you want to use.

  • request_options (Anthropic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 94

def update(, params = {})
  parsed, options = Anthropic::Beta::UserProfileUpdateParams.dump_request(params)
  header_params = {betas: "anthropic-beta"}
  @client.request(
    method: :post,
    path: ["v1/user_profiles/%1$s?beta=true", ],
    headers: parsed.slice(*header_params.keys).transform_keys(header_params),
    body: parsed.except(*header_params.keys),
    model: Anthropic::Beta::BetaUserProfile,
    options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **options}
  )
end