---
title: "Update goal"
method: PUT
path: "/goals/{goalId}"
tags: ["Goal"]
---

# Update goal

`PUT /goals/{goalId}`

Update goal with given id

## Path parameters

- `goalId` integer, required

## Request body

- Goal
  - `accessLimiters` AccessLimiter[]
    - `accessHolder` 'PERSONALIZATION' | 'AB_TEST' | 'TAG' | 'FEATURE_FLAG'
    - `accessHolderId` integer
    - `id` integer
  - `createdBy` integer — Account Id of the creator of the experiment
  - `customDatas` CustomData[] — List of custom data using this goal
    - `adobeAnalyticsVariableName` string — Variable name of the Adobe Analytics
    - `advancedProposedValues` string — Enables to set values for targeting conditions in the form of a JS table
    - `createdById` integer — Account Id of the creator of the custom data
    - `customEvalCode` string — Custom code that will be executed
    - `dateCreated` string, date-time — Date and time a record is created
    - `dateModified` string, date-time — Date and time a record is modified
    - `description` string — Description of the custom data
    - `format` 'BOOLEAN' | 'NUMBER' | 'STRING' — Custom data value format
    - `gtmVariableName` string — Variable name of the Google Tag Manager
    - `id` integer — Unique Id of the custom data.
    - `index` integer
    - `isConstant` boolean — Indicates if the custom data is a constant
    - `isFiltrableVentilable` boolean — Indicates if custom data should be filtered and marked as available for breakdown
    - `isLearnable` boolean — Indicates if this data should be included in Kameleoon machine learning
    - `isLocalOnly` boolean — Indicates if the custom data is only stored on the user's device.
    - `method` 'ADOBE_ANALYTICS' | 'CLIENT' | 'CUSTOM_CODE' | 'GTM' | 'SDK' | 'TC' | 'TEALIUM', required — Method through which a custom data will be transmitted
    - `modificationDate` string, date-time — Date and time a record is modified (Deprecated, use dateModified instead)
    - `name` string, required — Name of the custom data
    - `siteCode` string — System generated unique code to identify a website. This is an optional field that is included in the request body
    - `siteId` integer, required — Id of the project this record belongs
    - `tags` string — Tags that belong to this record
    - `tcVariableName` string — Name of the tag commander data layer, if it is selected as a transmission method
    - `tealiumVariableName` string — Name of the Tealium, if it is selected as a transmission method
    - `type` 'COUNT_LIST' | 'LIST' | 'UNIQUE' — Custom data type. Custom data can be presented as a single value (UNIQUE), or a list of values (LIST), ​​or a countable list of values (COUNT_LIST)
  - `dateCreated` string, date-time
  - `dateModified` string, date-time
  - `description` string
  - `experimentAmount` integer — Number of experiments using this goal. This is an optional field that that is included in the request body
  - `experiments` integer[] — List of experiment ids using this goal. This is an optional field that is included in the request body
  - `featureFlagAmount` integer — Number of feature flags using this goal. This is an optional field that that is included in the request body
  - `hasMultipleConversions` boolean, required — Indicates if this goal has multiple conversions
  - `holdoutAmount` integer — Number of holdouts using this goal. This is an optional field that is included in the request body
  - `holdouts` integer[] — List of holdout ids using this goal. This is an optional field that is included in the request body
  - `id` integer — Unique Id of the goal
  - `isActive` boolean — Deprecated. Use status instead. Indicates the status of the goal: active or not
  - `isTargetingSegmentMentalist` boolean — Indicates if the goal is related to a mentalist segment. This is an optional field that is included in the request body
  - `links` Link[] — List of links to related entities. This is an optional field that is included in the request body
    - `domainId` integer
    - `domainStatus` string
    - `domainType` 'EXPERIMENT' | 'PERSONALIZATION' | 'FEATURE_FLAG' | 'HOLDOUT'
    - `linkRole` 'MAIN' | 'SECONDARY'
    - `linkType` 'DIRECT' | 'TRANSITIVE'
  - `mentalistWeight` number, double
  - `name` string, required — Name of the goal
  - `params` union
    - AccessToPageGoalParams — Type of params depends on 'type' field. 'CLICK' - ClickTrackingGoalParams. 'SCROLL' - ScrollTrackingGoalParams. 'URL' - AccessToPageGoalParams. 'TIME_SPENT' - TimeSpentGoalParams. 'PAGE_VIEWS' - PageViewsGoalParams. For others types params aren't needed.
      - `matchString` string
      - `matchType` 'CONTAINS' | 'CORRESPONDS_EXACTLY' | 'REGULAR_EXPRESSION'
    - ClickTrackingGoalParams — Type of params depends on 'type' field. 'CLICK' - ClickTrackingGoalParams. 'SCROLL' - ScrollTrackingGoalParams. 'URL' - AccessToPageGoalParams. 'TIME_SPENT' - TimeSpentGoalParams. 'PAGE_VIEWS' - PageViewsGoalParams. For others types params aren't needed.
      - `customSelectors` TrackingSelector[] — Selection with a CSS selector. CSS selector to track the corresponding element
        - `id` integer
        - `mode` 'ID' | 'CLASS' | 'TAG' | 'TAG_CLASS' | 'CUSTOM' | 'AUTOGENERATED' | 'CONTENT' | 'CUSTOM_ATTRIBUTE'
        - `selector` string
      - `url` string — URL of the page on which you want to create your click tracker. Example: www.mozilla.org
    - PageViewsGoalParams — Type of params depends on 'type' field. 'CLICK' - ClickTrackingGoalParams. 'SCROLL' - ScrollTrackingGoalParams. 'URL' - AccessToPageGoalParams. 'TIME_SPENT' - TimeSpentGoalParams. 'PAGE_VIEWS' - PageViewsGoalParams. For others types params aren't needed.
      - `numberMatchType` 'MORE_THAN' | 'EQUALS' | 'LESS_THAN'
      - `numberOfVisitedPages` integer
    - ScrollTrackingGoalParams — Type of params depends on 'type' field. 'CLICK' - ClickTrackingGoalParams. 'SCROLL' - ScrollTrackingGoalParams. 'URL' - AccessToPageGoalParams. 'TIME_SPENT' - TimeSpentGoalParams. 'PAGE_VIEWS' - PageViewsGoalParams. For others types params aren't needed.
      - `type` 'ELEMENT' | 'PERCENTAGE' | 'PIXELS_HEIGHT' — When the user scrolls down to
      - `url` string
      - `value` number, double — Scroll tracking value
    - TimeSpentGoalParams — Type of params depends on 'type' field. 'CLICK' - ClickTrackingGoalParams. 'SCROLL' - ScrollTrackingGoalParams. 'URL' - AccessToPageGoalParams. 'TIME_SPENT' - TimeSpentGoalParams. 'PAGE_VIEWS' - PageViewsGoalParams. For others types params aren't needed.
      - `matchType` 'MORE_THAN' | 'EQUALS' | 'LESS_THAN'
      - `timeSeconds` integer
  - `personalizationAmount` integer — Number of personalizations using this goal. This is an optional field that is included in the request body
  - `personalizations` integer[] — List of personalization ids using this goal. This is an optional field that is included in the request body
  - `siteId` integer, required — Site Id of the project that the goal belongs to
  - `status` 'ACTIVE' | 'INACTIVE' — Indicates the status of the goal: active or inactive
  - `tags` string[] — List of tags belonging to this goal. For GET requests: this is an optional field that has to be specified in request params.
  - `targetingSegmentMentalist` integer[]
  - `trackingTools` string[]
  - `type` 'CLICK' | 'CUSTOM' | 'SCROLL' | 'PAGE_VIEWS' | 'URL' | 'TIME_SPENT' | 'RETENTION_RATE' | 'WAREHOUSE' | 'RATIO_METRICS', required — Type of goal

## 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/versions/09f2abcea0b5/schema)
