---
title: "convert_segment_rule"
method: POST
path: "/api/util/convert_segment_rule"
tags: ["Util"]
---

# convert_segment_rule

`POST /api/util/convert_segment_rule`

## Request body

- object
  - `name` string, required
  - `description` string, required
  - `parent_segment_id` string
  - `simplifiedIonRule` union, required
    - object
      - `title` string, required
      - `summary` string, required
      - `conditions` object[], required
        - `attribute_column` string — Column name to filter on (alternative to left_value)
        - `operator` '=' | '!=' | '>' | '>=' | '<' | '<=' | 'IS NULL' | 'IS NOT NULL' | 'IN' | 'BETWEEN' | 'REGEX' | 'NOT REGEX', nullable — Comparison operator
        - `right_value` union — Value to compare against (optional, not needed for IS NULL/IS NOT NULL operators)
          - string
          - number
          - boolean
          - union[]
            - union
              - …
          - object
        - `reason` string, nullable — Human-readable explanation for this condition
        - `left_value` string, nullable — Column name to filter on (alternative to attribute_column)
        - `logic` 'ALL' | 'ANY', nullable — Logic operator for nested conditions
        - `conditions` object[], nullable — Nested conditions array
          - `left_value` string, required
          - `operator` '=' | '!=' | '>' | '>=' | '<' | '<=' | 'IS NULL' | 'IS NOT NULL' | 'IN' | 'BETWEEN' | 'REGEX' | 'NOT REGEX', required
          - `right_value` union, required
            - integer
            - string
          - `reason` string, required
      - `logic` string
      - `baseSegmentIds` object
        - `logic` 'ALL' | 'ANY', required
        - `segment_ids` string[]
        - `segmentIds` string[], required
    - object
      - `title` string, required
      - `summary` string, required
      - `conditions` object[]
        - `attribute_column` string — Column name to filter on (alternative to left_value)
        - `operator` '=' | '!=' | '>' | '>=' | '<' | '<=' | 'IS NULL' | 'IS NOT NULL' | 'IN' | 'BETWEEN' | 'REGEX' | 'NOT REGEX', nullable — Comparison operator
        - `right_value` union — Value to compare against (optional, not needed for IS NULL/IS NOT NULL operators)
          - string
          - number
          - boolean
          - union[]
            - union
              - …
          - object
        - `reason` string, nullable — Human-readable explanation for this condition
        - `left_value` string, nullable — Column name to filter on (alternative to attribute_column)
        - `logic` 'ALL' | 'ANY', nullable — Logic operator for nested conditions
        - `conditions` object[], nullable — Nested conditions array
          - `left_value` string, required
          - `operator` '=' | '!=' | '>' | '>=' | '<' | '<=' | 'IS NULL' | 'IS NOT NULL' | 'IN' | 'BETWEEN' | 'REGEX' | 'NOT REGEX', required
          - `right_value` union, required
            - integer
            - string
          - `reason` string, required
      - `logic` string
      - `baseSegmentIds` object, required
        - `logic` 'ALL' | 'ANY', required
        - `segment_ids` string[]
        - `segmentIds` string[], required

## Response `200`

creates a rule with only base segment references using AND logic

- object
  - `name` string, required
  - `description` string, required
  - `fullIonRule` object, required
    - `conditions` object[], required
      - `conditions` object[], required
        - `arrayMatching` unknown
        - `exclude` boolean, required
        - `leftValue` object, nullable
          - `name` string, required
        - `operator` object, nullable
          - `type` string, required
          - `not` boolean, required
          - `rightValue` union, required
            - number, float
            - integer
        - `type` string, required
        - `id` string, nullable
      - `type` string, required
    - `type` string, required

## Other responses

- `400` — Bad request - invalid input parameters
- `422` — Validation error - invalid or missing parameters

---

[API](https://skmtc.net/treasure/apis/llm-api.md) · [All operations](https://skmtc.net/treasure/apis/llm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/treasure/llm-api/revisions/56f275763358/schema)
