class Stytch::Users
def update(
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +User+ (+object+).
The `user` object affected by this API call. See the [Get user endpoint](https://stytch.com/docs/api/get-user) for complete response field details.
user::
The type of this field is list of +CryptoWallet+ (+object+).
An array contains a list of all crypto wallets for a given User in the Stytch API.
crypto_wallets::
The type of this field is list of +PhoneNumber+ (+object+).
An array of phone number objects linked to the User.
phone_numbers::
The type of this field is list of +Email+ (+object+).
An array of email objects for the User.
emails::
The type of this field is +String+.
The unique ID of the updated User.
user_id::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:
The type of this field is nilable +object+.
The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
untrusted_metadata::
The type of this field is nilable +object+.
The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
trusted_metadata::
The type of this field is nilable +Attributes+ (+object+).
Provided attributes help with fraud detection.
attributes::
The type of this field is nilable +Name+ (+object+).
The name of the user. Each field in the name object is optional.
name::
The type of this field is +String+.
The unique ID of a specific User.
user_id::
== Parameters:
**Note:** In order to add a new email address or phone number to an existing User object, pass the new email address or phone number into the respective `/send` endpoint for the authentication method of your choice. If you specify the existing User's `user_id` while calling the `/send` endpoint, the new, unverified email address or phone number will be added to the existing User object. If the user successfully authenticates within 5 minutes of the `/send` request, the new email address or phone number will be marked as verified and remain permanently on the existing Stytch User. Otherwise, it will be removed from the User object, and any subsequent login requests using that phone number will create a new User. We require this process to guard against an account takeover vulnerability.
Update a User's attributes.
def update( user_id:, name: nil, attributes: nil, trusted_metadata: nil, untrusted_metadata: nil ) headers = {} request = {} request[:name] = name unless name.nil? request[:attributes] = attributes unless attributes.nil? request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil? request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil? put_request("/v1/users/#{user_id}", request, headers) end