Query User CDP
Last updated at: 2026-01-10 Note: The next major update is scheduled for late January 2026.
Query User CDP
Supports developers to query Agent/Workflow user CDP information through user ID or anonymous ID, including user ID, anonymous ID, and conversation type.
User CDP information is stored under Agent/Workflow. Data for the same user is isolated across different Agents/Workflows.
Request Method
GET
Request URL
https://altatech.ai/v1/user/get-user-cdp
Authentication
Please refer to the authentication method described in the API Overview.
Request
Request Examples
Query by user_id:
curl -X GET 'https://altatech.ai/v1/user/get-user-cdp?user_id=BC123' \
-H 'Authorization: Bearer ${token}'
Query by anonymous_id:
curl -X GET 'https://altatech.ai/v1/user/get-user-cdp?anonymous_id=22ses32dsafdabd1w2sad' \
-H 'Authorization: Bearer ${token}'
Query by both user_id and anonymous_id:
curl -X GET 'https://altatech.ai/v1/user/get-user-cdp?user_id=BC123&anonymous_id=22ses32dsafdabd1w2sad' \
-H 'Authorization: Bearer ${token}'
You can obtain the current user's anonymous ID through the anonymous_id in "Agent/Workflow Configuration - Reference Global Variables"
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | Bearer ${token} | Use Authorization: Bearer ${token} for authentication. Please obtain the key from the API Keys page to use as token. |
Request Parameters (Query Parameters)
| Parameter | Type | Description | Required |
|---|---|---|---|
| user_id | string | Developer-defined user ID | false |
| anonymous_id | string | Anonymous ID generated by altabots platform, usually generated based on the unique identifier of third-party platforms. Can be obtained through anonymous_id in Agent/Workflow Configuration - Reference Global Variables | false |
Note: - At least one of user_id or anonymous_id must be provided, otherwise a parameter error will be returned. - You can pass only user_id to query all binding information for that user - You can pass only anonymous_id to query user information associated with that anonymous ID - You can pass both user_id and anonymous_id for precise query
Response
Response Body
{
"code": 0,
"message": "OK",
"data": {
"user1": {
"user_id": "user1",
"anonymous_ids": [
{
"anonymous_id": "aId3",
"conversation_type": "WEB",
"source_id": null
}
]
},
"67b58121035e5b152b0419ee": {
"user_id": "67b58121035e5b152b0419ee",
"anonymous_ids": [
{
"anonymous_id": "aId3",
"conversation_type": "C",
"source_id": null
}
]
}
}
}
Success Response
The response is an object where the key is user_id and the value is the CDP information for that user:
| Field | Type | Description |
|---|---|---|
| {user_id} | object | Object with user ID as key, containing complete CDP information for that user |
| {user_id}.user_id | string | User ID |
| {user_id}.anonymous_ids | array | All anonymous IDs currently bound to this user ID and their conversation types |
| {user_id}.anonymous_ids[].anonymous_id | string | Anonymous ID |
| {user_id}.anonymous_ids[].conversation_type | string | Conversation type, mapping table can be found in conversation_type in User Overview |
| {user_id}.anonymous_ids[].source_id | string | Source ID from the conversation source platform, e.g., when integrated as TELEGRAM with 2 TG Bots added, each Bot will have its own Source ID |
Error Response
| Field | Type | Description |
|---|---|---|
| code | int | Error code |
| message | string | Error message |
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Parameter error (no query parameters provided) |
| 401 | Unauthorized |
| 403 | Insufficient permissions |
| 500 | Server error |