{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Real-time","type":"markdown"},"seo":{"title":"Creating a Real Time Activation Using Real-time Personalization API","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"creating-a-real-time-activation-using-real-time-personalization-api","__idx":0},"children":["Creating a Real Time Activation Using Real-time Personalization API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This API allows you to ingest an event and receive a personalization response from Treasure Data's real-time system."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#prerequisites"},"children":["Prerequisites"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#endpoints-and-base-urls"},"children":["Endpoints and Base URLs"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#headers"},"children":["Headers"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#personalization-api-definition"},"children":["Personalization API Definition"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#request-body"},"children":["Request Body"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api#responses"},"children":["Responses"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":1},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To successfully make the Real-time Personalization API call, you need to do the following things:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enable your account to access real-time services in the Treasure Console."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Configure a database for Web Personalization with a detailed knowledge of the events and offers configured."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A write-only API key"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A valid Web Personalization token."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"endpoints-and-base-urls","__idx":2},"children":["Endpoints and Base URLs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The personalization API uses these Base URLs."]},{"$$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":"Region"},"children":["Region"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Base URL"},"children":["Base URL"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["US (us01)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://us01.p13n.in.treasuredata.com"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Europe (eu01)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://eu01.p13n.in.treasuredata.com"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Japan (ap01)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["https://ap01.p13n.in.treasuredata.com"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The full URL for the personalization API is"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{baseURL}/{database}/{table}"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here is an example:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://us01.p13n.in.treasuredata.com/personalization__database/preferences_table"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"headers","__idx":3},"children":["Headers"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These are the required headers for the API call."]},{"$$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":"Name"},"children":["Name"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Content"},"children":["Content"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Content-Type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Vendor-specific JSON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["application vnd.treasuredata.v1+json"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WP13n-Token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Concatenated Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The token is created by combining the following elements:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["{account id}/{instance id}/{token}"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, for account ID 1, instance ID 8, and a valid Web Personalization token, the token would be formatted as follows ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1/8/12345789abcdef••••••••••••••••••"]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authorization"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure API Key"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TD1 1/abcdef••••••••••••••••••••••0123456789"]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"personalization-api-definition","__idx":4},"children":["Personalization API Definition"]},{"$$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":"HTTP Verb"},"children":["HTTP Verb"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Resource"},"children":["Resource"]},{"$$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":["POST"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["/{database}/{tables}"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Get offers for request"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-body","__idx":5},"children":["Request Body"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["[In progress: Pardon our dust]"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"responses","__idx":6},"children":["Responses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["204 Successful Ingestion"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["400 Bad Request"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3000: RT token was not provided (X-Token header)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3001: RT token is not in the configuration"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3002: RT token account conflicts with Authed user account"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3003: RT token is in an invalid format"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3004: Invalid event object."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["429 Too Many Requests"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2003: Kinesis error due to limit being exceeded"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2013: Lambda total concurrent execution exceeds the reserved concurrency"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["500 Internal Server Error"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["9999: Unknown/undiagnosed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1001: Treasure API is unreachable or timed out"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1002: Table API is unreachable or timed out"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1003: Kinesis is unreachable or timed out"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1004: Lambda is unreachable or timed out"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["1005: MemoryDB is unreachable or timed out"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2001: Kinesis stream was not found"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2002: Kinesis operation threw an error"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2011: Lambda function was not found"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2012: Lambda function threw an error, or the response was unhandled"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2014: Lambda invocation failed"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2015: Lambda reactor configuration doesn't have the token yet"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["2021: MemoryDB operation threw an error"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["3010: RT Token is configured with a reactor whose token is inconsistent (account or reactor ID)"]}]}]},"headings":[{"value":"Creating a Real Time Activation Using Real-time Personalization API","id":"creating-a-real-time-activation-using-real-time-personalization-api","depth":1},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Endpoints and Base URLs","id":"endpoints-and-base-urls","depth":2},{"value":"Headers","id":"headers","depth":2},{"value":"Personalization API Definition","id":"personalization-api-definition","depth":2},{"value":"Request Body","id":"request-body","depth":2},{"value":"Responses","id":"responses","depth":2}],"frontmatter":{"seo":{"title":"Creating a Real Time Activation Using Real-time Personalization API"}},"lastModified":"2026-06-01T09:09:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/real-time/creating-a-real-time-activation-using-the-rest-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}