← All action domains

Segments

9 operations. Call each with POST https://app.chirply.io/api/v1/actions/<name> and a bearer token; the response is { "data": { "action", "summary", "result" } }. A read badge means the operation changes nothing; write requires the credential’s write scope.

Create Smart Segment

segments.createwrite

Save a reusable dynamic audience definition. Exact previews are timestamped background snapshots, while an outbound campaign resolves its own guarded audience from the then-current definition. Saving sends nothing and does not copy contacts.

Parameters

FieldTypeRequiredDescription
namestringrequiredUnique human-readable segment name in this account.
descriptionstring (or null)optionalOptional explanation of what this audience represents.
match_type"all" | "any"optionalWhether every top-level condition or at least one top-level condition must match. Default: "all"
rulesobject[]requiredOne to twenty validated scalar or correlated-relationship conditions. Call segments.fields first for field, operator, filter, and option metadata.
rules[].idstringrequiredStable client-generated id unique within this rule list.
rules[].fieldstringrequiredScalar field key, custom.<key>, or relationship key advertised by segments.fields.
rules[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredScalar comparison or relationship quantifier advertised for the selected field by segments.fields.
rules[].valueobject | arrayoptionalTyped scalar comparison value. Omit for is_set/is_not_set and for relationship rules.
rules[].relation"appointment" | "stripe_subscription" | "stripe_payment" | "deal" | "task" | "message" | … 2 moreoptionalFor a relationship rule, the same relationship key supplied in field.
rules[].quantifier"exists" | "not_exists" | "count_eq" | "count_gt" | "count_gte" | "count_lt" | … 1 moreoptionalFor a relationship rule, the same quantifier supplied in operator.
rules[].countintegeroptionalNonnegative matching-row threshold, required only for a count_* relationship quantifier.
rules[].filtersobject[]optionalZero to ten predicates that must all match the same related record.
rules[].filters[].fieldstringrequiredRelation-filter key advertised by segments.fields for the selected relationship.
rules[].filters[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredComparison operator advertised for this relation filter by segments.fields.
rules[].filters[].valuestring | number | boolean | arrayoptionalTyped filter value; omit only for an operator that explicitly takes no value.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.create \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example",
    "rules": [
      {
        "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11",
        "field": "example",
        "operator": "equals"
      }
    ]
  }'
Test with your API key

Over MCP the same operation is the tool segments_create at https://app.chirply.io/api/mcp, same bearer token, same input.

Delete Smart Segment

segments.deletewriteconfirm

Permanently delete a saved Smart Segment. Contacts are never deleted. The database refuses deletion while any campaign still includes or excludes the segment so a draft audience cannot silently expand.

Marked confirm: this operation is irreversible, reaches real people, or spends money. Holding a credential is itself the confirmation for API and MCP callers — call it only when you mean it. The in-app assistant refuses to run it without a human approving first.

Parameters

FieldTypeRequiredDescription
idstring (uuid)requiredSmart Segment id to permanently delete.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.delete \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11"
  }'
Test with your API key

Over MCP the same operation is the tool segments_delete at https://app.chirply.io/api/mcp, same bearer token, same input.

List Smart Segment fields

segments.fieldsread

List every Smart Segment scalar field and correlated relationship, its supported operators and filters, the account's custom contact fields, and current tenant-scoped choices such as tags, lists, pipelines, team members, forms, Stripe accounts, and Stripe products. Read-only and performs no provider calls.

Parameters

No parameters — POST an empty body.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.fields \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{}'
Test with your API key

Over MCP the same operation is the tool segments_fields at https://app.chirply.io/api/mcp, same bearer token, same input.

View Smart Segment

segments.getread

Get one saved Smart Segment and its complete rule definition. This reads the saved configuration and does not evaluate contacts.

Parameters

FieldTypeRequiredDescription
idstring (uuid)requiredThe Smart Segment id to retrieve.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.get \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11"
  }'
Test with your API key

Over MCP the same operation is the tool segments_get at https://app.chirply.io/api/mcp, same bearer token, same input.

Check audience preview

segments.get_evaluationread

Read the durable progress or exact final result of a Smart Segment evaluation started by segments.preview or segments.refresh. Preparing results never expose a partial count as final; ready results return the exact count and at most five deterministic sample contact ids. Reads only and sends nothing.

Parameters

FieldTypeRequiredDescription
evaluation_idstring (uuid)requiredEvaluation id returned by segments.preview or segments.refresh.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.get_evaluation \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "evaluation_id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11"
  }'
Test with your API key

Over MCP the same operation is the tool segments_get_evaluation at https://app.chirply.io/api/mcp, same bearer token, same input.

List Smart Segments

segments.listread

List the organization's saved Smart Segments, including their complete validated rule definitions and last successful display-only count metadata. This does not evaluate membership.

Parameters

FieldTypeRequiredDescription
limitintegeroptionalMax rows to return (1–100). Default: 25
offsetintegeroptionalRows to skip. Default: 0
querystringoptionalText to match in the segment name or description.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.list \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 25,
    "offset": 0
  }'
Test with your API key

Over MCP the same operation is the tool segments_list at https://app.chirply.io/api/mcp, same bearer token, same input.

Preview audience

segments.previewread

