AI Recommendations — API Reference

Hyper-personalized item recommendations for your customers

36 endpoints across 3 tags.

Recommendation campaigns

GET /recommendations/v2/campaigns — Get all recommendation campaigns

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetRecommendationCampaignsV2

Fetch all recommendation campaigns.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_MANY_CAMPAIGN_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
pagequeryintegeroptionalPage number
limitqueryintegeroptionalMaximum number of campaigns on a page
sortByqueryenum<"createdAt", "updatedAt", "startDate", "endDate", …>optionalName of the field by which data will be sorted
orderingqueryenum<"asc", "desc">optionalSorting order
includeMetaquerybooleanoptionalIf true, a meta JSON block with pagination data is included in the response body. If false, the pagination data is included in the response headers.
typequerystringoptionalFilters the results by campaign type.
statequeryarray<enum<"draft", "active", "paused">>optionalShows only results with states matching this parameter. When this parameter is omitted, all campaigns are returned regardless of state.
searchquerystringoptionalSearches campaigns by the specified phrase in their id and title.

Responses

StatusDescription
200 application/jsonReturns paginated campaigns. If showMeta was set to true, the metadata is included in the JSON response. If it was set to false, the metadata is included in the headers.
404 application/jsonCould not find campaigns
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/campaigns — Create a recommendation campaign

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/CreateRecommendationCampaignV2

Create a new recommendation campaign.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_CAMPAIGN_CREATE

User role permission required: campaigns_recommendations: create

Request body (required)

application/json · object

All the details of a campaign

Responses

StatusDescription
200 application/jsonOK campaign has been returned
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/campaigns \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}'

GET /recommendations/v2/campaigns/{campaignId} — Get recommendation campaign details

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetRecommendationCampaignV2

Retrieve the details of a single campaign.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_SINGLE_CAMPAIGN_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the campaign

Responses

StatusDescription
200 application/jsonData of a single campaign
404 application/jsonCould not find campaign
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/campaigns/{campaignId} — Update a recommendation campaign

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/UpdateRecommendationCampaignV2

Update a recommendation campaign by changing the parameters or copying the definition from another campaign.

When you copy from another campaign:

  • the following campaign data is NOT updated:
    • title
    • state
    • start_date
    • end_date
    • campaignId
    • createdAt
  • modified_by_user_id changes to the user who performed the update

API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_CAMPAIGN_UPDATE

User role permission required: campaigns_recommendations: update

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the campaign

Request body (required)

application/json · recommendation-campaigns-RecommendationCampaignUpdateRequest

Definition of the updated campaign.

FieldTypeRequiredDescription
copyConfigurationFromstringrequiredSource campaign ID. When you copy from another campaign: the following campaign data is NOT updated: title state start_date end_date campaignId createdAt modified_by_user_id changes to the user who performed the update

Responses

StatusDescription
200 application/jsonCampaign updated and returned
404 application/jsonCould not find campaign
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0},"campaignId":"string","title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","createdAt":"string","updatedAt":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","additionalResponseAttributes":["string"],"slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"},"abTest":{"experimentId":0,"variantId":0,"status":"NotStarted","isBaseline":true},"crossWorkspaceMode":{"enabled":true}}'

DELETE /recommendations/v2/campaigns/{campaignId} — Delete a recommendation campaign

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/DeleteRecommendationCampaign

Delete a recommendation campaign. This operation is irreversible.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_CAMPAIGN_DELETE

User role permission required: campaigns_recommendations: delete

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the campaign

Responses

StatusDescription
200 application/jsonOK campaign has been deleted
404 application/jsonCould not find campaign
500 application/jsonAn error occurred

Example request (cURL)

curl --request DELETE \
  --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/campaigns/state — Change campaigns' states

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/UpdateRecommendationsStatesV2

Change the status of one or more campaigns.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_STATE_CAMPAIGN_UPDATE

User role permission required: campaigns_recommendations: update

