---
title: Annotated Example Engine API Request
slug: engine-api/annotated-example-request
description: An example Monetate Engine API request with brief explanations of various objects and events contained in the request
image:  https://archbee-image-uploads.s3.amazonaws.com/ceIfEvQHzQk1IVxoRWUh7/K9eTL4jKm7UQINb6zNziJ-20250912-181225.png
docTags: 
createdAt: 2024-07-22T19:52:12.404Z
---

The following code is an example request to the Monetate Engine API. Each object is described separately afterward.

:::CodeblockTabs
Example Engine API Request

```json
{
  "deviceId": "IMEI-123456789",
  "monetateId": "2.309132816.1519728587304",
  "preview": "6.3.eJyrVkpMTs4vzSuJz0xRsj...",
  "customerId": "87654321",
  "channel": "a-76ca7dd3/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "12345678",
      "filters": 
      [
        "slot_name"
      ],
      "manageImpressions": false,
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "79.173.135.170"
    },    
    {
      "eventType": "monetate:context:Coordinates",
      "latitude": "49.566667",
      "longitude": "10.883333"
    },    
    {
      "eventType": "monetate:context:UserAgent",
      "userAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Safari/3.0.2"
    },    
    {
      "eventType": "monetate:context:ScreenSize",
      "width": 1024,
      "height": 762
    },    
    {
      "eventType": "monetate:context:Metadata",
      "metadata": 
      {
        "language": "en-GB"
      }
    },    
    {
      "eventType": "monetate:context:CustomVariables",
      "customVariables": 
      [        
        {
          "variable": "VariableName",
          "value": "VariableValue"
        }
      ]
    },    
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com/search",
      "pageType": "search"
    },    
    {
      "eventType": "monetate:context:Referrer",
      "referrer": "http://www.example.com"
    },    
    {
      "eventType": "monetate:record:PageEvents",
      "pageEvents": 
      [
        "myEvent"
      ]
    },    
    {
      "eventType": "monetate:context:ProductThumbnailView",
      "products": 
      [
        "product72",
        "product43",
        "product42"
      ]
    },    
    {
      "eventType": "monetate:context:ProductDetailView",
      "products": 
      [        
        {
          "productId": "product72",
          "sku": "product72-large-green"
        },        
        {
          "productId": "product43",
          "sku": "product43-medium-striped"
        },        
        {
          "productId": "product57"
        }
      ]
    },    
    {
      "eventType": "monetate:context:Cart",
      "cartLines": 
      [        
        {
          "sku": "product72color2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },    
    {
      "eventType": "monetate:context:Purchase",
      "purchaseId": "123456789",
      "purchaseLines": 
      [        
        {
          "sku": "product72color2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },    
    {
      "eventType": "monetate:record:Impressions",
      "impressionIds": 
      [
        "2.MS4xLjE1MTQ4MDg5MDA"
      ]
    }
  ]
}
```
:::

## Objects

### Device ID

The device ID can be sent with new visitors without `mt.v`, but it's normally used for apps and similar situations in which cookie IDs are not possible. It's used for targeting and action conditions.

:::CodeblockTabs
Example deviceID

```json
"deviceId": "IMEI-123456789"
```
:::

### mt.v Value

If no customer identifier is passed in the request, then a `monetateID` value is returned and the session is considered as a new visitor for targeting and analytics. See [User Identity Persistence in Requests](docId:7M254uPWksja-XLMmy6m4) for more information.

:::CodeblockTabs
Example monetateID

```json
"monetateId": "2.309132816.1519728587304"
```
:::

### Preview Flag

If the session is a [preview](docId\:HowRxrLC9SJCAIlvIbnNz), then include the token ID for this object for experience and split preview.

:::CodeblockTabs
Example preview ID

```json
"preview": "6.3.eJyrVkpMTs4vzSuJz0xRsj..."
```
:::

### Unique Customer ID

