Booting the PostHog experience

Event definitions

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
PATCH
DELETE
GET

Retrieve event definitions

Required API key scopes

event_definition:read

Path parameters

  • project_id
    string

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


Example request

GET /api/projects/:project_id/event_definitions
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/event_definitions/

Example response

Status 200 No response body

Retrieve event definitions retrieve

Required API key scopes

event_definition:read

Path parameters

  • id
    string

    A UUID string identifying this event definition.

  • project_id
    string

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


Example request

GET /api/projects/:project_id/event_definitions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/event_definitions/:id/

Example response

Status 200 No response body

Update event definitions

Required API key scopes

event_definition:write

Path parameters

  • id
    string

    A UUID string identifying this event definition.

  • project_id
    string

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


Example request

PATCH /api/projects/:project_id/event_definitions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/event_definitions/:id/

Example response

Status 200 No response body

Delete event definitions

Required API key scopes

event_definition:write

Path parameters

  • id
    string

    A UUID string identifying this event definition.

  • project_id
    string

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


Example request

DELETE /api/projects/:project_id/event_definitions/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/event_definitions/:id/

Example response

Status 204 No response body

Retrieve event definitions metrics

Path parameters

  • id
    string

    A UUID string identifying this event definition.

  • project_id
    string

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


Example request

GET /api/projects/:project_id/event_definitions/:id/metrics
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/event_definitions/:id/metrics/

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.

    Loading PostHog...