Create a segment
Creates a typed cohort definition (segment). The subtype attribute controls which additional parameters are required and what the platform does next.
Subtypes:
-
filter (default) — Saves a named filter expression. Returns status: active immediately. Use filters/filter_groups for the criteria. Pass create_audience: true to also create a thin audience wrapper referencing this segment. Default: false — the segment is saved for later composition into an audience once iterative refinement is complete.
-
matched — Upload your own customer list for identity resolution. Returns status: pending + upload_url (30-minute signed upload URL) — or upload_urls (an array, one per shard) when shard_count > 1, in which case upload_url is absent. Input may be raw or gzip. With hitl unset/false (default): upload your file(s) and the platform runs column mapping and identity resolution automatically once every declared shard has been uploaded, transitioning to status: active when complete — no further calls required. With hitl: true: the upload is staged instead of resolving automatically — see the hitl field description below for the full preview/confirm/cancel sequence. When create_audience: true (default for matched), a thin audience wrapper is also created automatically.
-
similarity — Lookalike modelling. Provide seed_description (natural language ICP persona) or seed_segment_id (an existing segment) — not both — to launch a new workflow. Returns status: pending + workflow_run_id. Alternatively, provide generation_metadata_id (an existing icp_id) with no seed fields to attach that already-completed ICP run directly — no workflow is launched, status: active immediately. Default create_audience: false.
-
propensity — ML propensity scoring. Provide positive_class_segment_id (an existing segment whose members are the positive training class) to launch a new workflow. Returns status: pending + workflow_run_id. Alternatively, provide generation_metadata_id (an existing model_id) with no positive_class_segment_id to attach that already-completed model run directly — no workflow is launched, status: active immediately. Default create_audience: false.
Poll GET /v1/segments/{id} for status, or configure a webhook to receive segment.ready / segment.failed events. Requires 'creator' scope.
For filter subtype: filters/filter_groups are validated against the live Field Catalog before the segment is created — an unknown field, a disallowed operator for that field, or an invalid enum value returns 400 INVALID_FILTER. If the Field Catalog itself is temporarily unreachable, returns 502 FILTER_CATALOG_UNAVAILABLE rather than creating an unvalidated segment. record_limit on a non-filter subtype returns 400 RECORD_LIMIT_UNSUPPORTED. When create_audience is true, an unknown campaign_id returns 400 INVALID_CAMPAIGN_ID and nothing is created.
Request
- Base URL: https://api.infiniteaudience.ai
- URL: https://api.infiniteaudience.ai/v1/segments
- Auth: HTTP bearer
Request body
Response
Segment created.
Changes
No recorded changes to this operation across all 1 revision of this API.