---
title: "Update an In-Page Event"
method: PATCH
path: "/pages/{page_id}/events/{event_id}"
tags: ["Events"]
---

# Update an In-Page Event

`PATCH /pages/{page_id}/events/{event_id}`

Update an Event that occurs in the context of a Page, such as measuring clicks

## Path parameters

- `page_id` integer, required
- `event_id` integer, required

## Request body

- InPageEventUpdate
  - `archived` boolean — Whether or not to archive this Event
  - `category` 'add_to_cart' | 'save' | 'search' | 'share' | 'purchase' | 'convert' | 'sign_up' | 'subscribe' | 'other'
  - `config` InPageEventConfig
    - `selector` string, required — CSS selector for the page element(s) that trigger an Event
  - `description` string — A description of this Event
  - `key` string — Unique string identifier for this Event within the Project
  - `name` string — A human readable name for this Event
  - `page_id` integer — The Page ID associated with this Event
  - `variation_specific` boolean — Whether or not this Event is variation specific.

## Response `200`

Successfully updated the In-Page event

- InPageEvent — An Event that can occur only within the context of a specific Page (allowed in Web Projects only)
  - `archived` boolean — Whether or not this Event is archived
  - `category` 'add_to_cart' | 'save' | 'search' | 'share' | 'purchase' | 'convert' | 'sign_up' | 'subscribe' | 'other'
  - `config` InPageEventConfig
    - `selector` string, required — CSS selector for the page element(s) that trigger an Event
  - `created` string, date-time — Creation date for this Event
  - `description` string — A description of this Event
  - `event_type` 'click', required — The type of this Event
  - `experiment_count` integer — Number of experiments that reference this Event across all statuses (running, paused, draft, archived). Computed by the upstream service.
  - `id` integer — The unique identifier of the Event
  - `is_classic` boolean — Whether or not this Event is a classic Event. If true, the Event is read-only
  - `is_editable` boolean — Whether or not this Event may be edited
  - `key` string — Unique string identifier for this Event within the Project
  - `last_modified` string, date-time — The last time the Event was modified
  - `name` string, required — A human readable name for this Event
  - `page_id` integer — The Page ID associated with this Event
  - `project_id` integer — The ID of this Event's parent Project
  - `variation_specific` boolean — Whether or not this Event is variation specific.

## Other responses

- `400` — Invalid request body supplied
- `401` — Invalid credentials
- `403` — You do not have access to the specified Event
- `404` — Event not found
- `default` — Unexpected error

---

[API](https://skmtc.dev/optimizely/apis/optimizely-api.md) · [All operations](https://skmtc.dev/optimizely/apis/optimizely-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/optimizely/optimizely-api/revisions/5151fe6a2297/schema)
