{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/leadboxer-com/json-schema/leadboxer-com-create-segment-request-schema.json",
  "title": "CreateSegmentRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/leadboxer-com-api-openapi.yml#/components/schemas/CreateSegmentRequest",
  "required": [
    "accountId",
    "datasetId",
    "name",
    "type"
  ],
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Segment name."
    },
    "accountId": {
      "type": "string",
      "description": "Leadboxer accountId."
    },
    "datasetId": {
      "type": "string",
      "description": "The dataset for which to create segment."
    },
    "type": {
      "type": "string",
      "description": "Defines the visibility of the segment.<br/><br/><b>Possible values:</b><br/><b>USER</b> – Visible only to the current user.<br/><b>ACCOUNT</b> – Shared with all users of the account.",
      "enum": [
        "USER",
        "ACCOUNT"
      ]
    },
    "textFilter": {
      "type": "string",
      "description": "Text-based filter expression used to filter result fields.Format: field|operator|value. Multiple filters are comma-separated."
    },
    "numberFilter": {
      "type": "string",
      "description": "Numeric filter expression used to filter results based on numeric fields. Format: field|operator|value. Multiple filters are comma-separated. Supported numeric operators include greaterthan, lessthan, is, isnot, between, and notbetween. The between and notbetween operators use the format min-max."
    },
    "timeFilter": {
      "type": "string",
      "description": "Time-based filter expression used to filter results by time field. Format: field|operator|value.\n\nAllowed fields (same as `timeField` parameter):\n- eventEsTimestamp : Last Seen\n- first_session_unix_timestamp : First Seen\n\nSupported operators:\n- exactly   → integer value (0 = Today, 1 = Yesterday)\n- lessthan  → integer value (e.g. 6 = last 7 days)\n- between   → date range in format dd/MM/yyyy-dd/MM/yyyy\n\nLocale settings are taken into account while interpreting dates and returning results."
    },
    "fieldFilter": {
      "type": "string",
      "description": "Field-based filter used to include leads based on field presence.\n\nFormat:\noperator|field1;field2\n\nAllowed operator:\n- hasanyvalue\n\nAllowed fields:\n- firstName\n- lastName\n- email\n\nMultiple fields can be provided using semicolons."
    },
    "exitLinkFilter": {
      "type": "string",
      "description": "Exit link filter used to include or exclude leads based on exit link values.\n\nFormat:\nfield|operator|value\n\nSupported operators:\n- contains\n- is\n- isnot\n- doesnotcontain\n\nMultiple values can be provided using semicolons."
    },
    "leadscoreFilter": {
      "maximum": 100,
      "minimum": 0,
      "type": "integer",
      "description": "Filters leads based on given minimum leadscore.",
      "format": "int32"
    },
    "displayFilter": {
      "type": "string",
      "description": "Display filter used to control which types of leads are returned.\n\nSupported values:\n- company\n- person\n- unidentified\n\nSelecting 'unidentified' returns leads that could not be identified as a company or a person.\n\nMultiple values can be provided using semicolons."
    },
    "fromFilter": {
      "type": "string",
      "description": "Filters leads based on specified from user"
    },
    "owner": {
      "type": "string",
      "description": "Filters leads based specified owner(userId)"
    },
    "hidden": {
      "type": "string",
      "description": "Filters leads based on presetInclusionList"
    },
    "search": {
      "type": "string",
      "description": "Keyword search."
    },
    "emailView": {
      "type": "string",
      "description": "Email view type.<br/>Possible values : NONE, LEAD, ACCOUNT<br/>",
      "default": "NONE",
      "enum": [
        "NONE",
        "LEAD",
        "ACCOUNT"
      ]
    },
    "notificationType": {
      "type": "string",
      "description": "Set notification frequency.<br/><br/><b>Possible values:</b><br/><b>NONE</b> : Do not send any notification.<br/><b>DAILY</b> : Send notification daily.<br/><b>WEEKLY</b> : Send notification weekly.",
      "enum": [
        "NONE",
        "DAILY",
        "WEEKLY"
      ]
    },
    "notificationMailIds": {
      "type": "string",
      "description": "List of comma separated email addresses for notification."
    },
    "mailTemplate": {
      "type": "string",
      "description": "Set headlines for the notification email."
    },
    "format": {
      "type": "string",
      "description": "Format for the segment notification.<br/>Possible values : html, csv"
    },
    "dayOfWeek": {
      "type": "integer",
      "description": "Day of week on which weekly notification will be sent. Possible values include numbers from 1 to 7 (where 1 refers to Monday).",
      "format": "int32"
    },
    "additionalCsvFields": {
      "type": "string",
      "description": "List of comma separated fields to be included in CSV."
    },
    "sortBy": {
      "type": "string",
      "description": "Field to sort result.<br/>Possible values :<br/><b>_score</b> : records sorted by leadscore.<br/><b>lastEvent</b> : records sorted by activity time.<br/>Default : _score"
    },
    "sortOrder": {
      "type": "string",
      "description": "Sort order.<br/>Possible values : asc, desc<br/>Default : desc"
    },
    "viewType": {
      "type": "string",
      "description": "View type.<br/>Possible values : B2B, B2C<br/>Default : B2B"
    },
    "list": {
      "type": "string",
      "description": "Filters list file saved using List Settings Page."
    },
    "timeField": {
      "type": "string"
    },
    "csvSetName": {
      "type": "string"
    }
  }
}