I’m working on querying the logs to get the login history for my users. Im using a multi-tenant system tho where a user can belong to many facilities. What I’m trying to do is get the login history for the user but scoped to a specific facility id. The facility id is set in the user_metadata upon account creation. However to test this, I need to be able to see the metadata in the response from the logs endpoint. Without that it is very difficult to ensure that I have the login history scoped correctly. Currently, here is my query string
"/api/v2/logs?q=(user_id:\"#{user.auth0_user_id}\" AND (type:\"s\"))&user_metadata.facility_id:\"#{facility_id}\"&search_engine=v3"
EDIT: I have also tried the include_fields:true&fields=user_metadata
to no avail
UPDATE2: I have also tried this rule Move User Metadata Attributes To Profile Root Attributes
but it did not add it to the root attributes.