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

# Create or replace the reporting settings of the current company



## OpenAPI

````yaml https://openapi.production.reelevant.io/v1/render/statistics put /analytics/settings/reporting
openapi: 3.0.0
info:
  title: statistics
  version: 1276740a176d654cb1c3e602b6648d22e3bf52a9
  description: >-
    # Errors

    | Error code | Message | HTTP status code | Payload |

    | :--- | :--- | :--- | :--- |

    |
    9000,9001,9002,9003,9004,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017
    | A tag key with this name already exists | 409 | ```{"name":"string"}``` |
servers:
  - url: https://api.reelevant.com/v2/statistics/
    description: production
security: []
paths:
  /analytics/settings/reporting:
    put:
      tags:
        - AnalyticsSettings
      summary: Create or replace the reporting settings of the current company
      operationId: set-reporting-settings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                monthlyCost:
                  type: number
                  description: >-
                    Monthly plan cost, prorated over the queried period for the
                    cost/ROI measures.
                  minimum: 0
                lifecycle:
                  type: object
                  properties:
                    activeWindowDays:
                      type: number
                      description: >-
                        A customer whose last purchase is within this window is
                        still active.
                      minimum: 1
                    churnWindowDays:
                      type: number
                      description: >-
                        Past this window without purchasing, a customer is
                        churned.
                      minimum: 1
                    repeaterMinPurchases:
                      type: number
                      description: Purchases needed to be a repeater.
                      minimum: 2
                    loyalMinPurchases:
                      type: number
                      description: Purchases needed to be loyal.
                      minimum: 2
                    historyWindowDays:
                      type: number
                      description: >-
                        How far back purchases are read to build the per-user
                        history.
                      minimum: 1
                    exposureWindowDays:
                      type: number
                      description: Window over which a user counts as exposed to Reelevant.
                      minimum: 1
                    personalizedMinDisplays:
                      type: number
                      description: >-
                        Personalized displays a customer needs over the exposure
                        window to

                        belong to the exposed population.
                      minimum: 1
                    personalizedMinShare:
                      type: number
                      description: >-
                        Share of a customer's displays that must be personalized
                        for it to

                        belong to the exposed population, between 0 and 1.
                        Customers with some

                        personalization below that share belong to neither
                        population.
                      minimum: 0
                      maximum: 1
                  additionalProperties: false
                  description: >-
                    RFM-style thresholds deciding the lifecycle stage of a user
                    in the

                    `UserLifecycle` cube. Unset fields fall back to their
                    defaults.
              additionalProperties: false
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - success
                    required:
                      - status
                    additionalProperties: false
                  - $ref: >-
                      #/components/schemas/InternalResponse_Intersection_definition_ReportingDefinition_id_string_companyId_string_resourceGroupIds_Array_string_createdAt_Date_updatedAt_Date_Omit
      security:
        - password_auth: []
components:
  schemas:
    InternalResponse_Intersection_definition_ReportingDefinition_id_string_companyId_string_resourceGroupIds_Array_string_createdAt_Date_updatedAt_Date_Omit:
      type: object
      properties:
        program:
          type: string
        version:
          type: string
        datetime:
          type: string
        status:
          type: string
        code:
          type: number
        message:
          type: string
        data:
          allOf:
            - type: object
              properties:
                definition:
                  $ref: '#/components/schemas/ReportingDefinition'
              required:
                - definition
              additionalProperties: false
            - type: object
              properties:
                id:
                  type: string
                  readOnly: true
                companyId:
                  type: string
                  readOnly: true
                resourceGroupIds:
                  type: array
                  items:
                    type: string
                createdAt:
                  type: string
                  format: date-time
                  readOnly: true
                updatedAt:
                  type: string
                  format: date-time
                  readOnly: true
              required:
                - id
                - companyId
                - resourceGroupIds
                - createdAt
                - updatedAt
              additionalProperties: false
            - $ref: >-
                #/components/schemas/AnalyticsSettingsDocument_Without_CompanyId_ToJSON__id_ResourceGroupIds_Serialize
      required:
        - program
        - version
        - datetime
        - status
        - message
        - data
      additionalProperties: false
    ReportingDefinition:
      type: object
      properties:
        monthlyCost:
          type: number
        lifecycle:
          $ref: '#/components/schemas/LifecycleDefinition'
      additionalProperties: false
    AnalyticsSettingsDocument_Without_CompanyId_ToJSON__id_ResourceGroupIds_Serialize:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: '#/components/schemas/AnalyticsSettingsType'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - type
      additionalProperties: false
    LifecycleDefinition:
      type: object
      properties:
        activeWindowDays:
          type: number
        churnWindowDays:
          type: number
        repeaterMinPurchases:
          type: number
        loyalMinPurchases:
          type: number
        historyWindowDays:
          type: number
        exposureWindowDays:
          type: number
        personalizedMinDisplays:
          type: number
        personalizedMinShare:
          type: number
      additionalProperties: false
    AnalyticsSettingsType:
      type: string
      enum:
        - Tag
        - Attribution
        - Reporting
  securitySchemes:
    password_auth:
      type: oauth2
      flows:
        password:
          tokenUrl: https://api.reelevant.com/v1/auth/token
          refreshUrl: https://api.reelevant.com/v1/auth/token
          scopes: {}

````