Validate unsaved Smart Segment conditions and start a tenant-scoped, exact background evaluation. Large accounts return a preparing status and durable evaluation id for segments.get_evaluation; a final count and up to five sample contact ids appear only after concurrent CRM changes are reconciled. Reads only and sends nothing.

Parameters

FieldTypeRequiredDescription
match_type"all" | "any"optionalWhether every top-level condition or at least one top-level condition must match. Default: "all"
rulesobject[]requiredOne to twenty validated scalar or correlated-relationship conditions. Call segments.fields first for field, operator, filter, and option metadata.
rules[].idstringrequiredStable client-generated id unique within this rule list.
rules[].fieldstringrequiredScalar field key, custom.<key>, or relationship key advertised by segments.fields.
rules[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredScalar comparison or relationship quantifier advertised for the selected field by segments.fields.
rules[].valueobject | arrayoptionalTyped scalar comparison value. Omit for is_set/is_not_set and for relationship rules.
rules[].relation"appointment" | "stripe_subscription" | "stripe_payment" | "deal" | "task" | "message" | … 2 moreoptionalFor a relationship rule, the same relationship key supplied in field.
rules[].quantifier"exists" | "not_exists" | "count_eq" | "count_gt" | "count_gte" | "count_lt" | … 1 moreoptionalFor a relationship rule, the same quantifier supplied in operator.
rules[].countintegeroptionalNonnegative matching-row threshold, required only for a count_* relationship quantifier.
rules[].filtersobject[]optionalZero to ten predicates that must all match the same related record.
rules[].filters[].fieldstringrequiredRelation-filter key advertised by segments.fields for the selected relationship.
rules[].filters[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredComparison operator advertised for this relation filter by segments.fields.
rules[].filters[].valuestring | number | boolean | arrayoptionalTyped filter value; omit only for an operator that explicitly takes no value.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.preview \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": [
      {
        "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11",
        "field": "example",
        "operator": "equals"
      }
    ]
  }'
Test with your API key

Over MCP the same operation is the tool segments_preview at https://app.chirply.io/api/mcp, same bearer token, same input.

Refresh Smart Segment count

segments.refreshread

Start or deduplicate an exact background evaluation of one saved Smart Segment's current definition. The saved display count is published only if the definition and tenant configuration remain unchanged through final reconciliation. Sends nothing and does not alter contacts.

Parameters

FieldTypeRequiredDescription
idstring (uuid)requiredSaved Smart Segment id to evaluate.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.refresh \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11"
  }'
Test with your API key

Over MCP the same operation is the tool segments_refresh at https://app.chirply.io/api/mcp, same bearer token, same input.

Save changes

segments.updatewrite

Replace a Smart Segment's name, description, matching mode, and complete validated rule set. Prior preview counts become historical, future evaluations use the new definition, and already-enrolled campaign recipients do not change.

Parameters

FieldTypeRequiredDescription
idstring (uuid)requiredSmart Segment id to update.
namestringrequiredUnique human-readable segment name in this account.
descriptionstring (or null)optionalOptional explanation of what this audience represents.
match_type"all" | "any"requiredWhether every top-level condition or at least one top-level condition must match.
rulesobject[]requiredOne to twenty validated scalar or correlated-relationship conditions. Call segments.fields first for field, operator, filter, and option metadata.
rules[].idstringrequiredStable client-generated id unique within this rule list.
rules[].fieldstringrequiredScalar field key, custom.<key>, or relationship key advertised by segments.fields.
rules[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredScalar comparison or relationship quantifier advertised for the selected field by segments.fields.
rules[].valueobject | arrayoptionalTyped scalar comparison value. Omit for is_set/is_not_set and for relationship rules.
rules[].relation"appointment" | "stripe_subscription" | "stripe_payment" | "deal" | "task" | "message" | … 2 moreoptionalFor a relationship rule, the same relationship key supplied in field.
rules[].quantifier"exists" | "not_exists" | "count_eq" | "count_gt" | "count_gte" | "count_lt" | … 1 moreoptionalFor a relationship rule, the same quantifier supplied in operator.
rules[].countintegeroptionalNonnegative matching-row threshold, required only for a count_* relationship quantifier.
rules[].filtersobject[]optionalZero to ten predicates that must all match the same related record.
rules[].filters[].fieldstringrequiredRelation-filter key advertised by segments.fields for the selected relationship.
rules[].filters[].operator"equals" | "not_equals" | "contains" | "not_contains" | "greater_than" | "greater_or_equal" | … 19 morerequiredComparison operator advertised for this relation filter by segments.fields.
rules[].filters[].valuestring | number | boolean | arrayoptionalTyped filter value; omit only for an operator that explicitly takes no value.

Example

curl -X POST https://app.chirply.io/api/v1/actions/segments.update \
  -H "Authorization: Bearer chp_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11",
    "name": "Example",
    "match_type": "all",
    "rules": [
      {
        "id": "2f6a1c1e-6c3b-4c62-9f6e-8a2d4b7c9e11",
        "field": "example",
        "operator": "equals"
      }
    ]
  }'
Test with your API key

Over MCP the same operation is the tool segments_update at https://app.chirply.io/api/mcp, same bearer token, same input.

The machine-readable version of this page is GET https://app.chirply.io/api/v1/actions?domain=segments — same operations, with full JSON Schemas. Authentication, errors and rate limits are covered in the API documentation home.