Media rules and assets tools

list_site_search_media_rules

Lists the site-search media rules (campaigns) in your account. Media rules inject sponsored content, banners, and promotional placements into search results for specific queries. Unlike ranking rules, which reorder organic products, media rules add paid or promoted content to the results page.

Each rule targets one or more search queries and can be scheduled, A/B tested, and aimed at an audience. The response returns paginated rule summaries with enabled status, scheduling, and associated queries. Use the duration filter to find rules that are about to expire or have already expired, and get_discovery_media_rule for a rule's full configuration.

Request parameters

NameTypeRequired?Description
pageintNoPage number, 0-based. Defaults to 0.
limitintNoResults per page. Defaults to 10.
sort_bystrNoField to sort by. Defaults to lastModifiedAt.
sort_orderstrNoSort direction: ASC or DESC. Defaults to DESC.
qstr | nullNoText search to filter by query or username.
durationstr | nullNoDuration filter, comma-separated: unscheduled, scheduled, active, expiringSoon, or expired.
audience_idsstr | nullNoComma-separated audience IDs to filter by.
enabledstr | nullNoEnabled filter: true or false.

Response parameters

The tool returns a CustomizationsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[CustomizationSummary]The media rule summaries.
errorstr | nullError message if the request failed.

The CustomizationSummary object has the following fields:

FieldTypeDescription
idintThe media rule's unique ID.
namestr | nullThe rule's display name.
ruleTypestrThe rule type. Always campaign for media rules.
isEnabledbool | nullWhether the rule is currently enabled.
syncStatusstr | nullSync status: SUCCESS, QUEUED, FAILED, EXPIRED, or FUTURE.
durationTagstr | nullDuration tag: unscheduled, scheduled, active, expiringSoon, or expired.
startedAtint | nullUnix timestamp in milliseconds of when the rule became active.
endedAtint | nullUnix timestamp in milliseconds of when the rule expires.
createdAtint | nullUnix timestamp in milliseconds of when the rule was created.
lastModifiedAtint | nullUnix timestamp in milliseconds of when the rule was last modified.
lastModifiedBystr | nullEmail or name of the user who last modified the rule.
querieslist[CustomizationQuery]The queries this rule applies to.
isAbTestLiveboolWhether an A/B test is currently active for this rule.
audienceNamestr | nullName of the audience segment this rule targets.

list_category_media_rules

Lists the category media rules (campaigns) in your account. These media rules inject sponsored content, banners, and promotional placements onto category pages. Unlike ranking rules, which reorder organic products, media rules add paid or promoted content to the category browsing experience.

Each rule targets one or more category queries and can be scheduled, A/B tested, and aimed at an audience. The response returns paginated rule summaries with enabled status, scheduling, and associated queries. Use get_discovery_media_rule for a rule's full configuration.

Request parameters

NameTypeRequired?Description
pageintNoPage number, 0-based. Defaults to 0.
limitintNoResults per page. Defaults to 10.
sort_bystrNoField to sort by. Defaults to lastModifiedAt.
sort_orderstrNoSort direction: ASC or DESC. Defaults to DESC.
qstr | nullNoText search to filter by query or username.
durationstr | nullNoDuration filter, comma-separated: unscheduled, scheduled, active, expiringSoon, or expired.
audience_idsstr | nullNoComma-separated audience IDs to filter by.
enabledstr | nullNoEnabled filter: true or false.

Response parameters

The tool returns a CustomizationsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[CustomizationSummary]The media rule summaries.
errorstr | nullError message if the request failed.

The CustomizationSummary object is described under list_site_search_media_rules.

list_global_media_rules

Lists the global media rules (campaigns) in your account. Global media rules control sponsored content and promotional placements that appear across all site search and category pages, regardless of the specific query or category. Unlike query-scoped or category-scoped rules, global rules apply universally, which makes them a fit for site-wide promotions and seasonal campaigns.

The response returns paginated rule summaries with enabled status, scheduling, and associated queries. Use get_discovery_media_rule for a rule's full configuration.

Request parameters

NameTypeRequired?Description
pageintNoPage number, 0-based. Defaults to 0.
limitintNoResults per page. Defaults to 10.
sort_bystrNoField to sort by. Defaults to lastModifiedAt.
sort_orderstrNoSort direction: ASC or DESC. Defaults to DESC.
qstr | nullNoText search to filter by query or username.
durationstr | nullNoDuration filter, comma-separated: unscheduled, scheduled, active, expiringSoon, or expired.
audience_idsstr | nullNoComma-separated audience IDs to filter by.
enabledstr | nullNoEnabled filter: true or false.

Response parameters

The tool returns a CustomizationsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[CustomizationSummary]The media rule summaries.
errorstr | nullError message if the request failed.

The CustomizationSummary object is described under list_site_search_media_rules.

get_discovery_media_rule

Returns the full configuration for a single media rule (campaign customization) by ID. The response includes the associated queries with their match types, scheduling, the campaign items (banners and content grid placements with slot positions and dimensions), audience targeting, A/B test state, and sync status.

Use list_site_search_media_rules, list_category_media_rules, or list_global_media_rules to find customization IDs.

Request parameters

NameTypeRequired?Description
customization_idintYesThe customization ID from a media rules list tool.

Response parameters

The tool returns a CustomizationDetailResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataany | nullThe full media rule configuration, as freeform JSON.
errorstr | nullError message if the request failed.

The data object contains the following key fields:

