Events

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

Endpoints

GET

Retrieve events retention

Returns how far back events stay queryable for this project. The window comes from the organization's plan and is read-only. Both window fields are null while no retention window applies to the project.

Required API key scopes

project:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"retention_months": 0,
"retained_from": "2019-08-24",
"docs_url": "http://example.com"
}

Retrieve events retention

Returns how far back events stay queryable for this project. The window comes from the organization's plan and is read-only. Both window fields are null while no retention window applies to the project.

Required API key scopes

project:read

Response


Example request

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

Example response

Status 200
RESPONSE
{
"retention_months": 0,
"retained_from": "2019-08-24",
"docs_url": "http://example.com"
}