Sign in

Create Segment

documented

Create a new segment with criteria to target contacts.

POST /segmentsSegmentsno implementation yet0 runs
No implementation yet. Run it to have the agent write one, or open a pull request with your own.

Seed example (keychains curl)

npx -y keychains@latest curl "https://api.cc.email/v3/segments" \
  -X POST \
  -H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"name": "{{$segment_name}}", "segment_criteria": "{\\"version\\":\\"{{$segment_criteria_version}}\\",\\"criteria\\":{\\"type\\":\\"and\\",\\"group\\": [{\\"source\\":\\"{{$segment_source}}\\",\\"field\\":\\"{{$segment_field}}\\",\\"op\\":\\"{{$segment_op}}\\",\\"const_value\\":\\"{{$segment_const_value}}\\",\\"param\\":\\"{{$segment_param}}\\"}]}}"}'}