{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customer-io/json-schema/customer-io-segment-response-object-schema.json",
  "title": "segmentResponseObject",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customer-io-segments-api-openapi.yml#/components/schemas/segmentResponseObject",
  "x-scalar-ignore": true,
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/segment_id"
    },
    "deduplicate_id": {
      "$ref": "#/$defs/deduplicate_id"
    },
    "name": {
      "$ref": "#/$defs/segment_name"
    },
    "description": {
      "$ref": "#/$defs/segment_description"
    },
    "state": {
      "type": "string",
      "description": "The segment's build state. The state is `build` while Customer.io calculates who belongs to the segment, and `finished` when membership is up to date.",
      "enum": [
        "build",
        "finished"
      ]
    },
    "progress": {
      "type": [
        "number",
        "null"
      ],
      "description": "Customer.io returns `0` while the segment is in the `build` state and `null` when it's `finished`. This field doesn't report partial progress, so use `state` to tell whether the segment is still building."
    },
    "type": {
      "type": "string",
      "description": "The type of segment.",
      "enum": [
        "dynamic",
        "manual"
      ]
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "description": "The tags assigned to the segment, if any. Tags may help you sort through your segments.",
      "items": {
        "type": "string"
      }
    },
    "conditions": {
      "type": "object",
      "description": "The conditions that determine who belongs to the segment, as a tree of nested `and` and `or` groups. Customer.io includes this object for data-driven segments and omits it for manual segments, which don't have conditions. A profile attribute condition appears as an `attribute_change` event with a `to` filter and an inverted `from` filter, and filter values are always strings, even for numeric or boolean attributes.",
      "additionalProperties": true
    },
    "created_at": {
      "$ref": "#/$defs/created"
    },
    "updated_at": {
      "$ref": "#/$defs/updated"
    }
  },
  "$defs": {
    "created": {
      "x-scalar-ignore": true,
      "type": "integer",
      "format": "unix timestamp",
      "description": "The date time when the referenced ID was created.",
      "readOnly": true
    },
    "deduplicate_id": {
      "x-scalar-ignore": true,
      "type": "string",
      "readOnly": true,
      "description": "An identifier in the format `id:timestamp` where the id is for the object you're working with (Automations, Deliveries, Exports, Identities, One-time sends, Segments, and Templates), and the timestamp is the last time the object was updated."
    },
    "segment_description": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "A description for the segment. This can help you understand the purpose of the segment when you encounter it in other requests or in the UI."
    },
    "segment_id": {
      "x-scalar-ignore": true,
      "type": "integer",
      "description": "The identifier for a segment; used to target a segment in requests."
    },
    "segment_name": {
      "x-scalar-ignore": true,
      "type": "string",
      "description": "The name of the segment."
    },
    "updated": {
      "x-scalar-ignore": true,
      "type": "integer",
      "format": "unix timestamp",
      "description": "The date time when the referenced ID was last updated.",
      "readOnly": true
    }
  }
}