> ## 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.

# Partially update a variation

> Update several fields of a variation



## OpenAPI

````yaml /automation.api.json patch /variations/{variationId}
openapi: 3.0.3
info:
  title: OpenAPI definition for automation api
  version: 1.0.0
servers:
  - url: https://api.kameleoon.com
security: []
tags:
  - description: >-
      This is an object representing a Kameleoon account.You can retrieve it to
      view its properties, such as its current e-mail address or locale.With
      proper authorization, your application can read and update an account and
      profile settings.<aside class="notice"> Not all settings are exposed via
      the API. See the API reference for details. </aside>
    name: Account
  - description: >-
      Feature flag is used to  help our clients implement new features, test and
      deploy them viaour SDK. This service allows you to create and configure
      the feature flag which will be used in the source code of your feature.
    name: FeatureFlag
  - 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
  - description: >-
      Custom data is an advanced tool that lets you target your customers in a
      unique way using data that is already available,such as user account
      information.
    name: CustomData
  - description: >-
      Experiment is an A/B test which can be targeted to 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 be used to achieve the best results.
    name: Experiment
  - description: >-
      To measure the efficiency of an experiment or a personalization, it must
      be linked to one or several goals. All goals can be managed through
      Kameleoon interface or Automation API. 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 `KeyMoment`
      has now been renamed to `Triggers`.
    name: KeyMoment
  - description: >-
      KeyPage allows you to target visitors that have visited a particular page,
      or multiple pages on your website.
    name: KeyPage
  - 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: This is an object representing a projectThemeConfig
    name: ProjectThemeConfig
  - description: This is an object representing recommender block
    name: RecommenderBlock
  - 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: StudioRecommenderBlock
  - 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: TakeawayComment
  - description: >-
      TargetingRule is a system entity that combines segments (user groups) and
      triggers (activation conditions) to define precise targeting rules for
      experiments.
    name: TargetingRule
  - description: This is an object representing a theme
    name: Theme
  - description: >-
      A variation is a modified version of your webpage that can be edited for
      experiments or personalization.

      When you add a new variation, Kameleoon creates a copy of the original
      page from which you started.All changes will be saved 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: WidgetStudio
  - description: This is an object representing widget studio template
    name: WidgetStudioTemplate
  - name: Audience
    description: >-
      Audience refers to statistical information regarding the number of visits,
      conversions, and other metrics related to a specific segment. Gaining
      insights into your website's audience is essential for effectively
      adjusting segments.
  - name: Data
    description: >
      Web personalization involves offering visitors a tailored experience to
      optimize your conversion rate.

      Personalization object contains information about a personalization, as
      well as the segments and variations used in it.
  - name: Raw Export
    description: >-
      Start a raw data exportation for experiment or personalization, which will
      be sent to the given emails.