Request body (required)

application/json · recommendation-campaigns-RecommendationStateChangeRequestV2

List of updated campaign IDs and new states.

FieldTypeRequiredDescription
stateenum<"draft", "active", "paused", "deleted">requiredCampaign status
idsarray<string>requiredAn array of campaign IDs.

Responses

StatusDescription
200 application/jsonCampaigns status changed
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/campaigns/state \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"state":"draft","ids":["string"]}'

POST /recommendations/v2/campaigns/{campaignId}/copy — Copy a recommendation campaign

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/CopyRecommendationCampaignV2

Copy a campaign. The copied campaign's state will be draft and slug will be undefined.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_COPY_CAMPAIGN_CREATE

User role permission required: campaigns_recommendations: create

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the campaign

Responses

StatusDescription
200 application/jsonCopy created and returned
404 application/jsonCould not find campaign
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D/copy \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

GET /recommendations/v2/campaigns/simplified — Get simplified recommendation campaigns

/api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetSimplifiedRecommendationCampaign

Fetch simplified recommendation campaign data.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: RECOMMENDATIONS_V2_MANY_SIMPLIFIED_CAMPAIGN_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
typequeryarray<string>optionalFilter by campaign type.
statequeryarray<enum<"draft", "active", "paused">>optionalFilter by states.

Responses

StatusDescription
200 application/jsonSimplified campaigns returned
404 application/jsonCould not find campaign
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Recommendation statistics

POST /recommendations/v2/campaigns/stats — Get recommendation campaign statistics

/api-reference/ai-recommendations#tag/Recommendation-statistics/operation/PostCampaignsStats

Retrieves the statistics of campaigns defined in the request.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: AI_STATS_READ

User role permission required: campaigns_recommendations: read

Request body (required)

application/json · object

Request for recommendation campaigns stats.

FieldTypeRequiredDescription
campaignIdsarray<string>requiredList of campaign IDs for which the statistics are requested. Must not be empty.
fromstringoptionalUpper bound of the interval for which the statistics will be retrieved.Must be provided with to, otherwise the filter is treated as unspecified.If not specified, the interval is last 7 days.
tostringoptionalLower bound of the interval for which the statistics will be retrieved.Must be provided with from, otherwise the filter is treated as unspecified.If not specified, the interval is last 7 days.
timeZonestringoptionalTime zone identifier.

Responses

StatusDescription
200 application/jsonStatistics returned
500 application/jsonService error
4xx application/jsonIncorrect request

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/campaigns/stats \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignIds":["string"],"from":"2019-08-24","to":"2019-08-24","timeZone":"Europe/Warsaw"}'

GET /recommendations/v2/campaigns/stats/global — Get global recommendation campaign statistics

/api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetCampaignsGlobalStats

Retrieves the statistics of all recommendation campaigns.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: AI_STATS_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
fromquerystringoptionalUpper bound of the interval for which the statistics will be retrieved.Must be provided with from, otherwise the filter is treated as unspecified.If not specified, the interval is last 7 days.
toquerystringoptionalLower bound of the interval for which the statistics will be retrieved. If not specified, the interval is last 7 days.
timeZonequerystringoptionalTime zone identifier.

Responses

StatusDescription
200 application/jsonStatistics returned
500 application/jsonService error
4xx application/jsonIncorrect request

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

GET /recommendations/v2/campaigns/{campaignId}/stats — Get recommendation campaign statistics

/api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetCampaignStats

Retrieves the statistics of a single recommendation campaign.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: AI_STATS_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the recommendation campaign
fromquerystringoptionalUpper bound of the interval for which the statistics will be retrieved.Must be provided with from, otherwise the filter is treated as unspecified.If not specified, the interval is last 7 days.
toquerystringoptionalLower bound of the interval for which the statistics will be retrieved. If not specified, the interval is last 7 days.
timeZonequerystringoptionalTime zone identifier.

Responses

