The Profiles Page groups data by customers or accounts. The Profiles API Token enables your ability to increase personalized content based on detailed customer information.
You can also use Profiles API Token to personalize your customers' experience on your website. You can combine Treasure Data's personalization feature with A/B Testing tools such as Adobe Target, Optimizely, or Google Optimize, to determine the version of your website that yields results.
When the underlying personalization workflow completes, the personalization data set is refreshed. You can see a current list of the segments to which a specific profile belongs. You can also see a list of attributes associated with the specific profile.
The parent segment must already exist in Parent Segments. The parent segment is the basis for all data accessed by Profiles API Tokens.
For web clients, use the Treasure Data JavaScript SDK to fetch profile segment IDs. Profiles API Tokens are supported by JavaScript SDK v1.9.1 or later. If you're using an older version, you must upgrade.
For server-side integrations, you can call Profiles API directly over HTTPS without a client SDK. See Calling Profiles API Without an SDK (Server-Side).
The Profiles API can be called directly over HTTPS, without using the iOS SDK, the Treasure Data JavaScript SDK, or any other client SDK. This is useful for looking up a profile's segments and attributes from your own backend—for example, from a server-side personalization service, or from a mobile app backend that doesn't want to embed a Profiles API Token in the app binary.
For new real-time personalization use cases, consider the Real Time Personalization API, which is designed for server-to-server integration. This section is for accounts already using Profiles API Tokens that want to call them outside the browser/SDK context.
GET /cdp/lookup/collect/segments
Host: cdp.in.treasuredata.comUse the host for your region:
| Region | Host |
|---|---|
| US | cdp.in.treasuredata.com |
| EU | cdp-eu01.in.treasuredata.com |
| Korea | cdp-ap02.in.treasuredata.com |
| Tokyo | cdp-tokyo.in.treasuredata.com |
See Treasure API baseURLs for other regions.
Query parameters
| Name | Description |
|---|---|
version | Must be 2. |
token | The ID (UUID) of your Profiles API Token. To query multiple tokens in one call, pass a comma-separated list. |
key.<column_name> | The lookup key column and value for the profile you want to find—for example, key.customer_id=customer-123. <column_name> must match the Lookup Key configured on the token. |
callback | Optional. Only needed if you want a JSONP-wrapped response (for calling from a <script> tag in a browser). Omit this for server-side calls—without it, the API returns plain JSON. |
If the token's Lookup Key is td_global_id, the API ignores the value passed in the request and instead reads it from the visitor's _td_global browser cookie. This means td_global_id cannot be used as the lookup key for server-side calls, since there is no browser session to read the cookie from. Use a different lookup key, such as a custom identifier column, for server-side integrations.
Example
curl --get "https://cdp.in.treasuredata.com/cdp/lookup/collect/segments" \
--data-urlencode "version=2" \
--data-urlencode "token=YOUR_PROFILES_API_TOKEN_UUID" \
--data-urlencode "key.customer_id=customer-123"[
{
"values": ["100", "200"],
"attributes": {
"title": "Manager",
"area": "Japan"
},
"key": {
"customer_id": "customer-123"
},
"audienceId": "272739"
}
]| Field | Description |
|---|---|
values | IDs of the segments (batch and real-time) that the profile belongs to. |
attributes | The profile's attributes, as configured on the token. |
key | The lookup key column and value used for this request. |
audienceId | The ID of the Parent Segment the token belongs to. |
If you query multiple tokens in one request, the response array contains one element per token.
Error responses
| Status | Example | Cause |
|---|---|---|
400 Bad Request | {"error":"Bad Request","message":"Query parameter key.<column> is required but not set","status":400} | The required key.<column_name> parameter is missing. |
403 Forbidden | {"error":"Forbidden","message":"Invalid token","status":403} | The token doesn't exist or isn't valid for this account. |
For production backends, use timeouts and bounded exponential backoff for transient failures. Do not retry 400 or 403 responses without correcting the request.
A Profiles API Token is a public, unauthenticated token—anyone who has the token value can query it directly. Never configure PII (email, phone number, name, etc.) as a returned attribute on a token; only include attributes that are safe to expose to anyone who obtains the token. The key object in the response mirrors the lookup key and value; it is not a returned profile attribute. Use a non-PII identifier where possible and protect request URLs and logs if lookup values can identify a person. Because the token is included in the query string, configure server and proxy logs to redact query parameters if you need to limit token and lookup-value exposure.