Event definitions
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
POST | |
POST | |
GET | |
GET | |
GET | |
GET | |
GET |
List all event definitions
List the event definitions of a project. On projects with more than 50000 event definitions, count stops at 10000 and count_is_capped is true, unless the request sets search, exclude_stale, verified, names, tags or event_type=event_posthog. Projects with more than 100000 event definitions also default to ordering by name under the same condition.
Required API key scopes
event_definition:readQuery parameters
- event_typestringOne of:
"event""event_custom""event_posthog" - exclude_hiddenboolean
- exclude_staleboolean
- excluded_propertiesstring
- fuzzy_searchboolean
- limitintegerDefault:
100 - namesarray
- offsetintegerDefault:
0 - orderingarray
- searchstring
- tagsstring
- verifiedboolean
Response
Example request
GET /api /projects /:project_id /event_definitionsExample response
Status 200
Create event definitions
Required API key scopes
event_definition:writeRequest parameters
- namestring
- ownerinteger | null
- descriptionstring | null
- tagsarray
- verifiedboolean
- hiddenboolean | null
- enforcement_mode
- primary_propertystring | null
- post_to_slackbooleanDefault:
false - default_columnsarray
Response
Example request
POST /api /projects /:project_id /event_definitionsExample response
Status 201
Retrieve event definitions
Required API key scopes
event_definition:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /event_definitions /:idExample response
Status 200
Update event definitions
Required API key scopes
event_definition:writePath parameters
- idstring
Request parameters
- namestring
- ownerinteger | null
- descriptionstring | null
- tagsarray
- verifiedboolean
- hiddenboolean | null
- enforcement_mode
- primary_propertystring | null
- post_to_slackbooleanDefault:
false - default_columnsarray
Response
Example request
PATCH /api /projects /:project_id /event_definitions /:idExample response
Status 200
Delete event definitions
Required API key scopes
event_definition:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /event_definitions /:idExample response
Status 204 No response body
Retrieve event definitions metrics
Path parameters
- idstring
Example request
GET /api /projects /:project_id /event_definitions /:id /metricsExample response
Status 200 No response body
Create event definitions stop ingesting
Drop new events with this name at ingestion, then hide the definition and schedule its delete.
Adds an exact event name condition to the live event filter of each environment in the project, because the definition is shared by all of them. This never makes a team's own filter conditions live: if a filter is in dry run or turned off, or can't take one more condition, the request fails and nothing changes. Dropped events can't be recovered.
Required API key scopes
event_definition:writeevent_filter:writePath parameters
- idstring
Response
Example request
POST /api /projects /:project_id /event_definitions /:id /stop_ingestingExample response
Status 200
Create event definitions bulk update tags
Add, remove, or replace tags across multiple event definitions in one request.
Overrides TaggedItemViewSetMixin.bulk_update_tags, which assumes integer PKs and runs
object-level access-control filtering. Event definitions use UUID PKs and are not an
object-level access-controlled resource — project membership (enforced by the viewset) is
the only boundary, matching the single-object update path — so this scopes by project and
skips the per-object editor check. Tags live on the base EventDefinition row, so it
operates there regardless of the enterprise extension.
Required API key scopes
event_definition:writeRequest parameters
- idsarray
- action
- tagsarray
Response
Example request
POST /api /projects /:project_id /event_definitions /bulk_update_tagsExample response
Status 200
Create event definitions bulk update verified
Mark multiple event definitions as verified or unverified in one request.
In the same vein as bulk_update_tags, but verified lives on the enterprise
EnterpriseEventDefinition extension rather than the base row, so this action:
- requires an enterprise license;
- scopes by project (
team__project_id) and relies on project membership — the same boundary the single-object update path uses — rather than object-level RBAC; - lazily promotes ingestion-created base rows to
EnterpriseEventDefinition(mirroring_get_event_definition) before settingverified; - mirrors the single-object semantics: verifying stamps
verified_by/verified_atand unhides the event (an event cannot be both hidden and verified); unverifying clears them; - logs a "changed" activity per event so the History tab matches the single-object path.
Events already in the target state are skipped (not re-written, not logged).
Required API key scopes
event_definition:writeRequest parameters
- idsarray
- verifiedboolean
Response
Example request
POST /api /projects /:project_id /event_definitions /bulk_update_verifiedExample response
Status 200
Retrieve event definitions by name
Get event definition by exact name
Required API key scopes
event_definition:readQuery parameters
- namestring
Response
Example request
GET /api /projects /:project_id /event_definitions /by_nameExample response
Status 200
Retrieve event definitions golang
Required API key scopes
event_definition:readExample request
GET /api /projects /:project_id /event_definitions /golangExample response
Status 200 No response body
Retrieve event definitions primary properties
Resolve team-configured primary properties for event definitions.
The response only contains entries where a non-null primary_property is set on the EventDefinition. Callers should fall back to the core taxonomy defaults client-side for names not present in the response.
Required API key scopes
event_definition:readQuery parameters
- namesarray
Response
Example request
GET /api /projects /:project_id /event_definitions /primary_propertiesExample response
Status 200
Retrieve event definitions python
Required API key scopes
event_definition:readExample request
GET /api /projects /:project_id /event_definitions /pythonExample response
Status 200 No response body
Retrieve event definitions typescript
Required API key scopes
event_definition:readExample request
GET /api /projects /:project_id /event_definitions /typescript