StatusDescription
200 application/jsonStatistics returned
500 application/jsonService error
4xx application/jsonIncorrect request

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

GET /recommendations/v2/campaigns/{campaignId}/products/stats — Get statistics for top items in a campaign

/api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetRecoTopProductsStats

Retrieves the statistics of top products for a single recommendation campaign.


API consumers: Workspace (Business Profile), Synerise User

API key permission required: AI_STATS_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
campaignIdpathstringrequiredID of the recommendation campaign
fromquerystringoptionalUpper bound of the interval for which the statistics will be retrieved.Must be provided with from, otherwise the filter is treated as unspecified.If not specified, the interval is last 7 days.
toquerystringoptionalLower bound of the interval for which the statistics will be retrieved. If not specified, the interval is last 7 days.
timeZonequerystringoptionalTime zone identifier.
metricqueryenum<"views", "clicks", "revenue", "generations", …>optionalThe response will include statistics for up to 10 top-performing items according to the selected metric, sorted from best to worst. If not specified, the default metric is views. views - the number of displayed recommendation frames. generations - the number of generated recommendation frames. clicks - the number of times an item in a recommendation frame was clicked. charges - the number of transactions caused by the recommendation. revenue - the revenue generated by the recommendation.

Responses

StatusDescription
200 application/jsonStatistics returned
500 application/jsonService error
4xx application/jsonIncorrect request

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

Recommendations

GET /recommendations/v2/recommend/campaigns/{campaignIdentifier} — Get recommendations by campaign

/api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendationsByCampaignV2

This method allows you to retrieve recommendations based on a campaignID or a slug and a context. The context is built based on:

  • campaign identifier (required)
  • profile UUID
  • items (for example, items currently in the basket)
  • item exclusions

This is the recommended and simplest way to fetch recommendations.

Before you use this method, you must to create a recommendations campaign in Synerise. All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.


API consumers: AI API key (legacy), Web SDK Tracker, Workspace (Business Profile)

API key permission required: API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
campaignIdentifierpathstringrequiredRecommendation campaign identifier - a campaignID or a slug
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
itemIdquerystringoptionalItem ID or item IDs for the recommendation context. This parameter is: required for similar/complementary items campaigns. optional for personalized campaigns. This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters. You can repeat this parameter in order to pass a number of context-creating items, for example, in a cart recommendation campaign. This overrides the itemsSource settings of the campaign definition. Alternatively, you can pass the itemsSourceType and itemsSourceId parameters to use context items from source (aggregate or expression). These parameters can't be used at the same request with itemId.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
itemsSourceTypequeryenum<"aggregate", "expression">optionalItem ID or item IDs source type for the recommendation context. Must be used with itemSourceId. This overrides the itemsSource settings of the campaign definition. In recommendations whose models doesn't use the item context, the attributes of those items can only be used in filters. If the items' source type is 'aggregate', the aggregate result will be used as context items. If the items' source type is 'expression', the expression result will be used as context items. The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request. Alternatively, you can pass the itemId parameter to define context items directly. Only one of these options is allowed at the same time.
itemsSourceIdquerystringoptionalSource of item IDs for the recommendation context. In recommendations whose models doesn't use the item context, the attributes of those items can only be used in filters. Must be used with itemsSourceType. If the items' source type is 'aggregate', this is the aggregate's ID. If the items' source type is 'expression', this is the expression's ID. The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request. Alternatively, you can pass the itemId parameter to define context items directly. Only one of these options is allowed at the same time.
externalItemIdquerystringoptionalItems provided by an external recommendation model to be returned as recommendation results. You can repeat this parameter to pass multiple external items. This parameter is used with campaigns of type "external-items".
itemIdExcludedquerystringoptionalIDs of items that will be excluded from the generated recommendations. For example, items already added to the basket.
additionalFiltersquerystringoptional IMPORTANT: The filtersJoiner attribute is REQUIRED when additionalFilters is included. If filtersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional filters. These are merged with the campaign's own filters according to the logic in filtersJoiner. This parameter must include all the additional filters as a single string, for example additionalFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
filtersJoinerqueryenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalFilters with the campaign's existing filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
additionalElasticFiltersquerystringoptional IMPORTANT: The elasticFiltersJoiner attribute is REQUIRED when additionalElasticFilters is included. If elasticFiltersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional elastic filters. These are merged with the campaign's own elastic filters according to the logic in elasticFiltersJoiner. This parameter must include all the additional filters as a single string, for example additionalElasticFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
elasticFiltersJoinerqueryenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalElasticFilters with the campaign's existing elastic filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
displayAttributequerystringoptionalItem attribute whose value will be returned in the recommendation response. The parameter value will be merged with the configuration of the recommendation. This parameter can be passed multiple times.
includeContextItemsquerybooleanoptionalWhen true, the recommendation response will include context items metadata.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.

