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

# Start an MTU count

> Starts counting the distinct visitors tracked on the given sites between 'startDate' and 'endDate'.
Returns a data code to pass to 'GET /mtu/poll'. The caller must have access to every requested site.



## OpenAPI

````yaml /automation.api.json post /mtu/obtainCount
openapi: 3.0.3
info:
  title: OpenAPI definition for automation API
  version: 1.0.0
servers:
  - url: https://api.kameleoon.com
security: []
tags:
  - description: >-
      Feature flag helps our clients implement new features, test and deploy
      them via our SDK. This service allows you to create and configure the
      feature flag that your source code uses.
    name: Feature flag
  - description: >-
      Custom data is an advanced tool that lets you target your customers in a
      unique way using data that already exists, such as user account
      information.
    name: Custom data
  - description: >-
      Experiment is an A/B test which can target a specific audience or any
      other audience. Kameleoon has several types of experiments: `Classic`,
      `Multivariate test (MVT)`, `Server-side` and the one that suits the best
      can achieve the best results.
    name: Experiment
  - description: >-
      To measure the efficiency of an experiment or a personalization, it must
      link to one or several goals. The Kameleoon interface or Automation API
      can manage all goals. There are variety of different goals you can choose
      from to better measure the results.
    name: Goal
  - description: This is an object representing an image
    name: Image
  - description: >-
      This is an object representing a key moment. Please note that Kameleoon
      has now renamed `KeyMoment` to `Triggers`.
    name: Key moment
  - description: >-
      Key page allows you to target visitors that have visited a particular
      page, or multiple pages on your website.
    name: Key page
  - description: >
      Web personalization tailors the experience for each visitor to improve
      your conversion rate.

      The personalization object contains all vital information about a
      personalization as well as segments and variations used in it.
    name: Personalization
  - description: >
      A personalization rule belongs to a parent personalization and decides
      which visitors see which of its variations.

      A rule is either a targeting rule or an experiment rule:

      - `TARGETING_RULE` shows one variation (`variationId`) to every visitor
      who matches the targeting.

      - `EXPERIMENT_RULE` splits matching traffic between its variations
      (`variationIds`). It requires `trafficAllocationMethod`. The
      `classicAllocationSettings` must cover exactly the rule's `variationIds`
      and sum to 1.0.
    name: Personalization rule
  - description: This is an object representing a projectThemeConfig
    name: Project theme config
  - description: This is an object representing a recommender block
    name: Recommender block
  - description: >
      Referrer is an advanced tool that allows you to target visitors according
      to acquisition methods that lead them to your website.

      Kameleoon automatically creates 5 default channels: `Bing`, `Baidu`,
      `Google`, `Yahoo` and `Google Adwords`.
    name: Referrer
  - description: >-
      Segmenting allows you to effectively target visitors. You can create,
      modify, and duplicate segments using the Segment Builder tool in
      Kameleoon’s backend or through our Automation API.
    name: Segment
  - description: This is an object representing studio recommender block
    name: Studio recommender block
  - description: This is an object representing tag
    name: Tag
  - description: >-
      Represents an object aggregating the main information about an experiment
      result.
    name: Takeaway
  - description: This is an object representing a takeaway comment.
    name: Takeaway comment
  - description: >-
      A targeting rule is a system entity that combines segments (user groups)
      and triggers (activation conditions) to define precise targeting rules for
      experiments.
    name: Targeting rule
  - description: This is an object representing a theme
    name: Theme
  - description: >-
      A variation is a modified version of your webpage that you can edit for
      experiments or personalization.

      When you add a new variation, Kameleoon creates a copy of the original
      page from which you started. Kameleoon saves all changes in the variation,
      which will include all your edits when the test starts.
    name: Variation
  - description: This is an object representing a widget
    name: Widget
  - description: This is an object representing a widget studio
    name: Widget studio
  - description: This is an object representing widget studio template
    name: Widget studio template
  - description: Widget template setting API
    name: Widget template setting
  - description: >-
      This is an object representing a Kameleoon account. You can retrieve it to
      view its properties, such as its current email address or locale. With
      proper authorization, your application can read and update an account and
      profile settings.<aside class="notice"> The API does not expose all
      settings. See the API reference for details. </aside>
    name: Account
  - description: >
      You can use your account to set up multiple websites. This is helpful if
      you want to test your website and its mobile version or if you want to try
      Kameleoon on your site in a pre-production environment. It allows you to
      create different testing environments.
    name: Site
  - name: Data
    description: >
      Web personalization involves offering visitors a tailored experience to
      optimize your conversion rate.

      A personalization object contains information about a personalization, as
      well as the segments and variations used in it.
  - name: Goal campaign
    description: >-
      Retrieve experiments that use a specific goal, optionally filtered by
      whether that goal had a positive, negative, or neutral impact on the
      experiment. Results are paginated using cursor-based pagination.
  - name: Data API request stats
    description: Traffic statistics for requests sent to the Kameleoon Data API.
  - name: MTU
    description: >-
      Monthly Tracked Users: the number of distinct visitors tracked on a set of
      sites over a date range.

      The count is asynchronous: 'obtainCount' starts it and returns a data
      code, 'poll' returns the result

      for that data code once it is ready. Results are cached for one hour per
      identical request.
  - name: Audience
    description: >-
      Audience refers to statistical information regarding the number of visits,
      conversions, and other metrics related to a specific segment. Use these
      statistics to understand your website's audience and adjust your segments.
  - name: Raw Export
    description: >-
      Start a raw data exportation for experiment or personalization, which will
      be sent to the given emails.
paths:
  /mtu/obtainCount:
    post:
      tags:
        - MTU
      summary: Start an MTU count
      description: >-
        Starts counting the distinct visitors tracked on the given sites between
        'startDate' and 'endDate'.

        Returns a data code to pass to 'GET /mtu/poll'. The caller must have
        access to every requested site.
      operationId: mtu-obtain-count
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MtuRequest'
        required: true
      responses:
        '200':
          description: Count started, poll with the returned data code
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DataCodeResponseIO'
        '400':
          description: Invalid date range (max 2 years)
        '403':
          description: No access to at least one of the requested sites
        '404':
          description: Not Found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ServiceError'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ServiceError'
      security:
        - bearerAuth: []
components:
  schemas:
    MtuRequest:
      type: object
      description: Sites and date range to count the Monthly Tracked Users for
      properties:
        siteCodes:
          type: array
          description: >-
            Codes of the sites to count. The caller must have access to every
            one of them.
          example:
            - kqfwz0rys3
            - abcd1234ef
          items:
            type: string
          uniqueItems: true
        startDate:
          type: string
          format: date-time
          description: >-
            Start of the range, local date-time without a time zone
            (YYYY-MM-DDThh:mm:ss)
          example: '2026-09-08T00:00:00'
        endDate:
          type: string
          format: date-time
          description: >-
            End of the range, local date-time without a time zone. At most 2
            years after startDate.
          example: '2026-09-09T23:59:59'
      required:
        - endDate
        - siteCodes
        - startDate
    DataCodeResponseIO:
      type: object
      properties:
        dataCode:
          type: string
          description: >-
            Hash code containing information about the data request, such as
            dates, goals, variations, format, and filters.

            Use this code in the Audience poll or Poll results operations to
            obtain actual results.

            There are two possible formats for the code, depending on the
            context: 123...123 or 123...123|123...123.

            For example, the Get global audience operation generates the latter.
          example: >-
            89599333501501534304101214660291496129464311669540935471556471877530843827432
    ServiceError:
      type: object
      properties:
        serviceName:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````