logs

Retention rules for one record kind.

TracingRetentionRuleViewSet reuses this for span rules, which live in their own model. It swaps the queryset, the serializer and team_rules, so every read and write here goes through team_rules rather than naming a model.

post/api/projects/{project_id}/logs/retention_rules/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/logs/retention_rules/
  • 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/.

Request body

idstring uuid required

Unique identifier for this retention rule.

namestring required

User-visible label for this rule.

enabledboolean

When false, the rule is ignored by ingestion and listing UIs that show active rules only.

priorityinteger nullable

Lower numbers are evaluated first; the first matching rule wins. Omit to append after existing rules.

configunknown required
versioninteger required

Incremented on each update for worker cache coherency.

created_byinteger required
created_atstring date-time required
updated_atstring date-time nullable required

Response

idstring uuid required

Unique identifier for this retention rule.

namestring required

User-visible label for this rule.

enabledboolean

When false, the rule is ignored by ingestion and listing UIs that show active rules only.

priorityinteger nullable

Lower numbers are evaluated first; the first matching rule wins. Omit to append after existing rules.

configunknown required
versioninteger required

Incremented on each update for worker cache coherency.

created_byinteger required
created_atstring date-time required
updated_atstring date-time nullable required

Changes

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