---
title: "Replace a conversion goal's definition"
method: PUT
path: "/projects/{project_id}/analytics/goals/{goal_id}"
tags: ["Conversions"]
---

# Replace a conversion goal's definition

`PUT /projects/{project_id}/analytics/goals/{goal_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/analytics/goals/{goal_id}`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required
- `goal_id` integer, required

## Request body

- AnalyticsGoalInput: Body of `POST` and `PUT /projects/{project_id}/analytics/goals`.
  - `event_filter` SmartFilter[]: Conditions every matching event must meet, in the vocabulary funnel steps use, e.g. `[{"type":"custom_data","value":{"path":"plan","value":"pro"}}]`.
    - union: Smart filter presets for common funnel patterns
      - object: Match specific page path
        - `type` 'page_path', required
        - `value` string, required: Match specific page path
      - object: Match specific hostname
        - `type` 'hostname', required
        - `value` string, required: Match specific hostname
      - object: Match UTM source
        - `type` 'utm_source', required
        - `value` string, required: Match UTM source
      - object: Match UTM campaign
        - `type` 'utm_campaign', required
        - `value` string, required: Match UTM campaign
      - object: Match UTM medium
        - `type` 'utm_medium', required
        - `value` string, required: Match UTM medium
      - object: Match referrer hostname
        - `type` 'referrer_hostname', required
        - `value` string, required: Match referrer hostname
      - object: Match specific channel (organic, paid, direct, referral, etc.)
        - `type` 'channel', required
        - `value` string, required: Match specific channel (organic, paid, direct, referral, etc.)
      - object: Match device type (mobile, desktop, tablet)
        - `type` 'device_type', required
        - `value` string, required: Match device type (mobile, desktop, tablet)
      - object: Match browser
        - `type` 'browser', required
        - `value` string, required: Match browser
      - object: Match operating system
        - `type` 'operating_system', required
        - `value` string, required: Match operating system
      - object: Match language
        - `type` 'language', required
        - `value` string, required: Match language
      - object: Match custom event properties by JSON path Format: {"path": "user.plan", "value": "premium"} This will match events where props->'user'->>'plan' = 'premium', falling back to the legacy `event_data` column when `props` is NULL
        - `type` 'custom_data', required
        - `value` object, required: Match custom event properties by JSON path Format: {"path": "user.plan", "value": "premium"} This will match events where props->'user'->>'plan' = 'premium', falling back to the legacy `event_data` column when `props` is NULL
          - `path` string, required
          - `value` string, required
  - `event_name` string, nullable: Required for `event` goals, refused for `page` goals.
  - `kind` 'event' | 'page', required: What a goal matches.
  - `name` string, required: Shown in the Conversions report, e.g. "Signup". Unique per project, ignoring case.
  - `page_path` string, nullable: Required for `page` goals, refused for `event` goals. Starts with `/`; `*` matches any run of characters, e.g. `/thank-you` or `/docs/*`.
  - `revenue_currency` string, nullable: ISO 4217 currency code of `revenue_property`, e.g. `EUR`.
  - `revenue_property` string, nullable: Event property holding the value of one conversion, e.g. `amount`. Event goals only; requires `revenue_currency`.

## Response `200`

Goal updated

- AnalyticsGoal: A conversion goal.
  - `created_at` string, date-time, required
  - `event_filter` SmartFilter[], required
    - union: Smart filter presets for common funnel patterns
      - object: Match specific page path
        - `type` 'page_path', required
        - `value` string, required: Match specific page path
      - object: Match specific hostname
        - `type` 'hostname', required
        - `value` string, required: Match specific hostname
      - object: Match UTM source
        - `type` 'utm_source', required
        - `value` string, required: Match UTM source
      - object: Match UTM campaign
        - `type` 'utm_campaign', required
        - `value` string, required: Match UTM campaign
      - object: Match UTM medium
        - `type` 'utm_medium', required
        - `value` string, required: Match UTM medium
      - object: Match referrer hostname
        - `type` 'referrer_hostname', required
        - `value` string, required: Match referrer hostname
      - object: Match specific channel (organic, paid, direct, referral, etc.)
        - `type` 'channel', required
        - `value` string, required: Match specific channel (organic, paid, direct, referral, etc.)
      - object: Match device type (mobile, desktop, tablet)
        - `type` 'device_type', required
        - `value` string, required: Match device type (mobile, desktop, tablet)
      - object: Match browser
        - `type` 'browser', required
        - `value` string, required: Match browser
      - object: Match operating system
        - `type` 'operating_system', required
        - `value` string, required: Match operating system
      - object: Match language
        - `type` 'language', required
        - `value` string, required: Match language
      - object: Match custom event properties by JSON path Format: {"path": "user.plan", "value": "premium"} This will match events where props->'user'->>'plan' = 'premium', falling back to the legacy `event_data` column when `props` is NULL
        - `type` 'custom_data', required
        - `value` object, required: Match custom event properties by JSON path Format: {"path": "user.plan", "value": "premium"} This will match events where props->'user'->>'plan' = 'premium', falling back to the legacy `event_data` column when `props` is NULL
          - `path` string, required
          - `value` string, required
  - `event_name` string, nullable
  - `id` integer, required
  - `kind` 'event' | 'page', required: What a goal matches.
  - `name` string, required
  - `page_path` string, nullable
  - `project_id` integer, required
  - `revenue_currency` string, nullable
  - `revenue_property` string, nullable
  - `updated_at` string, date-time, required

## Other responses

- `400`: Invalid goal
- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Goal not found
- `409`: Name taken
- `500`: Internal server error

## Changes

- **2026-11-20** `1a920722ba7e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/analytics/goals/:goal_id/put.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
