CRM

Save a segment

crm_save_segment · Changes data · Markdown

Saves filters under a name, so the same list can be pulled again and stays up to date.

$0.001 a call

From your agent’s balance. A call that fails costs nothing.

An example

Save a list of our trade customers that keeps itself up to date, so I can pull it any time.

Your agent callscrm_save_segment$0.001 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "object": "contact",
  "name": "Trade customers",
  "sort": "name",
  "filters": [
    {
      "field": "tag",
      "op": "eq",
      "value": "trade"
    },
    {
      "field": "lifecycle_stage",
      "op": "eq",
      "value": "customer"
    }
  ]
}
What comes back
{
  "segment": {
    "id": 4102,
    "object": "contact",
    "name": "Trade customers",
    "filters": [
      {
        "field": "tag",
        "op": "eq",
        "value": "trade"
      },
      {
        "field": "lifecycle_stage",
        "op": "eq",
        "value": "customer"
      }
    ],
    "sort": "name",
    "updated_at": "2026-10-14T08:00:00+00:00",
    "count": 1
  },
  "created": true
}

Use it when

The owner will want the same list again: trade customers, renewals due, stalled deals.

What it does

Save filters under a name, such as "customers renewing within 30 days" (a new name creates a segment, an existing one replaces its filters). Use it with the segment argument of crm_find_contacts, crm_find_companies, crm_find_deals and crm_export. Relative dates (today+30) are worked out each time.

What comes back

The segment with its object, name, filters, sort and how many records match now, and created. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
objectRequiredstringOne of: contact,company,deal.
nameRequiredstring1 to 80 characters.
filtersRequiredarray of objectsConditions that must all match, e.g. [{"field": "lifecycle_stage", "op": "eq", "value": "customer"}, {"field": "renewal_date", "op": "lte", "value": "today+30"}]. field: a standard field, "tag", or a custom field key (crm_list_fields lists them all). op: eq, ne, contains, starts_with, in (value is a list), gt, gte, lt, lte, is_empty, is_set. Dates take YYYY-MM-DD or today, today+N, today-N. 1 to 20 items.
filters[].fieldRequiredstring1 to 60 characters.
filters[].opRequiredstringOne of: contains,eq,gt,gte,in,is_empty,is_set,lt,lte,ne,starts_with.
filters[].valueanyText, a number, true/false, a date, or a list for "in".
sortstringDefault sort, e.g. "-amount". Up to 61 characters.

The call

Over MCP, call crm_save_segment on https://api.conecto.chat/mcp/crm. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/crm_save_segment \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"object":"contact","name":"Trade customers","sort":"name","filters":[{"field":"tag","op":"eq","value":"trade"},{"field":"lifecycle_stage","op":"eq","value":"customer"}]}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
invalid_input400A filter or the sort names a field the object does not have, uses an op that does not fit the field, or compares it with the wrong kind of value.Check the fields with crm_list_fields and use one of the ops the message lists.
limit_reached409The business has as many segments as it may.Delete one it no longer needs with crm_delete_segment.
conflict409Another call saved the same record at the same moment.Call again: it will update the record that now exists.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md