一键导入
segment-manager
Segment CRUD, validation, and sizing operations. Use when the user wants to list, view, create, update, delete, validate, or size segments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Segment CRUD, validation, and sizing operations. Use when the user wants to list, view, create, update, delete, validate, or size segments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Copy metadata (segments, schema, flows, jobs, connections, auth) and account-level configuration (settings, per-table idconfig, field rankings) between Lytics accounts. Use when the user wants to promote changes from a sandbox account to production, sync objects between accounts, or copy an object from one account to another.
Strategic audience guidance -- helps users build the right audience for their business goal or improve an existing segment. Use when the user needs help choosing the right audience strategy, wants advice on segment design, or needs to improve an existing segment.
Create or update audience segments from natural language descriptions. Use when the user wants to build, create, or define an audience or segment from a natural language description.
Analyze what an audience looks like -- demographic breakdowns, top field values, coverage rates, and distributions. Use when the user wants to understand audience composition, view segment demographics, or analyze field coverage for a segment.
Guided flow/journey creation from business intent -- multi-step campaigns with delays, conditionals, A/B tests, and exports. Use when the user wants to create a campaign, build a journey, or design a multi-step marketing flow.
Browse and manage connections, auth providers, and integration credentials. Use when the user wants to list, view, create, or manage API connections, auth providers, or integration credentials.
| name | segment-manager |
| description | Segment CRUD, validation, and sizing operations. Use when the user wants to list, view, create, update, delete, validate, or size segments. |
| metadata | {"arguments":"action and relevant parameters -- list, get, create, update, delete, validate, size, snapshot"} |
Full segment lifecycle management -- list, get, create, update, delete, validate FilterQL, and estimate segment size.
Requires authenticated API access. See ../references/auth.md for credential resolution.
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment?table=user&kind=segment&sizes=true" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Query params: table, kind, valid, sizes
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment/${SEGMENT_ID}?sizes=true&inline=true" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Query params: sizes (include size data), inline (inline included segments)
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment/${SEGMENT_ID}/ancestors" \
-H "Authorization: ${LYTICS_API_TOKEN}"
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "Segment Name",
"slug_name": "segment_slug",
"description": "What this segment represents",
"segment_ql": "FILTER condition FROM user ALIAS segment_slug",
"kind": "segment",
"table": "user",
"is_public": true,
"tags": [],
"save_hist": true
}'
curl -s -X PUT "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment/${SEGMENT_ID}" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ ... updated fields ... }'
curl -s -X DELETE "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment/${SEGMENT_ID}" \
-H "Authorization: ${LYTICS_API_TOKEN}"
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/api/segment/validate" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: text/plain" \
-d 'FILTER AND (country = "US", visitct > 5) FROM user ALIAS test'
Returns 200 on valid, error message on invalid.
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/api/segment/size" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: text/plain" \
-d 'FILTER condition FROM user'
Body is raw FilterQL text, not JSON.
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/api/segment/${SEGMENT_ID}/size" \
-H "Authorization: ${LYTICS_API_TOKEN}"
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/api/segment/${SEGMENT_ID}/fieldinfo?limit=20&table=user" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Returns per-field analytics within a segment: value distributions, coverage rates, numeric stats, and histograms.
Query params: fields (comma-delimited), limit (default 20, max 1000), table, cached.
For detailed analysis, use the audience-snapshot skill.
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/segment/reevaluate" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"id": "segment_id"}'
Required fields for creation:
{
"name": "Display Name",
"slug_name": "url_friendly_slug",
"description": "Human-readable description",
"segment_ql": "FILTER ... FROM user ALIAS slug",
"kind": "segment",
"table": "user",
"is_public": true,
"save_hist": true
}
Optional fields:
{
"tags": ["tag1", "tag2"],
"groups": ["group_id"],
"expires_at": "2025-12-31T00:00:00Z",
"emit_trigger": false,
"schedule_exit": false
}
| Kind | Description | Use Case |
|---|---|---|
segment | Standard audience segment | General audience targeting |
aspect | Building block segment | Reusable filter components |
goal | Business objective | Conversion tracking |
list | Temporal export list | One-time or recurring exports |
conversion | Campaign tracking | Attribution measurement |
metric | Metric segment | Analytics/reporting |
managed | System-managed | Internal platform use |
candidate | Decisioning exclusion | Exclude from decisioning |
Execute immediately and display results.
Use the confirmation-gate pattern:
Before creating/updating a segment:
POST /api/segment/validatePOST /api/segment/size../references/auth.md, ../references/api-client.md, ../references/confirmation-gate.md../references/filterql-grammar.md