> ## Documentation Index
> Fetch the complete documentation index at: https://docs.miso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Interaction Upload API

> Miso’s Interaction APIs let you manage your Interaction records stored with Miso.

### Interaction records
Your Interaction records tell Miso about user interactions with products and content on your site or application.
From these interactions, Miso understands how users move through your conversion funnels: which products or content
assets attract the attention of each individual user, and which products or content ultimately will be purchased or
consumed by each of them. With these insights, Miso makes real-time tailored recommendations for each user, and
responds to each of their clicks and views on the site (even for anonymous users).

Interaction records share some common attributes, but are distinguished by their type.
Miso captures 23 different interaction types, divided into the following 6 groups:

#### Core click-streams
* `product_detail_page_view`: a user viewed the detail page for a product
* `search`: a user made a search request with keywords and (optionally) filters

The above interactions are the core fuel for Miso's personalization Engines, because they happen in a much higher
frequency than other interactions and provide an unbiased and high-fidelity view of users' interests on the site.
The collection of these interactions is highly important for Miso's personalization performance. At the minimum,
you should implement the `product_detail_page_view` interaction to start with.

#### Conversion (eCommerce)
* `add_to_cart`: a user added a product to the shopping cart
* `remove_from_cart`: a user removed a product from the shopping cart
* `checkout`: a user checked out and started the payment process
* `refund`: a user refunded the product
* `subscribe`: a user subscribed to a product

The above interactions are the main revenue drivers for eCommerce sites. It’s important to collect them so that
Miso can not only drive click-through rates, but actually improve the revenue in a targeted way. To start with,
you should at least implement the `add_to_cart` interaction.

#### Consumption (content media)
* `read`, `watch`, and `listen` interactions capture how and for how long a user consumed a piece of content.
* `add_to_collection`: a user added an product to their personal collection
* `remove_from_collection`: a user removed an product from their personal collection

If you are a content site, the above interactions are the main drivers to users' satisfaction on the site.
Collecting these interactions allows Miso to drive consumption rates and consumption durations for the content on
your site. If you run a content site, you should implement at least one of these interactions.

#### Feedback signals
* `like`, `dislike`, `share`, `rate`,  and `bookmark` are common ways  users express their interests.

These are strong signals for Miso to understand each user's preferences regarding your products or content. You
should send these signals to Miso if you have any of these UI patterns on your site.

