Events Retention
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
GET |
Retrieve organization events retention
Returns the events retention period that every project without its own period uses, the default period while none is set, and the periods an organization admin can set.
Required API key scopes
organization:readResponse
Example request
GET /api /organizations /:organization_id /events_retention_settingExample response
Status 200
Create organization events retention
Sets how long every project without its own period keeps events. The period has to be one of retention_months_choices. Older events are deleted at the next monthly cleanup and can't be restored. Organization admins only.
Required API key scopes
organization:writeRequest parameters
- retention_months
Response
Example request
POST /api /organizations /:organization_id /events_retention_settingExample response
Status 200 The organization's new period.
Status 400 The period isn't one of the periods an admin can set.
Status 403 The user isn't an organization admin.
Retrieve organization events retention deletion
Counts the events that the next monthly cleanup deletes if the organization keeps events for retention_months, summed over the projects without their own period. Organization admins only.
Required API key scopes
organization:readquery:readQuery parameters
- retention_monthsinteger
Response
Example request
GET /api /organizations /:organization_id /events_retention_setting /deletion_countExample response
Status 200 The count.
Status 403 The user isn't an organization admin.
Status 504 The count took too long.
Retrieve organization events retention downgrade deletion
Counts the events that the deletion pass after a plan downgrade deletes if the organization's events retention drops to retention_months, whether or not deletion is rolled out to the organization yet. Sums the projects whose period is longer than retention_months. Organization admins only.
Required API key scopes
organization:readquery:readQuery parameters
- retention_monthsinteger
Response
Example request
GET /api /organizations /:organization_id /events_retention_setting /downgrade_deletion_count




