---
title: Request Filtering
slug: engine-api/request-filtering
description: How the Monetate Engine API handles the slots=[] attribute and the actionTypes=[] attribute for filtering
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-05-10T18:58:02.262Z
---

The [monetate\:decision\:DecisionRequest](docId\:DspILr3g1cifaeEYlsqsB) event supports two types of filtering:

- The `slots=[]` attribute expects an array of strings, each of which is a slot name for an Engine API action (for example, `omni_redirect`). Only actions that have slot names matching one of the specified slots are evaluated, and for each slot the highest-priority action matching that slot is returned.
- The `actionTypes=[]` attribute expects an array of strings, each of which is an action type for an Engine API action (for example, [monetate\:action\:OmnichannelJson](docId\:DoV5IYQlPb7w55n_suSch)). Only actions that have an action type matching one of the specified action types are evaluated. Unlike the slot filters, it's possible to qualify for multiple actions with the same action type.

If the `slots` attribute is missing or consists of an empty array, then no slot filtering is performed. If the `actionTypes` attribute is missing or consists of an empty array, then no action type filtering is performed. If both `slots` and `actionTypes` are specified, then actions must match both the `slots` and `actionTypes` filters to be evaluated.

In this `monetate:decision:DecisionRequest` example request, the event considers only Omnichannel redirect actions using the `slots=[]` approach.

:::CodeblockTabs
Example monetate\:decision\:DecisionRequest Request with Filtering

```json
{
  "channel": "a-12345678/d/example.test",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "1111111",
      "slots": 
      [
        "omni_redirect"
      ]
    },    
    {
      "eventType": "monetate:context:PageView",
      "pageType": "homepage"
    }
  ]
}
```
:::

## Redirect Actions

When a `monetate:decision:DecisionRequest` event that doesn't include slot filtering is submitted, the customer might qualify for redirect actions, non-redirect actions, or some combination of the two:

- If the customer qualifies for a redirect action and is assigned to the experiment group, then only that action is returned in the response.
- If the customer qualifies for multiple redirect actions and is assigned to the experiment group for each of them, then the action with the highest priority is returned.
- If the customer doesn't qualify for any redirect actions or is assigned to the control group for all redirect actions they do qualify for, then all non-redirect actions are returned.

Single-request full-page redirects also work when the `monetate:decision:DecisionRequest` event includes the attribute `managedImpressions=True`:

- If the customer qualifies for a redirect action and is assigned to the experiment group, only that action is returned in the response. The action includes an `impressionId` token that should be reported back to Monetate when the redirect occurs.
- If the customer qualifies for a redirect action but is assigned to the control group, that redirect action is still included in the response and has an associated `impressionId` token, but the response indicates that it's a control action with the `isControl=True` flag.

The impressionId token for a given redirect action must be reported back to Monetate regardless of whether the customer is in the experiment group or the control group. See [Managed Impressions](docId\:IjDyTd5PnMZXy_xRdPRPu) for details about when and how to report the impressionId token.

:::hint{type="info"}
The customer should only be redirected to the URL included in the action if `isControl=False`.
:::

:::CodeblockTabs
Example Client-Side Logic

```json
# Determine whether a redirect action exists among the actions in the response 
for action in actions: 
    if action['actionType'] == 'monetate:action:OmnichannelRedirect': 
      # Report the impression regardless of whether the user 
      # is in the experiment group or control group 
      report_impression(action['impressionId']) 
  
      # Only redirect if the user is in the experiment group 
      if not action['isControl']: 
          redirect_to_url(action['url'])
```
:::

