{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Customer Data Platform","product_name":"Real-Time","type":"markdown"},"seo":{"title":"Real-Time Profile Lookup","description":"Inspect a Real-Time profile's current ID associations, association timestamps, and persisted attributes with a Treasure Workflow lookup.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"real-time-profile-lookup","__idx":0},"children":["Real-Time Profile Lookup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Profile lookup helps you investigate how Real-Time ID stitching resolved a profile. A Treasure Workflow submits one or more identity selectors, and Real-Time writes a result for each input row to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["profile_lookup"]}," table in the parent segment's real-time database, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cdp_audience_<parent_segment_id>_rt"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use lookup for targeted debugging. It is not intended for exporting the ID graph in bulk. The result contains the IDs currently associated with the resolved profile and its ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["persisted real-time attributes"]},". It does not include batch attributes or dynamically evaluated attributes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-a-lookup-returns","__idx":1},"children":["What a Lookup Returns"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Column"},"children":["Column"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["time"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Lookup processing time, in Unix seconds."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reactor_instance_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Real-Time instance that processed the lookup."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lookup_row_index"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Zero-based index of the input row within the request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lookup_selectors"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Identity selectors supplied in the input row, excluding ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_rt_lookup_id"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["current_rid"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["RID of the resolved profile. Absent when no selector matches."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["realtime_attributes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Persisted real-time attributes of the resolved profile. Empty when there is no match."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["current_id_attributes"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["All IDs currently associated with the resolved profile, as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["key:value"]}," strings, sorted by association timestamp. Empty when there is no match."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["current_id_timestamps"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unix timestamps in seconds for the corresponding entries in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["current_id_attributes"]},", in the same order. Empty when there is no match."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_rt_lookup_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional correlation ID supplied by the workflow."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a profile was merged into another profile, the IDs moved to the retained RID have timestamps corresponding to the merge time. These timestamps describe when an association was updated; they are not necessarily when an ID was first seen."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When multiple selectors in one input row resolve to different profiles, the lookup returns the oldest RID, which is the RID a stitching operation would retain. Use the fewest selectors needed to identify the profile."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"run-a-lookup-from-treasure-workflow","__idx":2},"children":["Run a Lookup from Treasure Workflow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You need the parent segment ID, its Real-Time instance ID, and the importer endpoint for your deployment stage and site. The importer endpoint is reachable from Treasure Workflow within the Treasure AI platform. Contact Treasure AI Support if you need the instance ID or help identifying the correct endpoint."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store an API key in the workflow project's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Secrets"]}," tab as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td.apikey"]},". For this workflow, the secret value must be a complete authorization value in the form ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TD1 <account_id>/<api_key>"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example looks up one profile by its configured ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_client_id"]}," key. It uses the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["production US"]}," endpoint as an example. Replace ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["XXXX"]},", the instance ID, and the endpoint to match your deployment stage and site. Consult Treasure AI Support if you are unsure which endpoint to use. The optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_rt_lookup_id"]}," value makes it easier to find the result later."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"_export:\n  reactor_api_endpoint: \"https://bulk-storage-importer-api-production-aws-us-east-1.internal.treasuredata.com\"\n  reactor_instance: \"aYYYYnZ\"\n  td:\n    database: cdp_audience_XXXX\n    engine: presto\n\n+profile_lookup:\n  td>:\n  query: |\n    SELECT\n      'td_client_id:12345' AS result,\n      'td_rt_lookup_id:my-lookup-job' AS lookup_id\n  result_url: |\n    {\n      \"type\": \"rest\",\n      \"method\": \"POST\",\n      \"authorization\": \"${secret:td.apikey}\",\n      \"endpoint\": \"${reactor_api_endpoint}/internal/lookup-profile\",\n      \"headers\": \"{\\\"x-reactor-instance-name\\\": \\\"${reactor_instance}\\\"}\"\n    }\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use a key configured for your Real-Time instance. Each selector has the form ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["key:value"]},"; the optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_rt_lookup_id:value"]}," is metadata, not a selector. The request accepts up to five input rows. Run targeted lookups at approximately one request per second per importer instance rather than using this workflow for bulk extraction."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the workflow completes, query the results in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"sql","header":{"controls":{"copy":{}}},"source":"SELECT\n  time,\n  td_rt_lookup_id,\n  reactor_instance_id,\n  lookup_row_index,\n  lookup_selectors,\n  current_rid,\n  realtime_attributes,\n  current_id_attributes,\n  current_id_timestamps\nFROM cdp_audience_XXXX_rt.profile_lookup\nWHERE td_rt_lookup_id = 'my-lookup-job'\nORDER BY time DESC\n","lang":"sql"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"production-importer-endpoints","__idx":3},"children":["Production Importer Endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These endpoints apply to production. Other deployment stages use different endpoints; use the endpoint that matches both your stage and site."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Site"},"children":["Site"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["US"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://bulk-storage-importer-api-production-aws-us-east-1.internal.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["EU (eu01)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://bulk-storage-importer-api-production-eu01-eu-central-1.internal.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tokyo"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://bulk-storage-importer-api-production-aws-tokyo-ap-northeast-1.internal.treasuredata.com"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the identity changes that led to the current graph, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/real-time-identity-log-tables"},"children":["Real Time Identity Log Tables"]},". Profile lookup shows the current state; the identity log tables show changes over time."]}]},"headings":[{"value":"Real-Time Profile Lookup","id":"real-time-profile-lookup","depth":1},{"value":"What a Lookup Returns","id":"what-a-lookup-returns","depth":2},{"value":"Run a Lookup from Treasure Workflow","id":"run-a-lookup-from-treasure-workflow","depth":2},{"value":"Production Importer Endpoints","id":"production-importer-endpoints","depth":3}],"frontmatter":{"seo":{"title":"Real-Time Profile Lookup","description":"Inspect a Real-Time profile's current ID associations, association timestamps, and persisted attributes with a Treasure Workflow lookup."}},"lastModified":"2026-09-28T14:52:03.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/real-time/real-time-profile-lookup","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}