A unique `customerID` value is used for [Customer View](https://docs.monetate.com/docs/configure-customer-view) and [customer datasets](docId:7M254uPWksja-XLMmy6m4).

:::CodeblockTabs
Example customerID

```json
"customerId": "87654321"
```
:::

### Channel

The `channel` value is your Monetate account information.

:::CodeblockTabs
Example channel

```json
"channel": "a-76ca7dd3/p/example.com"
```
:::

## Events

The following objects are data passed to Monetate for experiences and analytics.

### Action Type Filters, Managed Impressions, and Reporting

The following code example is an Engine API decision request event with filtering for certain action types, managed impressions, and whether to include reporting in the response. The `filters` parameter can be used to filter certain action types.

:::CodeblockTabs
Example Request Event for Filtering, Managed Impressions, & Reporting

```json
{
  "eventType": "monetate:decision:DecisionRequest",
  "requestId": "12345678",
  "filters": 
  [
    "slot_name"
  ],
  "manageImpressions": false,
  "includeReporting": true
}
```
:::

### IP Address

The following code example is an Engine API decision request event for the IP address. This information is used for targeting and analytics.

:::CodeblockTabs
Example Request Event for IP Address

```json
{
  "eventType": "monetate:context:IpAddress",
  "ipAddress": "79.173.135.170"
}
```
:::

### Coordinates

The following code example is an Engine API decision request event for a customer device's physical coordinates expressed in longitude and latitude. This information is used for targeting and analytics.

:::CodeblockTabs
Example Request Event for Coordinates

```json
{
  "eventType": "monetate:context:Coordinates",
  "latitude": "49.566667",
  "longitude": "10.883333"
}
```
:::

### User Agent

The following code example is an Engine API decision request event for the `User-Agent` header. This information is used for targeting and analytics.

:::hint{type="info"}
Ensure that you include the end user’s `userAgent` string so that sessions are registered properly as stealth or not. If the value of `userAgent` lacks specific browser or OS details, then it's identified as automated and put into Stealth Mode.
:::

:::CodeblockTabs
Example Request Event for User-Agent Header

```json
{
  "eventType": "monetate:context:UserAgent",
  "userAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Safari/3.0.2"
}
```
:::

### Screen Size

The following code example is an Engine API decision request event for the screen size of the customer's device. This information is used for targeting.

:::CodeblockTabs
Example Request Event for Device Screen Size

```json
{
  "eventType": "monetate:context:ScreenSize",
  "width": 1024,
  "height": 762
}
```
:::

### Metadata

The following code example is an Engine API decision request event for customer-specific metadata. This information is used for targeting and action conditions.

:::CodeblockTabs
Example Request Event for Metadata

```json
{
  "eventType": "monetate:context:Metadata",
  "metadata": 
  {
    "language": "en-GB"
  }
}
```
:::

### Custom Variables

The following code example is an Engine API decision request event for a custom variable and its value. This information is used for targeting.

:::CodeblockTabs
Example Request Event for Custom Variable

```json
{
  "eventType": "monetate:context:CustomVariables",
  "customVariables": 
  [    
    {
      "variable": "VariableName",
      "value": "VariableValue"
    }
  ]
}
```
:::

### Page View and Type

The following code example is an Engine API decision request event for a page view and its page type. This information is used for action conditions. See [Action Condition Mapping](docId\:N-VumBACFtG0JlhtIkean) for more details.

:::CodeblockTabs
Example Request Event for Page View and Page Type

```json
{
  "eventType": "monetate:context:PageView",
  "url": "https://www.example.com/search",
  "pageType": "search"
}
```
:::

### Referrer

The following code example is an Engine API decision request event for a referring URL. This information is used for targeting and action conditions.

:::CodeblockTabs
Example Request for Referrer

```json
{
  "eventType": "monetate:context:Referrer",
  "referrer": "http://www.example.com"
}
```
:::

### Custom Page Events

The following code example is an Engine API decision request event for custom page events. This information is used for analytics.

:::CodeblockTabs
Example Request for Custom Page Events

```json
{
  "eventType": "monetate:record:PageEvents",
  "pageEvents": 
  [
    "myEvent"
  ]
}
```
:::

### Search Results or Product List Pages

The following code example is an Engine API decision request event captures product thumbnail views on search results pages or other product list pages. This information is used for targeting and action conditions.

:::CodeblockTabs
Example Request for Product Thumbnail Views

```json
{
  "eventType": "monetate:context:ProductThumbnailView",
  "products": 
  [
    "product72",
    "product43",
    "product42"
  ]
}
```
:::

### Product Detail Pages

The following code example is an Engine API decision request event captures product detail page views. This information is used for targeting and action conditions.

:::CodeblockTabs
Example Request for Product Detail Page Views

```json
{
  "eventType": "monetate:context:ProductDetailView",
  "products": 
  [    
    {
      "productId": "product72",
      "sku": "product72-large-green"
    },    
    {
      "productId": "product43",
      "sku": "product43-medium-striped"
    },    
    {
      "productId": "product57"
    }
  ]
}
```
:::

### Cart Pages

The following code example is an Engine API decision request event captures information about products in a customer's cart. This information is used for targeting, action conditions, and analytics.

:::CodeblockTabs
Example Request for Carted Products

```json
{
  "eventType": "monetate:context:Cart",
  "cartLines": 
  [    
    {
      "sku": "product72colour2",
      "pid": "product72",
      "quantity": 2,
      "currency": "GBP",
      "value": "24.00"
    }
  ]
}
```
:::

### Purchases Pages

The following code example is an Engine API decision request event that captures information about products that a customer has finished buying that appear on a "Purchase Complete" or similar page. This information is used for targeting and analytics.

:::CodeblockTabs
Example Request for Purchased Products

```json
{
  "eventType": "monetate:context:Purchase",
  "purchaseId": "123456789",
  "purchaseLines": 
  [    
    {
      "sku": "product72colour2",
      "pid": "product72",
      "quantity": 2,
      "currency": "GBP",
      "value": "24.00"
    }
  ]
}
```
:::

### Impressions

The following code example is an Engine API decision request event that captures impressions. When `manageImpressions` is set to `true`, this event tells Monetate that the impression happened.

:::CodeblockTabs
Example Request for Impressions

```json
{
  "eventType": "monetate:record:Impressions",
  "impressionIds": 
  [
    "2.MS4xLjE1MTQ4MDg5MDA"
  ]
}
```
:::

