Create a segment

Using the SDK

from cakemail.models import Segment

segment = api.segment.create(
    list_id=<list ID>,
    segment=Segment(
        name='<segment name>',
        query='<segment query>'
    )
)
<?php

$segment = $api->segment->create([
    'list_id' => <list ID>,
    'segment' => new \Cakemail\Lib\Model\Segment([
        'name' => '<segment name>',
        'query' => '<segment query>'
    ])
]);
Language
Authentication
OAuth2
Click Try It! to start a request and see the response here!