Skip to main content
POST/predictions/predict-for-user/

Predict for user

You can return a list of personalized product recommendations tailored to a specific contact.

NO AUTHORIZATION REQUIRED

This API endpoint does not require an API authorization key, to allow direct querying from the contact's browser.

AttributesTypeRequiredDescription
user_idstringno*The unique identifier for a contact from your system (must match the contact's custom_id in User). One of user_id or user_key is required.
user_keystringno*The User system identifier for a contact (from __ca__chat cookie). One of user_id or user_key is required.
limitnumbernoMaximum number of products to return (max 25).
segment_idnumbernoID of a product segment to filter recommendations (e.g., "Available Products").
categoriesarraynoArray of category names to filter by.
tagsarraynoArray of tag names to filter by.
extra_datanumbernoControls behavior when filters result in fewer products than limit. 0 (Strict) returns only matching products. 1 (Default) fills remaining slots with general recommendations.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/predictions/predict-for-user/" \
-H "Content-Type: application/json" \
-d '{
"user_id": "user_12345",
"limit": 5,
"segment_id": 101,
"extra_data": 0
}'

Response​

{
"recommended_products": [
{
"id": 85,
"name": "Classic Sneakers",
"custom_id": "SKU123",
"description": "Lightweight sneakers for everyday wear.",
"product_url": "https://www.example.com/product/classic-sneakers/",
"image_url": "https://www.example.com/images/classic-sneakers.jpg",
"qty": 1,
"created_at": "2026-11-10T14:20:02.361287Z",
"updated_at": "2026-11-10T14:20:02.361297Z",
"attributes": ,2 items
"categories": 1 item
}
]
}

Response fields​

Fields returned in the 200 OK response body.

FieldTypeDescription
array of objects
array of objectsRecommended products, most relevant first. At most limit products.
recommended_products[].id
integer
integerA unique identifier for the product which is given by User automatically.
recommended_products[].name
stringnullable
stringnullableA product name.
recommended_products[].custom_id
stringnullable
stringnullableA unique identifier for the product which is provided by the client. Usually related to the product’s SKU.
recommended_products[].description
stringnullable
stringnullableDescription of the product, or null.
recommended_products[].product_url
string (URL)nullable
string (URL)nullableA URL of a product.
recommended_products[].image_url
string (URL)nullable
string (URL)nullableA URL of a product image.
recommended_products[].qty
integernullable
integernullableQuantity of the product, or null if not set.
recommended_products[].created_at
string (date-time)
string (date-time)A creation date of a product.
recommended_products[].updated_at
string (date-time)
string (date-time)A date of last product update.
array of objects
array of objectsCustom product attributes that have a value, each with name, name_std, value, description and value_type.
recommended_products[].attributes[].name
string
stringName of the attribute.
recommended_products[].attributes[].name_std
string
stringStandardized name of the attribute, used as its key in the API.
recommended_products[].attributes[].value
array of string | integer | number | string | string (date)
array of string | integer | number | string | string (date)Value of the attribute for this product.
recommended_products[].attributes[].description
string
stringDescription of the attribute.
recommended_products[].attributes[].value_type
integer
integerValue type of the attribute: 1 boolean, 2 integer, 3 date, 4 string, 5 datetime, 6 fixed (a list of choices), 7 float or 8 JSON.
array of objects
array of objectsCategories the product belongs to.
recommended_products[].categories[].id
integer
integerA unique identifier for the category which is given by User automatically.
recommended_products[].categories[].name
string
stringA category name.
recommended_products[].categories[].description
string
stringDescription of the category.
recommended_products[].categories[].custom_id
stringnullable
stringnullableA unique identifier for the category which is provided by the client, or null.