> ## 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 attribution settings of the current company



## OpenAPI

````yaml https://openapi.production.reelevant.io/v1/render/statistics put /analytics/settings/attribution
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/attribution:
    put:
      tags:
        - AnalyticsSettings
      summary: Create or replace the attribution settings of the current company
      operationId: set-attribution-settings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttributionDefinition'
      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_AttributionDefinition_id_string_companyId_string_resourceGroupIds_Array_string_createdAt_Date_updatedAt_Date_Omit
        '422':
          description: ''
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InternalResponse_'
                  - type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - fail
                      error_code:
                        $ref: '#/components/schemas/StatisticsErrorCode'
                      code:
                        type: number
                        enum:
                          - 422
                      message:
                        type: string
                        enum:
                          - >-
                            The interaction configuration for this conversion
                            channel is invalid
                      data:
                        type: object
                        properties:
                          channel:
                            type: string
                          reason:
                            type: string
                        required:
                          - channel
                          - reason
                        additionalProperties: false
                    required:
                      - status
                      - error_code
                      - code
                      - message
                    additionalProperties: false
      security:
        - password_auth: []
components:
  schemas:
    AttributionDefinition:
      type: object
      properties:
        dataset:
          $ref: '#/components/schemas/AttributionDataset'
        source:
          $ref: '#/components/schemas/AttributionSource'
        utm:
          $ref: '#/components/schemas/AttributionUtmDefinition'
        conversionChannels:
          type: array
          items:
            $ref: '#/components/schemas/AttributionConversionChannel'
        model:
          $ref: '#/components/schemas/AttributionModel'
        method:
          $ref: '#/components/schemas/AttributionMethod'
        events:
          $ref: '#/components/schemas/AttributionEventsDefinition'
      required:
        - dataset
        - method
      additionalProperties: false
    InternalResponse_Intersection_definition_AttributionDefinition_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/AttributionDefinition'
              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
    InternalResponse_:
      type: object
      properties:
        program:
          type: string
        version:
          type: string
        datetime:
          type: string
        status:
          type: string
        code:
          type: number
        message:
          type: string
        data:
          type: object
          properties: {}
          additionalProperties: false
      required:
        - program
        - version
        - datetime
        - status
        - message
        - data
      additionalProperties: false
    StatisticsErrorCode:
      type: number
      enum:
        - 9000
        - 9001
        - 9002
        - 9003
        - 9004
        - 9006
        - 9007
        - 9008
        - 9009
        - 9010
        - 9011
        - 9012
        - 9013
        - 9014
        - 9015
        - 9016
        - 9017
    AttributionDataset:
      type: string
      enum:
        - web-tracking
        - customer-purchases
    AttributionSource:
      type: string
      enum:
        - reelevant
        - utm
    AttributionUtmDefinition:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/AttributionUtmField'
          minItems: 1
        period:
          type: number
          minimum: 1
      additionalProperties: false
    AttributionConversionChannel:
      type: object
      properties:
        channel:
          type: string
        interactions:
          type: array
          items:
            $ref: '#/components/schemas/AttributionInteractionWindow'
          minItems: 1
      required:
        - channel
        - interactions
      additionalProperties: false
    AttributionModel:
      type: string
      enum:
        - last-touch
        - linear
        - decay
        - incremental
    AttributionMethod:
      type: string
      enum:
        - default
        - sameReferenceId
    AttributionEventsDefinition:
      type: object
      properties:
        steps:
          type: array
          items:
            $ref: '#/components/schemas/AttributionFunnelStep'
          minItems: 1
      required:
        - steps
      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
    AttributionUtmField:
      type: string
      enum:
        - source
        - medium
        - campaign
        - term
        - content
    AttributionInteractionWindow:
      type: object
      properties:
        interactionType:
          $ref: '#/components/schemas/AttributionInteractionType'
        period:
          type: number
          minimum: 1
      required:
        - interactionType
      additionalProperties: false
    AttributionFunnelStep:
      type: object
      properties:
        name:
          type: string
        events:
          type: array
          items:
            type: string
          minItems: 1
      required:
        - name
        - events
      additionalProperties: false
    AnalyticsSettingsType:
      type: string
      enum:
        - Tag
        - Attribution
        - Reporting
    AttributionInteractionType:
      type: string
      enum:
        - click
        - display
  securitySchemes:
    password_auth:
      type: oauth2
      flows:
        password:
          tokenUrl: https://api.reelevant.com/v1/auth/token
          refreshUrl: https://api.reelevant.com/v1/auth/token
          scopes: {}

````