---
title: "Partially update a variation"
method: PATCH
path: "/variations/{variationId}"
tags: ["Variation"]
---

# Partially update a variation

`PATCH /variations/{variationId}`

Update several fields of a variation

## Path parameters

- `variationId` integer, required

## Request body

- VariationUpdateIO
  - `cssCode` string — Code editor-css style
  - `experimentId` integer — Experiment id for this variation
  - `isJsCodeAfterDomReady` boolean — Set to `true` (which is also the default value) if the code is applied after the DOM is ready.
  - `jsCode` string — Code editor-javascript code
  - `name` string — Name of the given variation
  - `prompt` Prompt — Object used to define an autorun message in the variation. Triggers the creation of a message of type autorun if valid
    - `attachments` PromptAttachment[] — Attachment metadata. Files are sent via multipart part `attachments` and matched by index.
      - `mediaType` 'IMAGE' | 'IMAGE', required — Attachment media type.
      - `name` string, required — Human-readable attachment name.
      - `type` 'TEMPORARY' | 'REGULAR' | 'TEMPORARY' | 'REGULAR', required — Attachment lifecycle type. Mirrors media-storage image type.
    - `promptSource` string — Internal tracking value for analytics or partner attribution
    - `textInput` string, required — The actual prompt content to be sent and executed by Electra
  - `shadowDom` boolean — ShadowDOM option

## Response `200`

OK

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `422` — Unprocessable Entity
- `423` — Locked
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api.md) · [All operations](https://skmtc.net/kameleoon/apis/openapi-definition-for-automation-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kameleoon/openapi-definition-for-automation-api/revisions/09f2abcea0b5/schema)
