You can fetch and change data about the authenticated user using the API.
With an API client you can fetch the authenticated user.
client = Bitly::API::Client.new(token: token)
user = client.user
Or you can use the class method:
user = Bitly::API::User.fetch(client: client)
User emails are objects themselves. A user can have more than one email address and they may be verified or the primary email.
email = user.emails.first
email.email
# => [email protected]
email.is_verified
# => true
email.is_primary
# => true
With a user you can fetch their default group:
user.default_group
# => <Bitly::API::Group>
You can update the user's name or default group guid:
user.update(name: "New name", default_group_guid: "ab1234")