Responses

StatusDescription
200 application/jsonRecommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
404 application/jsonNo recommendations could be generated for the specified campaign and context.
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/campaigns — Get recommendations by campaign

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendationsByCampaignV2

This method allows you to retrieve recommendations based on a campaignID or slug and a context. The context is built based on:

  • campaign ID or slug (one of those is required)
  • profile UUID
  • items (for example, items currently in the basket)
  • item exclusions

This is the recommended and simplest way to fetch recommendations.

Before you use this method, you must to create a recommendations campaign in Synerise. All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.


API consumers: AI API key (legacy), Web SDK Tracker, Workspace (Business Profile)

API key permission required: API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_READ

Request body

application/json · recommendations-api-materializer-PostRecommendationsRequest

FieldTypeRequiredDescription
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
campaignIdstringoptionalRecommendation campaign ID for establishing the context
slugstringoptionalRecommendation campaign slug for establishing the context
itemsarray<string>optionalAn array of item identifiers (itemId in the item feed) for the context. This could be, for example, the current basket, or the item that is currently being viewed. This overrides the itemsSource settings of the campaign definition. This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters. Alternatively, you can use the itemsSource object to get item IDs from an aggregate or expression. items and itemsSource can't be used at the same time.
itemsSourceobjectoptionalSource of the Item ID or item IDs for the recommendation context. This overrides the itemsSource settings of the campaign definition. This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters. The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request. Alternatively, you can pass the itemId parameter to define context items directly. Only one of these options is allowed at the same time.
itemsExcludedarray<string>optionalItems (identified by itemId in the item feed) that will be excluded from the generated recommendations. For example, items already added to the basket.
additionalFiltersstringoptional IMPORTANT: The filtersJoiner attribute is REQUIRED when additionalFilters is included. If filtersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional filters. These are merged with the campaign's own filters according to the logic in filtersJoiner. This parameter must include all the additional filters as a single string, for example additionalFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
filtersJoinerenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalFilters with the campaign's existing filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
additionalElasticFiltersstringoptional IMPORTANT: The elasticFiltersJoiner attribute is REQUIRED when additionalElasticFilters is included. If elasticFiltersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional elastic filters. These are merged with the campaign's own elastic filters according to the logic in elasticFiltersJoiner. This parameter must include all the additional filters as a single string, for example additionalElasticFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
elasticFiltersJoinerenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalElasticFilters with the campaign's existing elastic filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
displayAttributesarray<string>optionalAn array of item attributes which value will be returned in a recommendation response. The array will be merged together with the configuration of the recommendation.
includeContextItemsbooleanoptionalWhen true, the recommendation response will include context items metadata.
recommendedItemsFromExternalModelarray<array<string>>optionalItems provided by an external recommendation model to be returned as recommendation results. This parameter is used with campaigns of type "external-items".
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.

Responses

StatusDescription
200 application/jsonRecommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
404 application/jsonNo recommendations could be generated for the specified campaign and context.
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/campaigns \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"clientUUID":"string","campaignId":"string","slug":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}'

