Skip to content

Segments ​

A segment is a dynamic group of contacts. Segments are defined by conditions, and their members are worked out each time you query them.

The segment object ​

json
{
  "id": 3,
  "name": "French CTOs",
  "description": null,
  "conditions": [
    { "field": "custom_fields.country", "operator": "equals", "value": "FR" },
    { "field": "email", "operator": "ends_with", "value": ".fr", "connector": "or" }
  ],
  "contacts_count": 87,
  "created_at": "2026-02-01T10:00:00.000000Z",
  "updated_at": "2026-02-01T10:00:00.000000Z"
}

Endpoints ​

MethodPathPermissionDescription
GET/segmentssegments:readList segments (paginated). Query: search
POST/segmentssegments:writeCreate a segment
GET/segments/{id}segments:readGet a segment
PUT/segments/{id}segments:writeUpdate a segment (partial)
DELETE/segments/{id}segments:writeDelete a segment. Returns 204.
GET/segments/{id}/contactssegments:readContacts that match (paginated)
GET/segments/{id}/previewsegments:readNumber of matches and a sample of 5 contacts

List segments ​

GET /segments

Returns segments from the token workspace. Results default to created_at desc, then id desc. Invalid query values return 422.

QueryTypeDescription
pageintegerPage number, minimum 1, default 1.
per_pageintegerSegments per page, from 1 to 100, default 15.
searchstringPartial search over name and description. Every term must match; at most six terms are used.
match_typeenumall or any.
sortenumcreated_at, updated_at, name, or match_type.
directionenumasc or desc. Default desc.
bash
curl --get https://app.beeving.com/api/v1/segments \
  -H "Authorization: Bearer TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode "search=French CTO" \
  --data-urlencode "match_type=all" \
  --data-urlencode "sort=name" \
  --data-urlencode "direction=asc"

List contacts in a segment ​

GET /segments/{id}/contacts

The parent segment and generated contact query are both restricted to the token workspace. A segment from another workspace returns 404.

QueryTypeDescription
page, per_pageintegerPage defaults to 1. Page size is from 1 to 100 and defaults to 15.
searchstringPartial contact search over identity, name, job title and linked company.
statusenumactive, unsubscribed, bounced, or complained.
lifecycle_stageenumsubscriber, lead, marketing_qualified_lead, sales_qualified_lead, opportunity, customer, evangelist, or other.
company_id, list_id, tag_idintegerFurther restrict matches to a workspace company, list or tag. A foreign ID returns 422.
has_email, has_linkedin, has_companyboolean1 requires the value or relation; 0 requires it to be absent.
sortenumcreated_at, updated_at, first_name, last_name, email, linkedin_url, job_title, status, or lifecycle_stage.
directionenumasc or desc. Default desc.
bash
curl --get https://app.beeving.com/api/v1/segments/3/contacts \
  -H "Authorization: Bearer TOKEN" \
  -H "Accept: application/json" \
  --data-urlencode "lifecycle_stage=lead" \
  --data-urlencode "has_email=1" \
  --data-urlencode "sort=first_name" \
  --data-urlencode "direction=asc"

Both listing responses contain data, navigation URLs in links, and meta with current_page, last_page, per_page, total, and count for the current page.

Create a segment ​

POST /segments
FieldTypeRules
namestringRequired. Max 255 characters
descriptionstringMax 1000 characters
match_typeenumRequired. all (AND) or any (OR)
conditionsarrayRequired. 1 to 20 conditions
conditions.*.fieldstringContact fields such as email, linkedin_url, lifecycle_stage, status, created_at; relationships company_id, tag_id, list_id; or custom_fields.<key> for a relational custom field
conditions.*.operatorenumSee the table below
conditions.*.valuestringMax 500 characters. Leave it out for is_empty and is_not_empty
conditions.*.connectorenumand or or. Overrides match_type for this condition and is ignored on the first condition
OperatorMeaning
equals / not_equalsExact match
contains / not_containsSubstring
starts_with / ends_withPrefix or suffix
is_empty / is_not_emptyEmpty or filled
greater_than / less_thanComparison, for dates and numbers
bash
curl -X POST https://app.beeving.com/api/v1/segments \
  -H "Authorization: Bearer TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Active Gmail users",
    "match_type": "all",
    "conditions": [
      { "field": "status", "operator": "equals", "value": "active" },
      { "field": "email", "operator": "ends_with", "value": "@gmail.com" }
    ]
  }'

201: { "data": Segment }

Update ​

PUT /segments/{id} is partial: send only the fields you want to change. When you send conditions, it replaces every existing condition.

Preview ​

GET /segments/{id}/preview
json
{
  "data": {
    "count": 87,
    "sample": [ /* up to 5 contacts */ ]
  }
}

API v1.0