ICP / GTM / TypeScript SDK

Create segment

Generate GTM buyer segments from company context using the workspace's BYOK LLM and persist them as draft segments. Set regenerate=true to replace existing drafts instead of appending.

pipeline.createSegmentBackend AI, consent required

Parameters

workspaceIdRequired · string
See the input schema for this field.
countOptional · number
Segments to generate, clamped 3-8. Defaults to 5.
regenerateOptional · boolean
Replace existing draft segments instead of appending.
contextOptional · object
See the input schema for this field.
allowHostedAiOptional · boolean
Must be true when this operation uses Pipeline hosted inference.
Request example
await pipeline.createSegment({
  "workspaceId": "00000000-0000-4000-8000-000000000000",
  "allowHostedAi": true
})
Full input schema
Input schema
{
  "type": "object",
  "properties": {
    "workspaceId": {
      "type": "string"
    },
    "count": {
      "type": "number",
      "description": "Segments to generate, clamped 3-8. Defaults to 5."
    },
    "regenerate": {
      "type": "boolean",
      "description": "Replace existing draft segments instead of appending."
    },
    "context": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string"
        },
        "domain": {
          "type": "string"
        },
        "serviceDescription": {
          "type": "string"
        },
        "icpSummary": {
          "type": "string"
        },
        "targetTitles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "targetIndustries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "competitors": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "domain": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          }
        }
      }
    },
    "allowHostedAi": {
      "type": "boolean",
      "description": "Must be true when this operation uses Pipeline hosted inference."
    }
  },
  "required": [
    "workspaceId"
  ]
}
See this operation inCLI MCP REST API
TypeScript SDK | Pipeline v2 preview