---
title: "Create Segment Config"
method: POST
path: "/data-quality/v1/segment/configs"
tags: ["Segment"]
---

# Create Segment Config

`POST /data-quality/v1/segment/configs`

## Request

- Base URL: `https://api.zoominfo.com/gtm`
- URL: `https://api.zoominfo.com/gtm/data-quality/v1/segment/configs`
- Auth: OAuth 2
  - Authorization code: `https://login.zoominfo.com`
  - Token URL: `https://okta-login.zoominfo.com/oauth2/default/v1/token` scopes: `api:data-quality:manage`

Creates a new segment configuration — the definition of how records get sorted into
buckets.

A saved config is required before you can segment anything: Run Segmentation takes
`configIds` and has no inline path, so create the definition here first and reference the
returned `id` on every run.

A config is an ordered list of `segments[]`. Each segment carries the `rules[]` that decide
whether a record belongs to it and the `outputValue` returned when it does. Array position
sets each segment's order, and `action` decides what that order means: `FIND_FIRST` returns
the earliest match, `FIND_LAST` the latest, `FIND_ALL` every match joined by
`mergeOperator`, and `ADD_ALL` the sum of the matching numeric values.

Provide `name`, `action`, and the ordered `segments[]`. `mergeOperator` is optional, applies
only when `action` is `FIND_ALL`, and defaults to `,`.

Server-assigned fields — `id`, per-segment `order`, `fieldsUsedInRules`, and timestamps —
are ignored on input and returned in the response. `fieldsUsedInRules` is derived from the
rules you supply; it is not something you set.

Returns `201` with the created segment config. Returns `400` if the payload is malformed —
for example an unknown `action`, a rule missing its `field`, or a segment missing its
`outputValue`.

This endpoint does not consume credits.

## Request body

- SegmentConfigJsonApiModelCreate: JSON API model for a single segment config.
  - `data` SegmentConfigCreate, required: A segment configuration resource (identity, action, and full segment/rule definitions).
    - `type` string, required: The type of the resource
    - `attributes` SegmentConfigAttributes, required: Full attributes of a segment configuration.
      - `name` string, required: Display name for the segment config.
      - `action` 'FIND_FIRST' | 'FIND_LAST' | 'FIND_ALL' | 'ADD_ALL', required: How multiple segments match the same record.
      - `mergeOperator` string: Delimiter used to join matched output values when `action` is `FIND_ALL`. Common values: `,` (default), `, `, `;`, `|`, `-`, newline, or tab. Any short string is accepted, so this is a free-form delimiter rather than a fixed enum.
      - `segments` Segment[], required: Ordered list of segments defined in this config.
        - `label` string, required: Display label for this segment.
        - `outputValue` string, required: Value written to the output field on the record when this segment matches.
        - `order` integer, required: Server-assigned priority order of this segment within the config (0-based, lower = higher priority).
        - `rules` SegmentRule[], required: Ordered list of rules that must be satisfied for this segment to match.
          - `operator` 'TEXT_EQUALS' | 'TEXT_NOT_EQUALS' | 'TEXT_CONTAINS' | 'TEXT_CONTAINS_WORD' | 'TEXT_NOT_CONTAINS' | 'TEXT_NOT_CONTAINS_WORD' | 'TEXT_STARTS' | 'TEXT_NOT_STARTS' | 'TEXT_ENDS' | 'TEXT_NOT_ENDS' | 'NUM_EQUALS' | 'NUM_MORE' | 'NUM_LESS' | 'NUM_BETWEEN' | 'NUM_GREATER_OR_EQUALS' | 'NUM_LESS_OR_EQUALS' | 'BOOL_TRUE' | 'BOOL_FALSE' | 'IS_NULL' | 'IS_NOT_NULL' | 'DIVIDER', required: Comparison operator for a segment rule.
          - `field` string: Field name to evaluate. Absent for divider operators that separate rule groups.
          - `value` string[]: Values to compare the field against. Treated as an OR-list for most operators.
      - `fieldsUsedInRules` string[], required: Distinct field names referenced by this config's segment rules, sorted alphabetically. Divider rules contribute no field. Read-only; derived from `segments[].rules[].field`.

## Response `201`

Created

- SegmentConfigJsonApiModel: JSON API model for a single segment config.
  - `data` SegmentConfig, required: A segment configuration resource (identity, action, and full segment/rule definitions).
    - `id` string, required: The unique identifier for the resource
    - `type` string, required: The type of the resource
    - `attributes` SegmentConfigAttributes, required: Full attributes of a segment configuration.
      - `name` string, required: Display name for the segment config.
      - `action` 'FIND_FIRST' | 'FIND_LAST' | 'FIND_ALL' | 'ADD_ALL', required: How multiple segments match the same record.
      - `mergeOperator` string: Delimiter used to join matched output values when `action` is `FIND_ALL`. Common values: `,` (default), `, `, `;`, `|`, `-`, newline, or tab. Any short string is accepted, so this is a free-form delimiter rather than a fixed enum.
      - `segments` Segment[], required: Ordered list of segments defined in this config.
        - `label` string, required: Display label for this segment.
        - `outputValue` string, required: Value written to the output field on the record when this segment matches.
        - `order` integer, required: Server-assigned priority order of this segment within the config (0-based, lower = higher priority).
        - `rules` SegmentRule[], required: Ordered list of rules that must be satisfied for this segment to match.
          - `operator` 'TEXT_EQUALS' | 'TEXT_NOT_EQUALS' | 'TEXT_CONTAINS' | 'TEXT_CONTAINS_WORD' | 'TEXT_NOT_CONTAINS' | 'TEXT_NOT_CONTAINS_WORD' | 'TEXT_STARTS' | 'TEXT_NOT_STARTS' | 'TEXT_ENDS' | 'TEXT_NOT_ENDS' | 'NUM_EQUALS' | 'NUM_MORE' | 'NUM_LESS' | 'NUM_BETWEEN' | 'NUM_GREATER_OR_EQUALS' | 'NUM_LESS_OR_EQUALS' | 'BOOL_TRUE' | 'BOOL_FALSE' | 'IS_NULL' | 'IS_NOT_NULL' | 'DIVIDER', required: Comparison operator for a segment rule.
          - `field` string: Field name to evaluate. Absent for divider operators that separate rule groups.
          - `value` string[]: Values to compare the field against. Treated as an OR-list for most operators.
      - `fieldsUsedInRules` string[], required: Distinct field names referenced by this config's segment rules, sorted alphabetically. Divider rules contribute no field. Read-only; derived from `segments[].rules[].field`.
    - `meta` SegmentConfigMeta: Non-standard metadata for a segment config.
      - `createdAt` string, date-time, required: ISO 8601 timestamp at which this segment config was created.
      - `updatedAt` string, date-time, required: ISO 8601 timestamp at which this segment config was last updated.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests

---

[API](https://skmtc.dev/zoominfo/apis/data-quality-api-v1.md) - [All operations](https://skmtc.dev/zoominfo/apis/data-quality-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/zoominfo/apis/data-quality-api-v1/revisions/7229ed1f3b09?raw)