FieldTypeDescription
idintThe media rule's ID.
namestrThe rule name.
ruleTypestrAlways campaign for media rules.
enabledboolWhether the rule is active.
querieslistThe queries this rule applies to. Each has a query, a queryType, and a matchType of exact_match or broad_match.
customizationItemsobjectThe media placements. Contains campaign (a top banner spanning the grid width) and content_in_grid (in-grid placements between products, with banner IDs, slot positions, and dimensions).
startedAtint | nullUnix timestamp in milliseconds of when the rule became active.
endedAtint | nullUnix timestamp in milliseconds of when the rule expires.
audienceobjectAudience targeting, with an id and an audienceName.
syncStatusstrSync status: SUCCESS, QUEUED, or FAILED.
sharedIdintThe ID of the shared asset this rule references.
influencestrThe rule's scope, for example Global or Query.

list_discovery_assets

Lists the reusable media assets in your account. Assets are shared content items — banners, weblayers, and Clarity elements — that media rules reference. The response returns paginated asset summaries, which you can filter by data type or name.

To fetch a single asset's full content payload, pass its ID to get_discovery_asset. If you have access to more than one account, set account_name.

Request parameters

NameTypeRequired?Description
account_namestr | nullNoThe account name. Specify one if you have access to multiple accounts. Use list_discovery_accounts to see available accounts.
site_group_idstr | int | nullNoThe site group ID or site name. Defaults to account level (-1). Use list_discovery_sites to see available sites.
pageintNoPage number, 0-based. Defaults to 0.
limitintNoResults per page. Defaults to 10.
sort_bystrNoField to sort by: modifiedAt, createdAt, name, or dataType. Defaults to modifiedAt.
sort_orderstrNoSort direction: ASC or DESC. Defaults to DESC.
data_typesstr | nullNoComma-separated data types to filter by: banners, weblayer, or clarity.
qstr | nullNoSearch term to filter assets by name.

Response parameters

The tool returns an AssetsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[AssetSummary]The asset summaries.
errorstr | nullError message if the request failed.

The AssetSummary object has the following fields:

FieldTypeDescription
sharedDataIdint | nullThe asset's ID. Pass this to get_discovery_asset.
namestr | nullThe asset name.
dataTypestr | nullThe data type: banners, weblayer, or clarity.
userstr | nullThe user who last modified the asset.
createdAtint | nullUnix timestamp in milliseconds of when the asset was created.
modifiedAtint | nullUnix timestamp in milliseconds of when the asset was last modified.
merchantNamestr | nullThe merchant name.
domainKeystr | nullThe domain key.
deletedbool | nullWhether the asset has been deleted.
sitegroupIdint | nullThe site group ID.
sharedDatastr | nullThe asset content, as a JSON string. Populated when you fetch a single asset with get_discovery_asset.

get_discovery_asset

Returns the full details of a single asset by ID, including its content payload. The sharedData field holds the asset's content as a JSON string, such as the banner markup, weblayer definition, or Clarity configuration.

Use list_discovery_assets to find asset IDs.

Request parameters

NameTypeRequired?Description
shared_data_idintYesThe asset ID returned by list_discovery_assets.
account_namestr | nullNoThe account name. Specify one if you have access to multiple accounts. Use list_discovery_accounts to see available accounts.
site_group_idstr | int | nullNoThe site group ID or site name. Defaults to account level (-1). Use list_discovery_sites to see available sites.

Response parameters

The tool returns an AssetResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
dataAssetSummary | nullThe asset details, including the content payload.
errorstr | nullError message if the request failed.

The AssetSummary object is described under list_discovery_assets. When you fetch a single asset, the sharedData field holds the full content payload.

get_discovery_weblayer_customizations

Lists the media rules that reference a specific weblayer asset. Use this to find which campaigns depend on a weblayer before you change or retire it. The response returns each referencing customization along with the queries it applies to.

Use list_discovery_assets to find weblayer asset IDs.

Request parameters

NameTypeRequired?Description
weblayer_idstrYesThe weblayer ID to look up customizations for.
account_namestr | nullNoThe account name. If you have exactly one account, it's selected automatically.
site_group_idstr | int | nullNoThe site group ID or site name. Defaults to account level (-1). Use list_discovery_sites to see available sites.

Response parameters

The tool returns an AssetCustomizationsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[AssetCustomization]The media rules that reference this weblayer asset.
errorstr | nullError message if the request failed.

The AssetCustomization object has the following fields:

FieldTypeDescription
idint | nullThe customization ID.
namestr | nullThe customization name.
querieslist[AssetCustomizationQuery]The queries this customization applies to.

The AssetCustomizationQuery object has the following fields:

FieldTypeDescription
idint | nullThe query ID.
querystr | nullThe query text.
queryTypestr | nullThe query type, for example sitesearch or category.
matchTypestr | nullThe match type: exact or broad.

get_discovery_multi_slot_customizations

Lists the media rules that use multi-slot content grid assets. A multi-slot asset places several promotional items in a single content grid slot. The response returns each customization along with the queries it applies to.

Request parameters

NameTypeRequired?Description
account_namestr | nullNoThe account name. If you have exactly one account, it's selected automatically.
site_group_idstr | int | nullNoThe site group ID or site name. Defaults to account level (-1). Use list_discovery_sites to see available sites.

Response parameters

The tool returns an AssetCustomizationsResponse object with the following parameters:

ParameterTypeDescription
successboolWhether the request succeeded.
datalist[AssetCustomization]The media rules that reference multi-slot assets.
errorstr | nullError message if the request failed.

The AssetCustomization object is described under get_discovery_weblayer_customizations.


© Bloomreach, Inc. All rights reserved.