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.

get/api/projects/{project_id}/event_definitions/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/event_definitions/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

event_type'event' | 'event_custom' | 'event_posthog'

event_custom keeps only names without a $ prefix and event_posthog only names with one. Default event.

exclude_hiddenboolean

When true, omit events that have been explicitly hidden by a team admin (Enterprise only).

exclude_staleboolean

When true, omit events whose last ingested occurrence is older than 30 days. Events that have never been seen (last_seen_at is null) are kept so newly-defined events remain discoverable. Default false. If a search returns zero results with this filter on, retry with exclude_stale=false and tell the user the matches are stale.

excluded_propertiesstring

JSON-encoded list of event names to omit. The name matches the property definitions endpoint that shares it.

limitinteger

Number of results to return per page.

namesstring[]

Return exact matches for these event names. Pass names as repeated or comma-separated values.

offsetinteger

The initial index from which to return the results.

orderingstring[]

Sort keys, prefixed with - for descending. Default -last_seen_at::date then name. Projects with more than 100000 event definitions default to name, unless the request sets search, exclude_stale, verified, names, tags or event_type=event_posthog.

searchstring

Case-insensitive match on the event name. Every whitespace-separated term has to match.

tagsstring

JSON-encoded list of tag names. Keeps events that carry any of them.

verifiedboolean

When true, keep only verified events and core PostHog events. When false, keep the rest (Enterprise only).

Response

countinteger required
nextstring uri nullable
previousstring uri nullable
count_is_cappedboolean

True when count stopped at a cap, so it is a lower bound and next keeps paging past it.

Example response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100"
}

Changes

No recorded changes to this operation across all 1 revision of this API.