POST /recommendations/v2/recommend/campaigns/{campaignIdentifier}/by/{identifierName} — Get recommendations by campaign and profile identifier

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendationsByCampaignAndidentifierNameV2

Before you use this method: you must create a recommendations campaign in Synerise. All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.

The method allows you to retrieve recommendations based on a campaignID or a slug, profile's identifier name (the value of the identifier is provided in the request body), and a context. The context is built based on:

  • campaign identifier (required)
  • identifierName (required)
  • identifierValue (required)
  • items (for example, items currently in the basket)
  • item exclusions

API consumers: Workspace (Business Profile), Synerise User

API key permission required: API_MATERIALIZER_V2_RECOMMEND_WITH_CUSTOM_ID_RECOMMENDATIONS_READ

User role permission required: campaigns_recommendations: read

Parameters

NameInTypeRequiredDescription
campaignIdentifierpathstringrequiredRecommendation campaign identifier - a campaignID or a slug
identifierNamepathenum<"id", "uuid", "email", "custom_identify">requiredThe name of the profile identifier to use for the request. By default, the allowed identifier types are id, uuid, email, and custom_identify. This may be changed in the workspace configuration.

Request body

application/json · recommendations-api-materializer-PostRecommendationsWithIdentifierValueRequest

FieldTypeRequiredDescription
identifierValuestringrequiredValue of the identifier selected in the path attributes
itemsarray<string>optionalAn array of item identifiers (itemId in the item feed) for the context. This could be, for example, the current basket, or the item that is currently being viewed. This overrides the itemsSource settings of the campaign definition. This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters. Alternatively, you can use the itemsSource object to get item IDs from an aggregate or expression. items and itemsSource can't be used at the same time.
itemsSourceobjectoptionalSource of the Item ID or item IDs for the recommendation context. This overrides the itemsSource settings of the campaign definition. This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters. The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request. Alternatively, you can pass the itemId parameter to define context items directly. Only one of these options is allowed at the same time.
itemsExcludedarray<string>optionalItems (identified by itemId in the item feed) that will be excluded from the generated recommendations. For example, items already added to the basket.
additionalFiltersstringoptional IMPORTANT: The filtersJoiner attribute is REQUIRED when additionalFilters is included. If filtersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional filters. These are merged with the campaign's own filters according to the logic in filtersJoiner. This parameter must include all the additional filters as a single string, for example additionalFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
filtersJoinerenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalFilters with the campaign's existing filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
additionalElasticFiltersstringoptional IMPORTANT: The elasticFiltersJoiner attribute is REQUIRED when additionalElasticFilters is included. If elasticFiltersJoiner is missing, the additional filters do not work. Do NOT send multiple instances of this parameter. Additional elastic filters. These are merged with the campaign's own elastic filters according to the logic in elasticFiltersJoiner. This parameter must include all the additional filters as a single string, for example additionalElasticFilters=effectivePrice>300 AND effectivePrice<400 (the spaces are required).
elasticFiltersJoinerenum<"AND", "OR", "REPLACE">optionalDefines the logic of merging additionalElasticFilters with the campaign's existing elastic filters. REPLACE replaces the campaign's filters with your filters. AND matches if both your filters and the campaign filters are met. OR matches if at least one of the filters is met.
displayAttributesarray<string>optionalAn array of item attributes which value will be returned in a recommendation response. The array will be merged together with the configuration of the recommendation.
includeContextItemsbooleanoptionalWhen true, the recommendation response will include context items metadata.
recommendedItemsFromExternalModelarray<array<string>>optionalItems provided by an external recommendation model to be returned as recommendation results. This parameter is used with campaigns of type "external-items".
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.

Responses

StatusDescription
200 application/jsonRecommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
404 application/jsonNo recommendations could be generated for the specified campaign and context.
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"identifierValue":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}'