#### Performance Checking
* `impression`: a user saw or was presented with a product or content asset (but didn't yet interact with it)
* `viewable_impression`: the product or content presented is actually viewed by the user
  (for example, minimum of 50% of the pixels were in viewable space for at least one continuous second.)
* `click`: a user clicked on something (for example, a product item)

#### Additional click-streams
* `home_page_view`: user viewed your home page
* `category_page_view`: a user viewed the page for a specific “group” or “family” or products or content in your catalog
* `promo_page_view`: user viewed the promotion pages about certain products
* `product_image_view`: user clicked on or otherwise interacted with  the product image (e.g. enlarged the image)

The above interactions are additional signals for Miso to understand users' behavior on the site.

#### Custom
* `custom` interaction types are reserved for you to define your own business-specific interaction types.

Miso will analyze any custom interactions you define to infer users' interests and preferences.

Bulk API to insert Interaction records. This endpoint accepts POST requests with JSON data  containing an array of
Interaction records wrapped in a dictionary:

```
POST /v1/interactions

{"data": [interaction_1, interaction_2, interaction_3]}
```

For real-time tracking, we recommend sending the interaction records to this API as soon as the interactions take
place. This API is also ideal for bulk-inserting historical records that your site collected before using Miso.
 Miso can analyze the historical records and provide personalization for your users from the get-go. We recommend
 limiting your calls to around 10,000 records at a time to avoid memory issues or timeout risks.

###  Anonymous users
For users who did not sign in, we can still make recommendations for them by tracking their `anonymous_id`, which is a pseudo-unique substitute for the `user_id`. The personalization and search APIs all accept `anonymous_id` in the place of `user_id` to return tailored results for anonymous users.

When an anonymous user later signs in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id` along with the past interactions associated with it.

The typical mechanism to generate an `anonymous_id` is to use cookies or the browser localStorage. However, if you don't collect such information in your historical records, a hash of the IP address, optionally combined with the User-Agent string, is also a reasonable substitute for `anonymous_id`, and is most likely collected by your web server logs already.

### Schema validation
The Interaction Upload API will validate the inserted records against the API schema.
Any schema errors will cause the whole request to fail, and none of the records will be inserted (`status_code=422`).
You should check the `response.errors` field to see if there are any errors.

For example, the response below means there are no errors (`status_code=200`):
```javascript
{
    "message": "success"
}
```

Any schema error will cause the whole request to fail: the API will return `status_code=422`, and none of the
records will be inserted. You should check `data` field in the response to see where the errors are located. For
example, the response below means there are schema errors in the interaction record at index 0:
```javascript
{
    "errors": true, // there are errors. please check!
    "message": "None of the records were inserted because at least one of them contained schema errors. Please see the `data` field for details.",
    "data": [
        "data.0.product_ids is invalid. The attribute was expected to be of type ''array', 'null'' but type 'string' was given.",
        "data.0.timestamp is invalid. The attribute should match the 'date-time' format."
    ]
}
```



## OpenAPI

````yaml post /v1/interactions
openapi: 3.0.2
info:
  title: Miso API
  description: >

    # Overview

    Miso’s approach to personalization is to train machine learning Engines on
    three core data sets:


    1. Your site’s log of historical and real-time interactions,

    2. Your catalog of products and content, and

    3. Your users. Miso provides the output of its Engines to you, so you can
    build search and recommendation

    experiences that are personalized down to the individual level (n=1
    personalization).


    To see how Miso works and explore the power of its Engines, we recommend
    following

    [this tutorial](https://docs.askmiso.com/) to get

    started with our Playground data. Integrating your site or application with
    Miso happens in three basic steps:


    1. Upload your data

    2. Train your Engines

    3. Build search and recommendation experiences with the output of your
    Engines.



    Miso provides two main integration points. The first is your [Dojo
    Dashboard](https://dojo.askmiso.com/),

    which is used to set up your Engines with the conversions you want to
    optimize and your training schedule.

    Dojo is also a great way to get familiar with Miso by manually uploading
    data and exploring the output of

    Miso’s Engines. In Dojo’s Sandboxes, you can tweak your Engine settings and
    see visual examples of Miso’s search

    and recommendations running on your live data.


    The second integration point is Miso’s API, which lets you automatically
    manage your data in Miso and build

    experiences that leverage the output of Miso’s personalization Engines.



    Miso’s API is composed of two major groups of REST API endpoints: Data APIs
    and Engine APIs.


    ### Data APIs

    Data APIs collect input to Miso's personalization Engines. These APIs all
    support high-throughput

    data ingestion through bulk insert, and satisfy GDPR and CCPA compliance by
    letting users delete their data

    from Miso. Subcategories of Data APIs are:


    * [Interaction APIs](#tag/Interaction-APIs), for managing your Interaction
    records. By uploading historical and real-time Interaction

    records, you tell Miso how users are engaging with the products and content
    on your site, and in turn, Miso’s

    Engines learn how to optimize your conversion funnels.

    * [Product / Content APIs](#tag/Product-Content-APIs), for managing your
    Product / Content records. These records provide a deep semantic

    understanding of your catalog and keep Miso up to date about your offerings
    so it can make smart and timely

    suggestions. The `product_id` is how Miso links Product / Content records to
    your Interaction records.

    * [User APIs](#tag/User-APIs), for managing your User records. These records
    tell Miso about your site’s users and visitors,

    so Miso can build an understanding of user segmentation and behavior in
    relation to products and content.

    The `user_id` is how Miso links User records to your Interaction records.


    As a rule of thumb, we recommend batching up data to avoid timeout risks.
    For the Product / Content and User

    Upload APIs, we recommend limiting each API upload call to about 100 records
    at a time. For the Interaction

    Upload API, we recommend limiting your calls to around 10,000 records at a
    time.


    ### Engine APIs

    Engine APIs provide the output of Miso's personalization Engines. We
    designed these APIs with a focus on low

    latency and high availability. Most of these APIs' 95th percentile response
    time is under 75ms,

    and the services are replicated to at least three separate instances for
    high availability.

    The types of Engine APIs are:


    * [Search APIs](#tag/Search-APIs), for getting Miso’s personalized search
    results for a user, with search-as-you-type and

    autocompletion.

    * [Recommendation APIs](#tag/Recommendation-APIs), for retrieving Miso’s
    recommendations that match users with

    the products, categories, and product attributes that are likely to drive
    conversions.


    # Authentication

    [View your API Keys in your Dojo
    Dashboard.](https://dojo.askmiso.com/docs/api-browser)


    There are three environments in Miso:

    * **Playground**, a read-only tutorial environment with sample data.

    * **Development**, for staging, QA, and experimentation.

    * **Production**, where you run your live integration with Miso.


    Access a Miso environment by passing in the corresponding API key in your
    API calls. There is one publishable

    key and one secret key per environment.


    API Key can passed with query parameter `api_key`, or using the `X-API-KEY`
    header.
  version: 1.1.4
servers:
  - url: https://api.askmiso.com
security: []
tags:
  - name: Experiment APIs
    description: >

      Miso's experiment APIs let you do the A/B testing of your current result
      with Miso.


      ### Start an experiment in Dojo.


      Login to the [dojo](https://dojo.askmiso.com) platform.

      Create an experiment event for you.


      ### Start running A/B testing in your environment.


      #### Implement A/B testing code.


      Here's an example in NodeJS. You can also use any programming language of
      you choice.

      ```nodejs

      const axios = require('axios');


      async function get_user_experiment_info(api_key, experiment_id, user_id) {
          data = {"user_id": user_id}
          endpoint = `https://api.askmiso.com/v1/experiments/${experiment_id}/events?api_key=${api_key}`
          return await axios.post(endpoint, data)
      }


      const api_key = '<YOUR_SECRET_API_KEY>'

      const experiment_id = "<EXPERIMENT_ID | EXPERIMENT_SLUG_NAME>"

      let user_id = 'user_1234'  // use to evaluate a treatment for


      const user_experiment_info = get_user_experiment_info(api_key,
      experiment_id, user_id)

      user_experiment_info.then((response) => {
          let variant = response.data['variant']
          if (variant['name'] == "treatment") {
              // insert code here to show "treatment" variant
          } else if (variant['name'] == "control") {
              // insert code here to show "control" variant
          } else {
              // unexpected variant name. raise error
              throw new Error(`Unexpected variant name ${variant["name"]}`)
          }
      })

      ```


      If you implement A/B testing code in FrontEnd, like JavaScript, and are
      also worried about exploding the secret api_key. You can choose to use
      anonymous_id with the public_api_key for this API. Here's an example.


      ```javascript

      const apiKey = '<YOUR_PUBLIC_API_KEY>';

      const experimentId = '<EXPERIMENT_ID | EXPERIMENT_SLUG_NAME>';

      const anonymous_id = 'user_1234';  // use to evaluate a treatment for


      function getUserExperimentInfo(apiKey, experimentId, anonymous_id) {
        const data = {
          user_id: anonymous_id
        };
        const url = `https://api.askmiso.com/v1/experiments/${experimentId}/events?api_key=${apiKey}`;
        const options = {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
          body: JSON.stringify(data),
        };

        return window.fetch(url, options)
          .then((response) => response.json())
          .then((data) => {
            const variantName = data.variant.name;
            if (variantName === `${this.treatmentName}`) {
              // insert code here to show 'treatment' variant
            } else if (variantName === `${this.controlName}`) {
              // insert code here to show 'control' variant
            } else {
              // unexpected variant name, throw error
              throw new Error(`Unexpected variant name: ${variantName}`);
            }
          })
          .catch((error) => console.error(error));
      }


      getUserExperimentInfo(apiKey, experimentId, anonymous_id);

      ```
  - name: Interaction APIs
    description: >+

      Miso’s Interaction APIs let you manage your Interaction records stored
      with Miso.


      ### Interaction records

      Your Interaction records tell Miso about user interactions with products
      and content on your site or application.

      From these interactions, Miso understands how users move through your
      conversion funnels: which products or content

      assets attract the attention of each individual user, and which products
      or content ultimately will be purchased or

      consumed by each of them. With these insights, Miso makes real-time
      tailored recommendations for each user, and

      responds to each of their clicks and views on the site (even for anonymous
      users).


      Interaction records share some common attributes, but are distinguished by
      their type.

      Miso captures 23 different interaction types, divided into the following 6
      groups:


      #### Core click-streams

      * `product_detail_page_view`: a user viewed the detail page for a product

      * `search`: a user made a search request with keywords and (optionally)
      filters


      The above interactions are the core fuel for Miso's personalization
      Engines, because they happen in a much higher

      frequency than other interactions and provide an unbiased and
      high-fidelity view of users' interests on the site.

      The collection of these interactions is highly important for Miso's
      personalization performance. At the minimum,

      you should implement the `product_detail_page_view` interaction to start
      with.


      #### Conversion (eCommerce)

      * `add_to_cart`: a user added a product to the shopping cart

      * `remove_from_cart`: a user removed a product from the shopping cart

      * `checkout`: a user checked out and started the payment process

      * `refund`: a user refunded the product

      * `subscribe`: a user subscribed to a product


      The above interactions are the main revenue drivers for eCommerce sites.
      It’s important to collect them so that

      Miso can not only drive click-through rates, but actually improve the
      revenue in a targeted way. To start with,

      you should at least implement the `add_to_cart` interaction.


      #### Consumption (content media)

      * `read`, `watch`, and `listen` interactions capture how and for how long
      a user consumed a piece of content.

      * `add_to_collection`: a user added an product to their personal
      collection

      * `remove_from_collection`: a user removed an product from their personal
      collection


      If you are a content site, the above interactions are the main drivers to
      users' satisfaction on the site.

      Collecting these interactions allows Miso to drive consumption rates and
      consumption durations for the content on

      your site. If you run a content site, you should implement at least one of
      these interactions.


      #### Feedback signals

      * `like`, `dislike`, `share`, `rate`,  and `bookmark` are common ways 
      users express their interests.


      These are strong signals for Miso to understand each user's preferences
      regarding your products or content. You

      should send these signals to Miso if you have any of these UI patterns on
      your site.


      #### Performance Checking

      * `impression`: a user saw or was presented with a product or content
      asset (but didn't yet interact with it)

      * `viewable_impression`: the product or content presented is actually
      viewed by the user
        (for example, minimum of 50% of the pixels were in viewable space for at least one continuous second.)
      * `click`: a user clicked on something (for example, a product item)


      #### Additional click-streams

      * `home_page_view`: user viewed your home page

      * `category_page_view`: a user viewed the page for a specific “group” or
      “family” or products or content in your catalog

      * `promo_page_view`: user viewed the promotion pages about certain
      products

      * `product_image_view`: user clicked on or otherwise interacted with  the
      product image (e.g. enlarged the image)


      The above interactions are additional signals for Miso to understand
      users' behavior on the site.


      #### Custom

      * `custom` interaction types are reserved for you to define your own
      business-specific interaction types.


      Miso will analyze any custom interactions you define to infer users'
      interests and preferences.


  - name: Product / Content APIs
    description: >+

      Miso's Product / Content APIs let you upload, read, and delete Product /
      Content records that represent your site's

      catalog.


      ### Product / Content records

      Miso analyzes your Product / Content records to provide personalized
      search and recommendations that connect users

      with products or content on your site or application.


      Much of Miso's search and personalization capability relies on
      understanding your catalog in-depth and drawing

      correlations between your catalog and your users' consumption or
      purchasing behaviors. In other words, Miso

      discovers that, with high correlation, users who are interested in certain
      product attributes would also be

      interested in other products with similar or related attributes. (For
      simplicity, we will often overload the word

      "products" to mean items for purchase if you are an eCommerce business,
      and content to consume if you are a content

      marketplace.)


      To fully optimize your search and recommendations, it is important to
      provide Miso with Product / Content records

      that are complete and accurate. We define a set of common attributes that
      capture the basics of most eCommerce and

      content media products, such as `title`, `description`, `categories`,
      `tags`, `material`, `authors`, etc.


      If your products' characteristics cannot be fully captured by these
      fields, we recommend that you specify

      `custom_attributes`. For Miso, the more complete the product information
      is, the better its personalized search

      and recommendations become.

  - name: User APIs
    description: >+

      Miso’s User APIs let you upload, read, and delete User records that tell
      Miso about your site’s unique users and

      visitors.


      ### User records

      User records specify relatively static attributes for a given user, such
      as their `age`, `gender`, `city`, etc. As a

      rule of thumb, you should put information here that is not already
      captured in your

      [Interaction records](#tag/Interaction-APIs). For example,
      *last_bought_product* is probably not needed here because

      Miso already can tell that from the [Interaction
      records](#tag/Interaction-APIs).


      Miso will discover the correlations between a user's attributes and their
      behaviors on your site. For example, Miso

      might determine that users of a certain age group tend to be interested in
      certain products or a certain price

      range. These insights will be taken into account when predicting users'
      interests, in particular for new users who

      have not yet generated many interaction records.


      We define a set of common user attributes for e-Commerce and content media
      sites. Some of them, such as `name` are

      for display in the Dojo dashboard only. The rest are for model quality.
      Most attributes are optional and you don't

      need to specify them if you don't collect such data. On the other hand,
      you can specify your custom user attributes

      in the `custom_attributes` field. Miso will analyze custom user attributes
      to improve the model quality as well.

  - name: Bulk API
    description: >

      The Bulk API provides an efficient interface for making multiple Search /
      Recommendations / Q&A requests in one API

      call. These requests will be executed concurrently at the Miso side, and
      returned at once when all of them are finished.

      This API is particularly useful when you need to invoke multiple Miso APIs
      to respond to a user request.

      Using this API, you can batch multiple API calls into one, and
      significantly save the network round-trip times.


      ### Request schema

      The request schema for this API call is as follow:

      ```

      POST /v1/bulk

      {
        "requests": [
          {
            "api_name": "search/search",
            "body": { ... }
          },
          {
            "api_name": "recommendation/product_to_product",
            "body": { ... }
          },
          ...
        ]
      }

      ```

      Each request object should contain:

      * **api_name**: name of the API you want to access. The name should
      contain a slash `/`.

      For example, search/search for search requests, search/autocomplete for
      autocomplete requests, etc.

      * **body**: the complete request body as if you are making the API request
      individually.


      Any errors in one of the requests will be returned, and will not prevent
      other requests from being

      executed.


      ### Response Schema

      Bulk API endpoint will return the API responses in the same order as they
      appear in the request.

      For example, if the Bulk API request is like the following:

      ```

      POST /v1/bulk

      {
        "requests": [
          {... request 1 ...},
          {... request 2 ...}
        ]
      }

      ``` 


      The response will be like:

      ```

      {
        "data": [
          // response for request 1
          {
            "error": false,
            "status_code": 200,
            "body": { ... }
          },
          // response for request 2
          {
            "error": false,
            "status_code": 200,
            "body": { ... }
          }
        ]
      }

      ```


      Each response object will contain the following fields:

      * **error**: whether there was an error with the request. You should check
      this field to determine whether to

      perform error handling.

      * **status_code**: status code of the request.

      * **body**: the response body of the request (as if the request was sent
      individually).


      Let's see a complete example with MovieLens data. The following requests
      will issue two requests in one API call that 

      return the `Sci-Fi` movies directed by

      *Ridley Scott*, and *James Cameron* respectively in the first and second
      responses:

      ```

      POST /v1/bulk

      {
        "requests": [
          {
            "api_name": "search/search",
            "body": {
              "user_id": "test_user",
              "q": "sci-fi",
              "fq": "custom_attributes.director:\"Ridley Scott\""
            }
          },
          {
            "api_name": "search/search",
            "body": {
              "user_id": "test_user",
              "q": "sci-fi",
              "fq": "custom_attributes.director:\"James Cameron\""
            }
          }
        ]
      }

      ```

      The response will be like:

      ```

      {
        "data": [
          {
            "error": false,
            "status_code": 200,
            "body": {
              "data": {
                "took": 136,
                "miso_id": "19ab254c-5fb8-11ec-bd48-b20169940af9",
                "products": [
                  {
                    "product_id": "blade-runner",
                    "title": "Blade Runner (1982)"
                  }
                ],
                "total": 6,
                "start": 0
              }
            }
          },
          {
            "error": false,
            "status_code": 200,
            "body": {
              "data": {
                "took": 116,
                "miso_id": "19ab254c-5fb8-11ec-bd48-b20169940af9",
                "products": [
                  {
                    "product_id": "avatar",
                    "title": "Avatar (2009)"
                  }
                ],
                "total": 10,
                "start": 0
              }
            }
          }
        ]
      }

      ```
  - name: Ask APIs
    description: >+

      Miso's new Ask API is the next generation of question answering APIs.

      It is designed to provide accurate and concise answers to your questions

      based on your existing product documents.


      Ask API offers a seamless and effective way to address complex queries in

      a near-realtime fasion.


      Miso preprocesses your product documents, breaking them into segments.

      When a question is received, Miso finds the most related product and
      segments, then

      summarize to a concise and informative answer based on the identified
      segments,

      including products related to the question.


      Possible use case includes: knowledge base, documentation search, customer
      support, and more.


      To use the Ask API, you first submit a "question" you want to ask.

      Question can be any human-readable text. Then a question ID will returned,

      and the question will be processed in the background.


      After receving question ID, you can then use the question ID to get latest
      answer

      to the question as it is being compiled.


      ----


      For example:


      If you want to know about the inner workings of nginx:


      ```json

      {
          "question":"How nginx works internally?"
      }

      ```


      The API would response with a question id.

      ```json

      {
          "data": {
              "question_id": "ff4775fa-345e-4d28-91b0-8fb8bf095e6a"
          },
          "message": "success"
      }

      ```


      Then you can send a GET request to
      `/v1/ask/questions/{question_id}/answer`

      to get the latest answer as it is being compiled and summerized.

      You can use `answer_stage` and `finished` to check current answer status.


      Here's the response of answer API when data is fetched and being verified,
      before answer is summerized:

      ```json

      {
          "message": "success",
          "data": {
              "question": "How nginx works internally?",
              "question_id": "ff4775fa-345e-4d28-91b0-8fb8bf095e6a",
              "parent_question_id": null,
              "answer_stage": "Verifying possible answers",
              "finished": false,
              "answer": "Verifying possible answers ...",
              "sources": [],
              "related_resources": [],
              "followup_questions": []
          }
      }

      ```


      Here's the response when answer is fullly summerized:


      ```json

      {
          "message": "success",
          "data": {
              "question": "How nginx works internally?",
              "question_id": "ff4775fa-345e-4d28-91b0-8fb8bf095e6a",
              "parent_question_id": null,
              "answer_stage": "Generating summary",
              "finished": true,
              "answer": "# How does Nginx work internally?\n\n## Internal requests [1]\n\nNginx differentiates between external and internal requests. External requests...[omitted for simplicity]",
              "sources": [
                  {
                      "title": "Internal requests",
                      "product_id": "9781788623551",
                      "child_title": "Internal requests",
                      "child_id": "203",
                      "snippet": "<mark>Internal requests\nNginx differentiates external and internal requests.</mark>"
                  },
                  {
                      "title": "5. Nginx Core Architecture",
                      "product_id": "9781484216569",
                      "child_title": "5. Nginx Core Architecture",
                      "child_id": "5",
                      "snippet": "Checks if the client can access of the requested the resource.\n<mark>It is at this step that Nginx...[omitted]</mark>"
                  },
                  {
                      "title": "2. Managing Nginx",
                      "product_id": "9781785289538",
                      "child_title": "2. Managing Nginx",
                      "child_id": "14",
                      "snippet": "<mark>The Nginx connection processing architecture\nBefore you study...[omitted]</mark>"
                  },
                  {
                      "title": "3. Nginx Core Directives",
                      "product_id": "9781484216569",
                      "child_title": "3. Nginx Core Directives",
                      "child_id": "3",
                      "snippet": "<mark>Understanding the Default Configuration\nThe default configuration...[omitted]</mark>"
                  },
                  {
                      "title": "4. Nginx Modules",
                      "product_id": "9781484216569",
                      "child_title": "4. Nginx Modules",
                      "child_id": "4",
                      "snippet": "<mark>Based on the context like HTTP, MAIL, and STREAM, it creates a ...[omitted]</mark>"
                  }
              ],
              "related_resources": [],
              "followup_questions": [
                  "What are the steps involved in processing a request and generating a response in Nginx?",
                  "How do Nginx modules contribute to the internal workings of Nginx?"
              ]
          }
      }

      ```


      Related product IDs will be returned along with human-readable answer.
      Related text section in the product will also be quoted.


      If a product has any children, they will also be matched, `child_id` and
      `child_title` will be included for sources belonging to the product's
      children.


      You can use `fq` to limit the search scope, for example, to a specific
      product type or other condition.


      If you only want to search for books (no articles of videos), you can use
      `fq=type:book` like this:

      ```json

      {
          "question":"How nginx works internally?"
          "fq": "type:book"
      }

      ```


      If you want the answer to contain any other fields, set `source_fl` when
      submitting the question.

paths:
  /v1/interactions:
    post:
      tags:
        - Interaction APIs
      summary: Interaction Upload API
      description: >-
        Bulk API to insert Interaction records. This endpoint accepts POST
        requests with JSON data  containing an array of

        Interaction records wrapped in a dictionary:


        ```

        POST /v1/interactions


        {"data": [interaction_1, interaction_2, interaction_3]}

        ```


        For real-time tracking, we recommend sending the interaction records to
        this API as soon as the interactions take

        place. This API is also ideal for bulk-inserting historical records that
        your site collected before using Miso.
         Miso can analyze the historical records and provide personalization for your users from the get-go. We recommend
         limiting your calls to around 10,000 records at a time to avoid memory issues or timeout risks.

        ###  Anonymous users

        For users who did not sign in, we can still make recommendations for
        them by tracking their `anonymous_id`, which is a pseudo-unique
        substitute for the `user_id`. The personalization and search APIs all
        accept `anonymous_id` in the place of `user_id` to return tailored
        results for anonymous users.


        When an anonymous user later signs in and the `user_id` and
        `anonymous_id` are both present, the `anonymous_id` will be linked to
        the `user_id` along with the past interactions associated with it.


        The typical mechanism to generate an `anonymous_id` is to use cookies or
        the browser localStorage. However, if you don't collect such information
        in your historical records, a hash of the IP address, optionally
        combined with the User-Agent string, is also a reasonable substitute for
        `anonymous_id`, and is most likely collected by your web server logs
        already.


        ### Schema validation

        The Interaction Upload API will validate the inserted records against
        the API schema.

        Any schema errors will cause the whole request to fail, and none of the
        records will be inserted (`status_code=422`).

        You should check the `response.errors` field to see if there are any
        errors.


        For example, the response below means there are no errors
        (`status_code=200`):

        ```javascript

        {
            "message": "success"
        }

        ```


        Any schema error will cause the whole request to fail: the API will
        return `status_code=422`, and none of the

        records will be inserted. You should check `data` field in the response
        to see where the errors are located. For

        example, the response below means there are schema errors in the
        interaction record at index 0:

        ```javascript

        {
            "errors": true, // there are errors. please check!
            "message": "None of the records were inserted because at least one of them contained schema errors. Please see the `data` field for details.",
            "data": [
                "data.0.product_ids is invalid. The attribute was expected to be of type ''array', 'null'' but type 'string' was given.",
                "data.0.timestamp is invalid. The attribute should match the 'date-time' format."
            ]
        }

        ```
      operationId: interaction_upload_api_v1_interactions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionBulkIn'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InteractionCreateOut'
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                message: invalid api key.
        '403':
          description: Forbidden
          content:
            application/json:
              example:
                message: >-
                  Request is denied due to bot blocking. Please only access this
                  API from a real browser or use Secret API Key instead.
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              example:
                errors: true
                message: >-
                  None of the records were inserted because at least one of them
                  contained schema errors. Please see the `data` field for
                  details.
                data:
                  - >-
                    data.0.product_ids is invalid. The attribute was expected to
                    be of type ''array', 'null'' but type 'string' was given.
                  - >-
                    data.0.timestamp is invalid. The attribute should match the
                    'date-time' format.
      security:
        - Secret API Key: []
        - Publishable API Key: []
components:
  schemas:
    InteractionBulkIn:
      title: InteractionBulkIn
      required:
        - data
      type: object
      properties:
        data:
          title: Data
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/ProductDetailPageView'
              - $ref: '#/components/schemas/Search'
              - $ref: '#/components/schemas/AddToCart'
              - $ref: '#/components/schemas/RemoveFromCart'
              - $ref: '#/components/schemas/Checkout'
              - $ref: '#/components/schemas/Refund'
              - $ref: '#/components/schemas/Subscribe'
              - $ref: '#/components/schemas/Unsubscribe'
              - $ref: '#/components/schemas/AddToCollection'
              - $ref: '#/components/schemas/RemoveFromCollection'
              - $ref: '#/components/schemas/Read'
              - $ref: '#/components/schemas/Watch'
              - $ref: '#/components/schemas/Listen'
              - $ref: '#/components/schemas/Like'
              - $ref: '#/components/schemas/Dislike'
              - $ref: '#/components/schemas/Share'
              - $ref: '#/components/schemas/Rate'
              - $ref: '#/components/schemas/Bookmark'
              - $ref: '#/components/schemas/Complete'
              - $ref: '#/components/schemas/Feedback'
              - $ref: '#/components/schemas/Impression'
              - $ref: '#/components/schemas/ViewableImpression'
              - $ref: '#/components/schemas/Click'
              - $ref: '#/components/schemas/Submit'
              - $ref: '#/components/schemas/HomePageView'
              - $ref: '#/components/schemas/CategoryPageView'
              - $ref: '#/components/schemas/PromoPageView'
              - $ref: '#/components/schemas/ProductImageView'
              - $ref: '#/components/schemas/Custom'
    InteractionCreateOut:
      title: InteractionCreateOut
      required:
        - message
      type: object
      properties:
        message:
          title: Message
          type: string
          description: Human-readable message
          example: success
    ProductDetailPageView:
      title: product_detail_page_view
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - product_detail_page_view
          type: string
          description: >-
            Used when a user views the detail page of a product. Viewing a
            product
                    detail page usually indicates a user is interested in the product to certain degree, especially,
                    when the `duration` of the page view is long. When `duration` of the page view is very short (< 5 seconds),
                    `product_detail_page_view` may indicate neural or negative interest in the product. 
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Search:
      title: search
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - search
          type: string
          description: >

            Used to record a search event with the keywords and filters the user
            used. What a user searches for

            is a very powerful signal about their interests and what they will
            eventually buy or consume, so it is important

            to capture this information with high fidelity.
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
        search:
          title: Search
          allOf:
            - $ref: '#/components/schemas/SearchInformation'
          description: >

            The search keywords and filters the user uses. This is only required
            by `search` interaction.
      additionalProperties: false
    AddToCart:
      title: add_to_cart
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - add_to_cart
          type: string
          description: >

            Used when a user adds a product into their shopping cart. This is a
            strong

            positive signal of the user's interest in the product, and may
            eventually lead to a purchase.
        quantities:
          title: Quantities
          anyOf:
            - type: array
              items:
                type: number
            - type: number
          description: >

            The quantities of products the user adds to their cart or checks out
            with. This field should be a list of positive values.

            Specifically, if `product_ids` is a list of N products, the
            `quantities` needs to be a list with N numbers as well.

            If `quantities` are not specified, we will assume the quantity to be
            1 for every product.


            Example:

            ```

            {"quantities": [1, 2]}

            ```
          example:
            - 1
            - 2
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    RemoveFromCart:
      title: remove_from_cart
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - remove_from_cart
          type: string
          description: |

            Used when a user removes a product from their shopping cart.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Checkout:
      title: checkout
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - checkout
          type: string
          description: >

            Used when a user enters checks out with a set of products. For an
            eCommerce site, this is the strongest signal of the user's

            interest and has a high probability of leading to an eventual
            purchase.
        revenue:
          title: Revenue
          type: number
          description: >

            Total revenue associated with the checkout.  The revenue should
            include generally shipping, tax, etc. that you

            want to include as part of your revenue calculations.
          example: 23.32
        quantities:
          title: Quantities
          anyOf:
            - type: array
              items:
                type: number
            - type: number
          description: >

            The quantities of products the user adds to their cart or checks out
            with. This field should be a list of positive values.

            Specifically, if `product_ids` is a list of N products, the
            `quantities` needs to be a list with N numbers as well.

            If `quantities` are not specified, we will assume the quantity to be
            1 for every product.


            Example:

            ```

            {"quantities": [1, 2]}

            ```
          example:
            - 1
            - 2
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Refund:
      title: refund
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - refund
          type: string
          description: |

            Used when a user requests a refund of products they bought.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Subscribe:
      title: subscribe
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - subscribe
          type: string
          description: >

            Used when a user subscribes a product, for example to receive alerts
            when the product comes back in stock or if the price drops.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Unsubscribe:
      title: unsubscribe
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - unsubscribe
          type: string
          description: >

            Used when a user unsubscribes a product, for example to stop
            receiving alerts when the product comes back in stock or if the
            price drops.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    AddToCollection:
      title: add_to_collection
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - add_to_collection
          type: string
          description: >

            Used when a user adds a product to their personal collection. This
            is a strong

            signal of their interest in the product.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    RemoveFromCollection:
      title: remove_from_collection
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - remove_from_collection
          type: string
          description: |

            Used when a user removes a product from their personal collection.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Read:
      title: read
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - read
          type: string
          description: >

            Used to record when and for how long a user reads a piece of written
            content.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Watch:
      title: watch
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - watch
          type: string
          description: >

            Used to record when and for how long a user watches content that is
            of a video format.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Listen:
      title: listen
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - listen
          type: string
          description: >

            Used to record when and for how long a user listens to content that
            is of an audio format.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Like:
      title: like
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - like
          type: string
          description: |

            Used to record when a user indicates a `like` for a product.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Dislike:
      title: dislike
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - dislike
          type: string
          description: >

            Used when a user indicates a `dislike` for a product or indicates

            they would like to not be recommended content or products like this
            in the future.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Share:
      title: share
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - share
          type: string
          description: |

            Used when a user shares a product or piece of content.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Rate:
      title: rate
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - rate
          type: string
          description: |

            Used when a user gives a rating to a product or piece of content.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
        rating:
          title: Rating
          type: number
          description: >

            The rating the user gave in the range of [0, 5]. This field is only
            required by the `rate` interaction. As a

            convention in the RecSys community, a rating >= 3.5 is considered
            positive, a rating <= 2 is negative,

            and otherwise a rating is neutral. If you use any other rating
            scale, please normalize it to a [0, 5] scale.
          example: 5
      additionalProperties: false
    Bookmark:
      title: bookmark
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - bookmark
          type: string
          description: |

            Used when a user bookmarks a product.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Complete:
      title: complete
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - complete
          type: string
          description: >

            Used when a user "complete" a product (e.g. complete a course or a
            video).
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Feedback:
      title: feedback
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - feedback
          type: string
          description: |

            Used when a user sends feedback on provided results.
        question_id:
          title: Question Id
          maxLength: 512
          type: string
          description: >

            A unique identifier representing the specific question for which
            feedback is being provided.
          example: question_123
        result_type:
          title: Result Type
          type: string
          description: >

            Indicates the type of result the provided feedback is associated
            with, e.g., an answer or a suggestion.
          example: answer
        value:
          title: Value
          type: string
          description: >

            Specifies the user's perspective on the provided result, with
            possible values being helpful, not helpful,

            or unselected if the user has not provided any feedback.
          example: helpful
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Impression:
      title: impression
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - impression
          type: string
          description: >-

            Used to record when a user saw or was presented with a product or
            content asset.

            An impression does not mean a user is interested: for example, if
            there is an impression for a

            certain product, but no further interaction occurs with that
            product, we assume the user is probably not

            interested in it.


            For an impression that was generated by Miso's search results or
            recommendations results, it is important to

            include the `miso_id` associated with the results so that we know
            the impression is from Miso
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    ViewableImpression:
      title: viewable_impression
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - viewable_impression
          type: string
          description: >

            When a product or content asset is presented to the user, it is not
            guarantee that the user will see it.


            An viewable impression is an impression that is "viewable" by the
            user.

            Usually, content asset is considered viewable if more than 50% of
            its area is visible on screen.


            You can also use different definition for what is considered
            viewable.

            Miso will automatically find the best recommendation as long as the
            difference between

            viewable and non-viewable impression is consistant.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Click:
      title: click
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - click
          type: string
          description: >

            Used when user clicked on something, and does not belong to any
            other interaction type.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Submit:
      title: submit
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - submit
          type: string
          description: |

            Used when a user submits a form or a survey.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    HomePageView:
      title: home_page_view
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - home_page_view
          type: string
          description: |

            Used when a user views your home page.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    CategoryPageView:
      title: category_page_view
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - category_page_view
          type: string
          description: >

            Used when a user views a category page for a specific “family” or
            “group” or products or content.

            This is a strong indicator of what types category of products or
            content the user is interested in.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
        category:
          title: Category
          type: array
          items:
            type: string
          description: >

            Categories usually fall in a hierarchy, such as *Home & Garden >
            Kitchen & Dining > Kitchen Tools & Utensils >

            Sushi Mats* Use this field to specify the full hierarchical list
            describing the category the user is viewing.


            The levels should be listed from broad to narrow:

            `["TOP_LEVEL_CATEGORY", "SUBCATEGORY_1", "SUBCATEGORY_2", ...]`.

            This field is only used by the category_page_view interaction type,
            but this data is very useful for

            determining the user’s interests.

            Example:

            ```

            [
             "Home & Garden",            // TOP_LEVEL_CATEGORY
             "Kitchen & Dining",         // SUBCATEGORY_1
             "Kitchen Tools & Utensils", // SUBCATEGORY_2
             "Sushi Mats"                // SUBCATEGORY_3
            ]

            ```
      additionalProperties: false
    PromoPageView:
      title: promo_page_view
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - promo_page_view
          type: string
          description: >

            Used when a user views a specific promotional or curated marketing
            page about certain products or content.
        duration:
          title: Duration
          type: number
          description: >

            How long (in seconds) the user stayed on this page, or consumed
            (listened, read, or watched) a product. This field is

            optional, but it's very important in scenarios where consumption
            duration matters, including

            `product_detail_page_view`, `category_page_view`, `watch`, `listen`,
            and `read`. For example, if a user only

            views or consumes a product for less than 5 seconds, that user is
            probably not interested in the product. On

            the other hand, if a user stays on a page for a while, it usually
            means they are seriously engaging with or

            considering the product. When `duration` is absent, we will use the
            timestamp of the next interaction to

            infer a rough duration value.


            Example:

            ```

            {"duration": 61.5}

            ```
          example: 61.5
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    ProductImageView:
      title: product_image_view
      required:
        - type
      type: object
      properties:
        type:
          title: Type
          enum:
            - product_image_view
          type: string
          description: >

            Used when a user views the image of a product (e.g. to enlarge a
            product photo).
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
      additionalProperties: false
    Custom:
      title: custom
      required:
        - type
        - custom_action_name
      type: object
      properties:
        type:
          title: Type
          enum:
            - custom
          type: string
          description: >

            Used when you want to record any other kinds of interactions between
            users and products.
        product_ids:
          title: Product Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            Products or content the user is interacting with. This field is
            required by

            almost all the interaction types. We use `product_ids` to refer to
            the product / content records that you upload to Miso.

            Therefore, it is important to keep this consistent between the two
            datasets.


            Example:

            ```

            {"product_ids": ["123ABC-BLACK", "123EFG-YELLOW"]}

            ```
          default: []
          example:
            - 123ABC-BLACK
        product_group_ids:
          title: Product Group Ids
          type: array
          items:
            type: string
            maxLength: 512
          description: >

            The product groups the user is interacting with. You only need this
            field if you model product

            variants using `product_id` and `product_group_id` (see Product
            API). If so, you should use this field, when a

            user is interacting with a *product group* rather than a specific
            product variant, for example, when the user

            is viewing the master page of a T-shirt (i.e. a product group), but
            has not selected the specific size or

            color (i.e. a product variant) yet.


            In such situations, the `product_id` is not applicable because we
            only know the user is interested in

            this T-shirt (a product group), but don't know which particular
            product variant the user is interested in.

            Therefore, we use `product_group_ids` to capture such interactions
            in place of `product_ids`.


            In the situations where specific `product_ids` are available, for
            example, when user selected a particular size

            of the T-Shirt, use `product_ids` instead.



            Example:

            ```

            {"product_group_ids": ["123ABC"]}

            ```
          example:
            - 123ABC
        user_id:
          title: User Id
          maxLength: 512
          type: string
          description: >-
            Identifies the signed-in user who performed the interaction. We will
            use `user_id` to link Interaction records to your
                    User records. Therefore, it is important to keep this consistent between the two datasets.For visitors who have
                    not signed in, see `anonymous_id`.
          example: user_1234
        anonymous_id:
          title: Anonymous Id
          maxLength: 1024
          type: string
          description: >-
            A pseudo-unique substitute for the User Id. We use `anonymous_id` to
            identify a visitor who has not signed
                    in. `anonymous_id` can be implemented using mechanisms such as cookies or browser localStorage. If `anonymous_id`
                    is not given, we will default it to `SHA1(<API key>:<IP address>:<user agent>:<date>)`. When a visitor signs
                    in and the `user_id` and `anonymous_id` are both present, the `anonymous_id` will be linked to the `user_id`
                    along with the past interactions associated with it.
          example: 86D51273AD8BF84217E1567B6CBE7152D7034404
        timestamp:
          title: Timestamp
          type: string
          description: >

            The ISO-8601 timestamp specifying when the interaction occurred. If
            the interaction just happened, leave it out and we

            will default to the server's time. If you're importing data from the
            past, make sure you provide a

            timestamp. It is recommended to include milliseconds in the
            timestamp to provide a higher time resolution.


            Example:

            ```

            {"timestamp": "2018-11-07T00:25:00.073876Z"}

            ```
          format: date-time
        miso_id:
          title: Miso Id
          type: string
          description: >

            Miso-generated unique Id for each recommendation or search result.
            Maintaining this Id for

            subsequent page views is important to Miso's performance, as we use
            `miso_id` to track and fine-tune the

            performance of personalization and search results. When a user
            clicks on a recommendation or search result,

            you should pass the associated `miso_id` to the next page view, and
            associate the `miso_id` with the

            interactions that take place on the page (e.g.
            `product_detail_page_view`, `add_to_cart`,

            `add_to_collection`, `like`, etc.). In this way, Miso will learn
            which recommendations work and which didn't.


            Example:

            ```

            {"misoId": "123e4567-e89b-12d3-a456-426614174000"}

            ```
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        context:
          title: Context
          allOf:
            - $ref: '#/components/schemas/WebBasedContext'
          description: >

            Dictionary of extra information that provides useful context about
            an interaction. We use context

            information to make recommendations tailored not only for each user,
            but also for their current browsing context.

            For example, a user browsing on a desktop may have different
            browsing behavior than a user browsing on mobile

            phone. As another example, a user who gets to the site via a certain
            campaign you run on Facebook may have very

            different interests than a user who visits your site directly.


            Context information is also useful for personalization for entirely
            new visitors, as we can immediately

            personalize their experiences based on their context alone (e.g. the
            referrer or the campaign they clicked through).


            Example:

            ```

            {"context": {
                "campaign":
                {
                    "name": "spring_sale",
                    "source": "Google",
                    "medium": "cpc",
                    "term": "running+shoes",
                    "content": "textlink"
                },
                "truncated_ip": "1.1.1.0",
                "locale": "en-US",
                "region": "US East",
                "page":
                    {
                        "url": "https://example.com/miso-tshirt-123ABC",
                        "referrer": "https://example.com/",
                        "title": "My Product Page"
                    },
                    "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0)"
                },
                "custom_context": {
                    "other_context_var_1": "value_1",
                    "other_context_var_2": "value_2"
                }
            }

            ```
        custom_action_name:
          title: Custom Action Name
          type: string
          description: |

            The name of the custom interaction that you have defined.
      additionalProperties: false
    WebBasedContext:
      title: WebBasedContext
      type: object
      properties:
        campaign:
          title: Campaign
          allOf:
            - $ref: '#/components/schemas/Campaign'
          description: >

            The campaign that resulted in the interaction. Campaign dictionary
            contains standard UTM parameters: `name`,

            `source`, `medium`, `term`, `content`. We use campaign information
            to infer users' interests and fine-tune the

            personalization and search results based on the current user's
            campaign information.
        truncated_ip:
          title: Truncated Ip
          type: string
          description: >

            User's truncated IP address. We use IP address to determine the
            country of the users.
          format: ipv4
          example: 1.1.1.0
        locale:
          title: Locale
          type: string
          description: Locale string of the current session, for example en-US.
          example: en-US
        region:
          title: Region
          type: string
          description: >

            The region/location of the site the user is visiting. This is for
            sites that serve different regions or

            markets. You can define your own region keywords, for example, `US
            East`, `Europe`, `LATM`, etc.
          example: US East
        page:
          title: Page
          allOf:
            - $ref: '#/components/schemas/Page'
          description: >-
            The current page in the browser. Page dictionary containing
            referrer, title and url. we will use page view
                    as a pseudo interaction to infer users' interest. 
        user_agent:
          title: User Agent
          type: string
          description: >

            User agent of the device making the request. We use this to
            determine if a user is browsing the site on

            mobile or desktop, and tailor the recommendations and search results
            accordingly.


            Example:

            ```

            {"user_agent":
                "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"}
            ```
          example: >-
            Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101
            Firefox/47.0
        custom_context:
          title: Custom Context
          type: object
          additionalProperties:
            anyOf:
              - type: boolean
              - type: integer
              - type: number
              - type: string
              - type: array
                items:
                  type: number
              - type: array
                items:
                  type: string
              - type: array
                items:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: string
                      - type: number
                      - type: integer
                      - type: boolean
          description: >

            Dictionary of custom context variables for the current browsing
            session. You can specify context variables

            specific to your websites or apps in a `{"KEY":VALUE}` format, where
            `KEY` must be a string, and `VALUE` can be:

            * a `bool`

            * a `string` or an `array of string`

            * a `number` or an `array of numbers`

            * an `array of objects`

            * `null`


            Miso will take these variables into account when generating
            recommendations.
          example:
            session_variable_1:
              - value_1
              - value_2
    SearchInformation:
      title: SearchInformation
      type: object
      properties:
        keywords:
          title: Keywords
          type: string
          description: >

            The search keywords user use. Search keywords are strong signals to
            users' interests.
          default: ''
        filters:
          title: Filters
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: >

            Dictionary of filters users apply to the search results in the
            following format:
             `{"FIELD": ["SELECTION_1", "SELECTION_2"]}`.
    Campaign:
      title: Campaign
      type: object
      properties:
        name:
          title: Name
          type: string
          description: >-
            Name of the campaign. Identifies a specific product promotion or
            strategic campaign.  (see [UTM
            parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          example: spring_sale
        source:
          title: Source
          type: string
          description: >-
            Source of the campaign. Identifies which site sent the traffic. (see
            [UTM parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          example: Google
        medium:
          title: Medium
          type: string
          description: >-
            Medium of the campaign that identifies what type of link was used,
            such as cost per click or email. (see [UTM
            parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          example: cpc
        term:
          title: Term
          type: string
          description: >-
            Term of the campaign that identifies search terms. (see [UTM
            parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          example: running+shoes
        content:
          title: Content
          type: string
          description: >-
            Content of the campaign that identifies what specifically was
            clicked to bring the user to the site, such as a banner ad or a text
            link. It is often used for A/B testing and content-targeted ads.
            Identifies search terms.  (see [UTM
            parameters](https://en.wikipedia.org/wiki/UTM_parameters))
          example: textlink
    Page:
      title: Page
      required:
        - url
      type: object
      properties:
        url:
          title: Url
          type: string
          description: Url of the page
          example: https://example.com/miso-tshirt-123ABC
        referrer:
          title: Referrer
          type: string
          description: Url of the referrer page
          example: https://example.com/
        title:
          title: Title
          type: string
          description: Title of the page
          example: My Product Page
  securitySchemes:
    Secret API Key:
      type: apiKey
      description: >+

        Your secret API key is used to access every Miso API endpoint. You
        should secure this key and only use it on a backend 

        server. Never leave this key in your client-side JavaScript code. If the
        private key is compromised, you can revoke it 

        in [Dojo](https://dojo.askmiso.com/docs/api-browser) and get a new one.


        Specify your secret key in the `api_key` query parameter. For example:

        ```

        POST /v1/users?api_key=039c501ac8dfcac91c6f05601cee876e1cc07e17

        ```

      in: query
      name: api_key
    Publishable API Key:
      type: apiKey
      description: >

        Your publishable API key is used to call Miso's APIs from your front-end
        code. It can be used to stream interactions from the browser using
        Miso's Interactions Upload API or to access read-only search and
        recommendation results for a given user. When using the publishable API
        key, the requested user_id will need to be hashed to maintain the
        necessary security compliance. 


        Specify your publishable key in the `api_key` query parameter. For
        example:

        ```

        POST /v1/interactions?api_key=039c501ac8dfcac91c6f05601cee876e1cc07e17

        ```
      in: query
      name: api_key

````