---
title: "Update a Custom Event"
method: PATCH
path: "/projects/{project_id}/custom_events/{event_id}"
tags: ["Events"]
---

# Update a Custom Event

`PATCH /projects/{project_id}/custom_events/{event_id}`

Update a Custom Event

## Path parameters

- `project_id` integer, required
- `event_id` integer, required

## Request body

- CustomEventUpdate
  - `archived` boolean — Whether or not to archive this Event
  - `category` 'add_to_cart' | 'save' | 'search' | 'share' | 'purchase' | 'convert' | 'sign_up' | 'subscribe' | 'other'
  - `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

## Response `200`

Return the updated Event

- CustomEvent
  - `archived` boolean — Whether or not to archive this Event
  - `category` 'add_to_cart' | 'save' | 'search' | 'share' | 'purchase' | 'convert' | 'sign_up' | 'subscribe' | 'other'
  - `created` string, date-time — Creation date for this Event
  - `description` string — A description of this Event
  - `event_properties` EventProperty[] — A set of user-defined data elements for the event. Metrics can filter on particular values of these properties.
    - `data_type` 'boolean' | 'number' | 'string' — The type of data that can be accepted for this property.
    - `name` string — The name of the property.
  - `event_type` 'custom' — The type of this Event
  - `id` integer — The unique identifier of the Event
  - `is_classic` boolean — Whether or not this Event is a classic Event. If true, this Event is read-only
  - `is_editable` boolean — Whether or not this Event may be edited
  - `key` string, required — Unique string identifier for this Event within the Project
  - `name` string — A human readable name for this Event. If unspecified, defaults to the key
  - `project_id` integer — The ID of this Event's parent Project

## Other responses

- `400` — Invalid Project ID supplied
- `401` — Invalid credentials
- `403` — You do not have permission to access 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)