POST /recommendations/v2/recommend/campaigns/preview — Preview campaign recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostPreviewRecommendations

This method allows you to preview recommendations for a campaign with a given configuration before creating it.

Note: This method is not an alternative to creating recommendations for an existing campaign. It is intended for testing purposes only.

The recommendation context is built based on:

  • profile UUID
  • items
  • item exclusions

API consumers: Workspace (Business Profile), Synerise User

API key permission required: API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_PREVIEW_READ

User role permission required: campaigns_recommendations: read

Request body

application/json · object

FieldTypeRequiredDescription
clientUUIDstringoptionalUUID of the client
itemsarray<recommendations-api-materializer-Item>optionalA list of itemIds for building the context. Alternatively, you can use the itemsSource parameter to provide the context. Item context is required by these recommendation types: similar, cross-sell, set-complement, visually-similar, item-comparison. In other recommendation types, the item context is optional, but may be used by the model when scoring items.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).

Responses

StatusDescription
200 application/jsonRecommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
404 application/jsonNo recommendations could be generated for the specified campaign and context.
429 application/jsonThe user has sent too many requests in a given amount of time ("rate limiting").
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/campaigns/preview \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"clientUUID":"50829d26-5337-410e-9365-b40f7a01bb61","items":["string"],"includeContextItems":false,"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"preview","campaignId":"preview","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}'

GET /recommendations/v2/recommend/items/users/{clientUuid} — Personalized recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/RecommendForUserV2

Retrieve item recommendations for a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_PERSONALIZED_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredRecommendations will be generated for the provided profile UUID.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemIdquerystringoptionalItem identifier, equal to itemId from the item feed. It can be used to define the item context of the query.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonPersonalized recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/users/{clientUuid} — Personalized recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendForUserV2

Retrieve item recommendations for a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_PERSONALIZED_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredRecommendations will be generated for the provided profile UUID.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonPersonalized recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

POST /recommendations/v2/recommend/items/users/{clientUuid}/sections — Section recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendSectionsForUserV2

Retrieve item recommendations grouped by attribute.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_SECTION_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.

Request body (required)

application/json · recommendations-rust-all-SectionsSlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
metadataCatalogIdstringoptionalID of the catalog which stores attribute metadata
slotsarray<recommendations-rust-all-SectionSlotSchemaV2>requiredSlots data

Responses

StatusDescription
200 application/jsonSection recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"numRows":1,"numItems":1,"filters":"string","elasticFilters":"string"}]}'

POST /recommendations/v2/recommend/items/users/{clientUuid}/attributes — Attribute recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendAttributesForUserV2

Retrieve attribute recommendations.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_ATTRIBUTE_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.

Request body (required)

application/json · recommendations-rust-all-AttributesSlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
metadataCatalogIdstringoptionalID of the catalog which stores attribute metadata
slotsarray<recommendations-rust-all-AttributeSlotSchemaV2>requiredSlots data

Responses

StatusDescription
200 application/jsonAttribute recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"minNumItems":1,"maxNumItems":5,"filters":"string","elasticFilters":"string"}]}'

GET /recommendations/v2/recommend/items/users/{clientUuid}/last — Last viewed recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/RecommendLastViewedForUserItems

Retrieve recent item recommendations seen by a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_LAST_VIEWED_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonLast viewed recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/users/{clientUuid}/last — Last viewed recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendLastViewedForUserItems

Retrieve recent item recommendations seen by a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_LAST_VIEWED_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonLast viewed recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/users/{clientUuid}/aggregates/{aggregateUUID} — Recent interactions recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendRecentInteractions

Retrieve recent interactions recommendations for a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_RECENT_INTERACTIONS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.
aggregateUUIDpathstringrequiredInformation will be shown for the provided aggregate UUID.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonRecent interactions recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/users/{clientUuid}/aggregates/{aggregateUUID} — Recent interactions recommendations

