---
title: "POST /api/v1/config/log-retention-configs"
method: POST
path: "/api/v1/config/log-retention-configs"
tags: ["LogRetentionConfig"]
---

# POST /api/v1/config/log-retention-configs

`POST /api/v1/config/log-retention-configs`

## Request body

- Configv1CreateLogRetentionConfigRequest
  - `dry_run` boolean — If `true`, validates the specified configuration without creating the LogRetentionConfig. If the specified configuration is valid, the endpoint returns a partial response without the LogRetentionConfig. If the specified configuration is invalid, the endpoint returns an error.
  - `log_retention_config` Configv1LogRetentionConfig — LogRetentionConfig configures long-term retention policies for log data. Each config specifies a filter to match logs and retention parameters for cold storage (Iceberg). Multiple configs per tenant are supported; when configs overlap, the longest retention wins.
    - `created_at` string, date-time — Timestamp of when the LogRetentionConfig was created. Cannot be set by clients.
    - `filter` string, required — Log query filter. Only matching logs will have the retention config applied.
    - `mode` 'ENABLED' | 'DISABLED', required
    - `name` string, required — The name of the LogRetentionConfig. You can modify this value after the LogRetentionConfig is created.
    - `retention_days` integer, required — Number of days to retain matching logs in long-term (Iceberg) storage after they are exported. Once this period elapses, data is expired from Iceberg by the IcebergDeleter.
    - `slug` string, required — The unique identifier of the LogRetentionConfig. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the LogRetentionConfig is created.
    - `updated_at` string, date-time — Timestamp of when the LogRetentionConfig was last updated. Cannot be set by clients.

## Response `200`

A successful response containing the created LogRetentionConfig.

- Configv1CreateLogRetentionConfigResponse
  - `log_retention_config` Configv1LogRetentionConfig — LogRetentionConfig configures long-term retention policies for log data. Each config specifies a filter to match logs and retention parameters for cold storage (Iceberg). Multiple configs per tenant are supported; when configs overlap, the longest retention wins.
    - `created_at` string, date-time — Timestamp of when the LogRetentionConfig was created. Cannot be set by clients.
    - `filter` string, required — Log query filter. Only matching logs will have the retention config applied.
    - `mode` 'ENABLED' | 'DISABLED', required
    - `name` string, required — The name of the LogRetentionConfig. You can modify this value after the LogRetentionConfig is created.
    - `retention_days` integer, required — Number of days to retain matching logs in long-term (Iceberg) storage after they are exported. Once this period elapses, data is expired from Iceberg by the IcebergDeleter.
    - `slug` string, required — The unique identifier of the LogRetentionConfig. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the LogRetentionConfig is created.
    - `updated_at` string, date-time — Timestamp of when the LogRetentionConfig was last updated. Cannot be set by clients.

## Other responses

- `400` — Cannot create the LogRetentionConfig because the request is invalid.
- `409` — Cannot create the LogRetentionConfig because there is a conflict with an existing LogRetentionConfig.
- `500` — An unexpected error response.
- `default` — An undefined error response.

---

[API](https://skmtc.dev/chronosphere/apis/data-v1-api.md) · [All operations](https://skmtc.dev/chronosphere/apis/data-v1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/chronosphere/data-v1-api/revisions/ee91fd539ced/schema)
