Class: Anthropic::Resources::Beta::UserProfiles
- Inherits:
-
Object
- Object
- Anthropic::Resources::Beta::UserProfiles
- Defined in:
- lib/anthropic/resources/beta/user_profiles.rb,
lib/anthropic/resources/beta/user_profiles/providers.rb,
lib/anthropic/resources/beta/user_profiles/action_urls.rb,
lib/anthropic/resources/beta/user_profiles/providers/google.rb,
lib/anthropic/resources/beta/user_profiles/providers/google/data_controls.rb,
sig/anthropic/resources/beta/user_profiles.rbs,
sig/anthropic/resources/beta/user_profiles/providers.rbs,
sig/anthropic/resources/beta/user_profiles/action_urls.rbs,
sig/anthropic/resources/beta/user_profiles/providers/google.rbs,
sig/anthropic/resources/beta/user_profiles/providers/google/data_controls.rbs
Overview
Register the end customers that your platform serves, so each request can name who it's for. To get started, see the User profiles guide.
Defined Under Namespace
Classes: ActionURLs, Providers
Instance Attribute Summary collapse
- #action_urls ⇒ Anthropic::Resources::Beta::UserProfiles::ActionURLs readonly
- #providers ⇒ Anthropic::Resources::Beta::UserProfiles::Providers readonly
Instance Method Summary collapse
-
#create(access_type: nil, external_id: nil, external_user_details: nil, external_user_onboarded_at: nil, metadata: nil, name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Register one of your end customers and get the ID to send on the requests you make for them.
-
#create_enrollment_url(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfileEnrollmentURL
Create a link that sends the profile's end customer to the Verification Portal from Claude Platform on AWS.
-
#delete(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDeletedUserProfile
Delete a user profile, for example when the end customer closes their account.
-
#initialize(client:) ⇒ UserProfiles
constructor
private
A new instance of UserProfiles.
-
#list(limit: nil, order: nil, order_by: nil, page: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaUserProfile>
List the user profiles in your organization, newest first by default.
-
#retrieve(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Get a user profile by ID to check the details stored for it.
-
#update(user_profile_id, access_type: nil, external_id: nil, external_user_details: nil, external_user_onboarded_at: nil, metadata: nil, name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Change the details of a user profile, leaving the fields that you don't send as they are.
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.
284 285 286 287 288 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 284 def initialize(client:) @client = client @action_urls = Anthropic::Resources::Beta::UserProfiles::ActionURLs.new(client: client) @providers = Anthropic::Resources::Beta::UserProfiles::Providers.new(client: client) end |
Instance Attribute Details
#action_urls ⇒ Anthropic::Resources::Beta::UserProfiles::ActionURLs (readonly)
11 12 13 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 11 def action_urls @action_urls end |
#providers ⇒ Anthropic::Resources::Beta::UserProfiles::Providers (readonly)
14 15 16 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 14 def providers @providers end |
Instance Method Details
#create(access_type: nil, external_id: nil, external_user_details: nil, external_user_onboarded_at: nil, metadata: nil, name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Register one of your end customers and get the ID to send on the requests you make for them.
See the User profiles guide for what to send.
Some parameter documentations has been truncated, see Models::Beta::UserProfileCreateParams for more details.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 49 def create(params = {}) parsed, = Anthropic::Beta::UserProfileCreateParams.dump_request(params) header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"} @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_CREATE, span_created_id: "anthropic.user_profile.id", span_route: "/v1/user_profiles", method: :post, path: "v1/user_profiles", 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"}, **} ) end |
#create_enrollment_url(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfileEnrollmentURL
Create a link that sends the profile's end customer to the Verification Portal from Claude Platform on AWS.
On the Claude API, create an action URL instead. See Send an end customer a link to the Verification Portal for when to create the link and what the end customer sees.
Some parameter documentations has been truncated, see Models::Beta::UserProfileCreateEnrollmentURLParams for more details.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 266 def create_enrollment_url(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileCreateEnrollmentURLParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_CREATE_ENROLLMENT_URL, span_attributes: {"anthropic.user_profile.id" => user_profile_id}, span_route: "/v1/user_profiles/{user_profile_id}/enrollment_url", method: :post, path: ["v1/user_profiles/%1$s/enrollment_url", user_profile_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaUserProfileEnrollmentURL, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **} ) end |
#delete(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaDeletedUserProfile
Delete a user profile, for example when the end customer closes their account.
Stop sending the profile's ID first. See the User profiles guide for what happens after a delete.
Some parameter documentations has been truncated, see Models::Beta::UserProfileDeleteParams for more details.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 227 def delete(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileDeleteParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_DELETE, span_attributes: {"anthropic.user_profile.id" => user_profile_id}, span_route: "/v1/user_profiles/{user_profile_id}", method: :delete, path: ["v1/user_profiles/%1$s", user_profile_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaDeletedUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **} ) end |
#list(limit: nil, order: nil, order_by: nil, page: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Internal::PageCursor<Anthropic::Models::Beta::BetaUserProfile>
List the user profiles in your organization, newest first by default.
See the User profiles guide for how to set up and manage profiles.
Some parameter documentations has been truncated, see Models::Beta::UserProfileListParams for more details.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 183 def list(params = {}) query_params = [:limit, :order, :order_by, :page] parsed, = Anthropic::Beta::UserProfileListParams.dump_request(params) query = Anthropic::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_LIST, span_route: "/v1/user_profiles", span_query: %w[limit order order_by page], method: :get, path: "v1/user_profiles", query: query, headers: parsed.except(*query_params).transform_keys( betas: "anthropic-beta", workspace_id: "anthropic-workspace-id" ), page: Anthropic::Internal::PageCursor, model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **} ) end |
#retrieve(user_profile_id, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Get a user profile by ID to check the details stored for it.
See the User profiles guide for how to set up and manage profiles.
Some parameter documentations has been truncated, see Models::Beta::UserProfileRetrieveParams for more details.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 88 def retrieve(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileRetrieveParams.dump_request(params) @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_RETRIEVE, span_attributes: {"anthropic.user_profile.id" => user_profile_id}, span_route: "/v1/user_profiles/{user_profile_id}", method: :get, path: ["v1/user_profiles/%1$s", user_profile_id], headers: parsed.transform_keys(betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"), model: Anthropic::Beta::BetaUserProfile, options: {extra_headers: {"anthropic-beta" => "user-profiles-2026-08-18"}, **} ) end |
#update(user_profile_id, access_type: nil, external_id: nil, external_user_details: nil, external_user_onboarded_at: nil, metadata: nil, name: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ Anthropic::Models::Beta::BetaUserProfile
Change the details of a user profile, leaving the fields that you don't send as they are.
See the User profiles guide for how each field is updated.
Some parameter documentations has been truncated, see Models::Beta::UserProfileUpdateParams for more details.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/anthropic/resources/beta/user_profiles.rb', line 138 def update(user_profile_id, params = {}) parsed, = Anthropic::Beta::UserProfileUpdateParams.dump_request(params) header_params = {betas: "anthropic-beta", workspace_id: "anthropic-workspace-id"} @client.request( qualifiers: {beta: "true"}, span_name: Anthropic::Internal::Tracing::SpanName::USER_PROFILES_UPDATE, span_attributes: {"anthropic.user_profile.id" => user_profile_id}, span_route: "/v1/user_profiles/{user_profile_id}", method: :post, path: ["v1/user_profiles/%1$s", user_profile_id], 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"}, **} ) end |