/api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendRecentInteractions

Retrieve recent interactions recommendations for a profile.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_RECENT_INTERACTIONS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUuidpathstringrequiredInformation will be shown for the provided profile UUID.
aggregateUUIDpathstringrequiredInformation will be shown for the provided aggregate UUID.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonRecent interactions recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/metric — Scoring by metric

/api-reference/ai-recommendations#tag/Recommendations/operation/GetItemsByMetric

Returns items with the highest score of a chosen metric. A list of available metrics can be checked by using this endpoint.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_METRICS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
sortMetricquerystringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
itemIdquerystringoptionalItem identifier, equal to itemId from the item feed. It can be used to define the item context of the query.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonItems with the highest metric scores
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/metric — Scoring by metric

/api-reference/ai-recommendations#tag/Recommendations/operation/PostItemsByMetric

Returns items with the highest score of a chosen metric. A list of available metrics can be checked by using this endpoint.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_METRICS_RECOMMENDATIONS_READ

Request body (required)

application/json · recommendations-rust-all-MetricsBodySchemaV2

Definition of the requested recommendation

Responses

StatusDescription
200 application/jsonItems with the highest metric scores
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/metric \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/complementary — Complementary items for a cart

/api-reference/ai-recommendations#tag/Recommendations/operation/ComplementItems

Show recommendations based on the contents of a cart.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_COMPLEMENTARY_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemIdqueryarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
boostMetricquerystringoptionalID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results. The list of available metrics can be checked by using this endpoint.
sortMetricquerystringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonCart complementary recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/complementary — Complementary items for a cart

/api-reference/ai-recommendations#tag/Recommendations/operation/PostComplementItems

Show recommendations based on the contents of a cart.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_COMPLEMENTARY_RECOMMENDATIONS_READ

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonCart complementary recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/complementary \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/{itemId}/complementary — Complementary items

/api-reference/ai-recommendations#tag/Recommendations/operation/GetComplementaryItems

Returns items complementary to the given items.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_COMPLEMENTARY_PRODUCTS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonItems complementary to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/{itemId}/complementary — Complementary items

/api-reference/ai-recommendations#tag/Recommendations/operation/PostComplementaryItems

Returns items complementary to the given items.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_COMPLEMENTARY_PRODUCTS_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonItems complementary to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/{itemId}/similar — Similar items

/api-reference/ai-recommendations#tag/Recommendations/operation/GetSimilarItems

Returns items similar to a given item.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_SIMILAR_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonItems similar to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/{itemId}/similar — Similar items

/api-reference/ai-recommendations#tag/Recommendations/operation/PostSimilarItems

Returns items similar to a given item.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_SIMILAR_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonItems similar to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/{itemId}/similar/visual — Visually similar

/api-reference/ai-recommendations#tag/Recommendations/operation/GetSimilarVisualItems

Returns items visually similar to the given items.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_VISUAL_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.
inventoryChannelIdquerystringoptionalInventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
crossWorkspaceModequerybooleanoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.

Responses

StatusDescription
200 application/jsonItems visually similar to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/{itemId}/similar/visual — Visually similar

/api-reference/ai-recommendations#tag/Recommendations/operation/PostSimilarVisualItems

Returns items visually similar to the given items.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_VISUAL_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
itemIdpathstringrequiredItem identifier, equal to itemId from the item feed.

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonItems visually similar to the given item
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

GET /recommendations/v2/recommend/items/next-interaction — Next interaction

/api-reference/ai-recommendations#tag/Recommendations/operation/NextInteractionRecommendation

The "next interaction" model recommends items that are most likely to produce a page.visit or product.buy event.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_NEXT_INTERACTION_RECOMMENDATIONS_READ

Parameters