paths:
  /variations/{variationId}:
    patch:
      tags:
        - Variation
      summary: Partially update a variation
      description: Update several fields of a variation
      operationId: partial-update-variation
      parameters:
        - in: path
          name: variationId
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariationUpdateIO'
        required: true
      responses:
        '200':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Variation'
          description: OK
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Bad Request
        '401':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Unauthorized
        '403':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Forbidden
        '404':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Not Found
        '422':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Unprocessable Entity
        '423':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Locked
        '429':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Too Many Requests
        '500':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ExternalResponseObject'
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    VariationUpdateIO:
      type: object
      properties:
        cssCode:
          type: string
          description: Code editor-css style
        experimentId:
          type: integer
          description: Experiment id for this variation
          format: int64
        isJsCodeAfterDomReady:
          type: boolean
          description: >-
            Set to `true` (which is also the default value) if the code is
            applied after the DOM is ready.
        jsCode:
          type: string
          description: Code editor-javascript code
        name:
          type: string
          description: Name of the given variation
        prompt:
          $ref: '#/components/schemas/Prompt'
        shadowDom:
          type: boolean
          description: ShadowDOM option
    Variation:
      required:
        - name
        - siteId
      type: object
      properties:
        color:
          type: integer
          description: Variation color displayed in the editor
          format: int32
        creationMode:
          type: string
          description: >-
            Creation mode of the variation: CODE_BASE, GRAPHICAL, AI or
            UNDEFINED
          enum:
            - AI
            - CODE_BASE
            - GRAPHICAL
            - UNDEFINED
            - WIDGET
        cssCode:
          type: string
          description: Code editor css code for variation
        customJson:
          type: string
          description: Custom JSON for this variation
        experimentId:
          type: integer
          description: Id of the experiment this variation belongs to
          format: int64
          readOnly: true
        expositionFrequencyDelaySecondsBetweenTwoExpositions:
          type: integer
          description: Delay in seconds between two exposures
          format: int64
        expositionFrequencySameVisit:
          type: integer
          description: Frequency of exposure during the same visit
          format: int32
        expositionFrequencySameVisitor:
          type: integer
          description: Frequency of the exposure for the same visitor
          format: int32
        expositionFrequencySameVisitorDelaySeconds:
          type: integer
          description: Delay in seconds between exposure for the same visitor
          format: int64
        forceNoFlicker:
          type: boolean
        id:
          type: integer
          description: Unique Id of the variation
          format: int64
        isJsCodeAfterDomReady:
          type: boolean
          description: >-
            Set to `true` (which is also the default value) if the code is
            applied once the DOM is ready.
        jsCode:
          type: string
          description: Code editor javascript code for variation
        name:
          type: string
          description: Name of the variation
        personalizationId:
          type: integer
          description: Id of the personalization this variation belongs to
          format: int64
          readOnly: true
        prompt:
          $ref: '#/components/schemas/Prompt'
        redirection:
          $ref: '#/components/schemas/VariationRedirection'
        redirectionStrings:
          type: string
          description: >-
            Redirect URL used for redirecting variation. Deprecated property:
            use property 'redirection' instead
          deprecated: true
        shadowDom:
          type: boolean
          description: ShadowDOM option
        siteId:
          type: integer
          description: Site Id of the project the variation belongs to
          format: int64
        widgetTemplateInput:
          type: string
          description: Widget template input data in JSON format.
      description: JSON representation of the variation
    ExternalResponseObject:
      type: object
      properties:
        code:
          type: string
        impersonator:
          type: string
        message:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
            - ERROR
        sub:
          type: string
        time:
          type: integer
          format: int64
        timestamp:
          type: string
          format: date-time
    Prompt:
      required:
        - textInput
      type: object
      properties:
        attachments:
          type: array
          description: >-
            Attachment metadata. Files are sent via multipart part `attachments`
            and matched by index.
          items:
            $ref: '#/components/schemas/PromptAttachment'
        promptSource:
          type: string
          description: Internal tracking value for analytics or partner attribution
        textInput:
          type: string
          description: The actual prompt content to be sent and executed by Electra
      description: >-
        Object used to define an autorun message in the variation. Triggers the
        creation of a message of type autorun if valid
    VariationRedirection:
      type: object
      properties:
        includeQueryParameters:
          type: boolean
          description: >-
            In case of global redirection, option to include query parameters
            from the original url
        parameters:
          type: string
          description: >-
            Parameters used for the redirection, in case of parameter
            redirection
          example: param1=foo&param2=bar
        type:
          type: string
          description: Type of the redirection
          enum:
            - GLOBAL_REDIRECTION
            - PARAMETER_REDIRECTION
        url:
          type: string
          description: URL used for the redirection, in case of global redirection
          example: www.kameleoon.com
      description: Redirection parameters of a variation
    PromptAttachment:
      required:
        - mediaType
        - name
        - type
      type: object
      properties:
        mediaType:
          $ref: '#/components/schemas/PromptAttachmentMediaType'
        name:
          maxLength: 255
          minLength: 0
          type: string
          description: Human-readable attachment name.
          example: US-39613---Image-attachement
        type:
          $ref: '#/components/schemas/PromptAttachmentType'
      description: >-
        Prompt attachment metadata. The corresponding file is sent via multipart
        part `attachments`.
    PromptAttachmentMediaType:
      type: string
      description: Attachment media type.
      enum:
        - IMAGE
        - IMAGE
    PromptAttachmentType:
      type: string
      description: Attachment lifecycle type. Mirrors media-storage image type.
      enum:
        - TEMPORARY
        - REGULAR
        - TEMPORARY
        - REGULAR
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````