---
title: "Create a new transformation rule."
method: POST
path: "/v1/transformationRules"
tags: ["transformationRuleManagement"]
---

# Create a new transformation rule.

`POST /v1/transformationRules`

Create a new transformation rule.

## Request body

- TransformationRuleRequest — A request for creating or updating a transformation rule.
  - `ruleDefinition` TransformationRuleDefinition, required — The properties that define a transformation rule.
    - `name` string, required — Name of the transformation rule.
    - `selector` string, required — Selector of the transformation rule.
    - `dimensionTransformations` DimensionTransformation[] — Dimension transformations of the transformation rule.
      - `transformationType` string, required — This is the base type of all dimension transformations.
    - `transformedMetricsRetention` integer — Retention period in days for the transformed metrics that are generated by this rule. The supported retention periods for transformed metrics are 8 days, and 400 days. If no dimension transformations are defined, this value will be set to 0.
    - `retention` integer, required — Retention period in days for the metrics that are selected by the selector. The supported retention periods for selected metrics are 8 days, 400 days, and 0 (Do not store) if this rule contains dimension transformation.
  - `enabled` boolean, required — True if the rule is enabled.

## Response `200`

The transformation rule was successfully created.

- TransformationRuleResponse — A request for creating or updating a transformation rule.
  - `ruleDefinition` TransformationRuleDefinition, required — The properties that define a transformation rule.
    - `name` string, required — Name of the transformation rule.
    - `selector` string, required — Selector of the transformation rule.
    - `dimensionTransformations` DimensionTransformation[] — Dimension transformations of the transformation rule.
      - `transformationType` string, required — This is the base type of all dimension transformations.
    - `transformedMetricsRetention` integer — Retention period in days for the transformed metrics that are generated by this rule. The supported retention periods for transformed metrics are 8 days, and 400 days. If no dimension transformations are defined, this value will be set to 0.
    - `retention` integer, required — Retention period in days for the metrics that are selected by the selector. The supported retention periods for selected metrics are 8 days, 400 days, and 0 (Do not store) if this rule contains dimension transformation.
  - `enabled` boolean, required — True if the rule is enabled.
  - `createdAt` string, date-time, required — Creation timestamp in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
  - `createdBy` string, required — Identifier of the user who created the resource.
  - `modifiedAt` string, date-time, required — Last modification timestamp in UTC.
  - `modifiedBy` string, required — Identifier of the user who last modified the resource.
  - `id` string, required — Unique identifier for the transformation rule.

## Other responses

- `default` — The operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/revisions/18a824df1e78/schema)