NameInTypeRequiredDescription
clientUUIDquerystringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
minNumItemsqueryintegeroptionalThe minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
maxNumItemsqueryintegeroptionalThe maximal number of returned item recommendations.
campaignIdquerystringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamequerystringoptionalThe campaign name which will be included in the recommendation.generated event.
excludePurchasedItemsquerybooleanoptionalWhen true, the recommendation results will include only items that the profile hasn't purchased before.IMPORTANT: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
excludePurchasedItemsSinceDaysqueryintegeroptionalLimits the application of the excludePurchasedItems filter to a specified number of days.
filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
elastic:filtersquerystringoptionalThis string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.For information on building filters, see "Items Query Language (IQL)" in the Developer Guide.
itemIdqueryarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
itemCatalogIdquerystringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
boostMetricquerystringoptionalID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results. The list of available metrics can be checked by using this endpoint.
sortMetricquerystringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
distinctFilterqueryobjectoptional
includeContextItemsquerybooleanoptionalThe recommendation results will include context items from the request.
paramsqueryarray<string>optionalList of extra params that will be added to the recommendation.generated event. They must be in the name:value format. The total size must not exceed 500 bytes when written as a JSON object.

Responses

StatusDescription
200 application/jsonNext interaction recommendation
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request GET \
  --url 'https://api.synerise.com/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'

POST /recommendations/v2/recommend/items/next-interaction — Next interaction

/api-reference/ai-recommendations#tag/Recommendations/operation/PostNextInteractionRecommendation

The "next interaction" model recommends items that are most likely to produce a page.visit or product.buy event.

Note: The definition of an item encompasses products, but also articles, images, videos, and any other entities in the item feed.


API consumers: AI API key (legacy), Workspace (Business Profile), Web SDK Tracker

API key permission required: RECOMMENDATIONS_V2_NEXT_INTERACTION_RECOMMENDATIONS_READ

Request body (required)

application/json · recommendations-rust-all-SlotsBodySchemaV2

Definition of the requested recommendation

FieldTypeRequiredDescription
campaignIdstringoptionalThe campaignId which will be passed as utm_campaign in a link to the recommended item.
campaignNamestringoptionalThe campaign name which will be included in the recommendation.generated event.
catalogIdstringoptionalID (not name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
clientUUIDstringoptionalProfile UUID. This parameter is required for these recommendation types: Personalized Last seen Recent interactions Section Attribute This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
contextItemIdsarray<string>optionalItem identifiers, equal to itemId from the item feed. They can be used to define the item context of the query.
includeContextItemsbooleanoptionalThe recommendation results will include context items from the request.
filterRulesobjectoptionalFilter configuration
displayAttributesstringoptionalAttributes to be returned
abTestContextobjectoptionalA/B test context.
paramsobjectoptionalExtra parameters that will be added to the recommendation.generated event. The total size must not exceed 500 bytes.
inventoryContextoptionalInventory context used to evaluate inventory-related filters and boosting strategies. Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
keepSlotsOrderbooleanoptional When true, the data array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in data are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot. When false, the data array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect. The additional extras.slots object always shows slots and items as if this setting was true. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
personalizeSlotsOrderbooleanoptionalSort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns. If you want to set personalizeSlotsOrder to true, keepSlotsOrder must also be true.
sortMetricstringoptionalID of the metric to sort the results by. The list of available metrics can be checked by using this endpoint.
boostingParametersobjectoptionalResult boosting parameters
boostingStrategiesarray<recommendations-rust-all-BoostingStrategyV2>optionalBoosting strategies
crossWorkspaceModeobjectoptionalSpecifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
slotsarray<recommendations-rust-all-SlotSchemaV2Rust>requiredSlot definitions. To apply default values and fetch all the results as a single slot, send slots as an array with one empty object.

Responses

StatusDescription
200 application/jsonNext interaction recommendations
404 application/jsonNo recommendations could be generated for the specified profile and filters
500 application/jsonAn error occurred

Example request (cURL)

curl --request POST \
  --url https://api.synerise.com/recommendations/v2/recommend/items/next-interaction \
  --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'

Back to all API categories