Cakemail icon

Cakemail

Interact with Cakemail API

Segment → Create

AI-generated

Summary

Create a segment to organize contacts based on specified conditions.

Inputs

  • accountId — Optional: Specify an account ID for multi-tenant operations. If not provided, uses the authenticated account.
  • listId (required) — The ID of the list.
  • segmentName (required) — The name of the segment.
  • segmentConditions (required) — Segment conditions as a JSON object. Example: {"operator": "AND", "rules": [{"field": "email", "operator": "contains", "value": "@example.com"}]}.
  • segmentAdditionalFields — Additional fields such as description of the segment.

Output shape

a confirmation object including the created segment's details

Returns the created segment's details including its ID and name. Ensure that the conditions provided in JSON format are valid.

Examples

Example 1: Create a segment for users with emails containing '@example.com'

With listId set to 123 and conditions specifying the email filter.

Discussion