Events
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
GET | |
GET | |
POST | |
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_countExample response
Status 200 The count.
Status 403 The user isn't an organization admin.
Status 504 The count took too long.
Retrieve events retention
Returns how far back events stay queryable for this project, the periods set for the project and its organization, the periods an admin can set, and the project's next deletion. Both queryable period fields are null while no retention period applies to the project.
Required API key scopes
project:readResponse
Example request
GET /api /projects /:project_id /events_retentionExample response
Status 200
Retrieve events retention
Returns how far back events stay queryable for this project, the periods set for the project and its organization, the periods an admin can set, and the project's next deletion. Both queryable period fields are null while no retention period applies to the project.
Required API key scopes
project:readResponse
Example request
GET /api /projects /:project_id /events_retentionExample response
Status 200
Create events retention
Sets how long this project keeps events, overriding the organization's period. 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
project:writeRequest parameters
- retention_months
Response
Example request
POST /api /projects /:project_id /events_retentionExample response
Status 200 The project'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.
Create events retention
Sets how long this project keeps events, overriding the organization's period. 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
project:writeRequest parameters
- retention_months
Response
Example request
POST /api /projects /:project_id /events_retentionExample response
Status 200 The project'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 events retention deletion
Counts the project's events that the next monthly cleanup deletes if the project keeps events for retention_months. Organization admins only.
Required API key scopes
project:readquery:readQuery parameters
- retention_monthsinteger
Response
Example request
GET /api /projects /:project_id /events_retention /deletion_countExample response
Status 200 The count.
Status 403 The user isn't an organization admin.
Status 504 The count took too long.
Retrieve events retention deletion
Counts the project's events that the next monthly cleanup deletes if the project keeps events for retention_months. Organization admins only.
Required API key scopes
project:readquery:readQuery parameters
- retention_monthsinteger
Response
Example request
GET /api /projects /:project_id /events_retention /deletion_count




