Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
SendCloud Portal
Sitecore Send API documentation
  • Introduction to the Sitecore Send API
        • Get all segments
        • Get segment details
        • Get segment subscribers
        • Create an empty segment
        • Create a segment with criteria
        • Update a segment
        • Add criteria to a segment
        • Update segment criteria
        • Delete a segment
  1. Segments
  1. Sitecore Send API documentation
  2. API reference

Create an empty segment

POST /lists/{MailingListID}/segments/create.{Format}

Creates a new empty segment without criteria in a specific email list.

Request

ParameterInTypeRequiredDescription
AcceptheaderstringtrueDetermines the expected format and data type to retrieve the response data.Value: application/json
MailingListIDpathstringtrueThe ID of the email list where the segment is created.
FormatpathstringtrueThe supported file format for getting a response.Possible values: json and xml.
apikeyquerystringtrueThe API key of your account.
NamebodystringtrueThe name of the segment.
MatchTypebodystringfalseSpecifies how subscribers are returned by your segment based on matching criteria
(Default) - returns subscribers that match all the given criteria.Any - returns subscribers that match any of the given criteria.
FetchTypebodystringfalseSpecifies how many criteria-matching subscribers are contained in your segment
- returns all criteria matching subscribers.Top - returns only a maximum number of subscribers defined in FetchValue.TopPercent - returns only a percentage of subscribers defined in FetchValue.
FetchValuebodyintegerfalseSpecifies the maximum number for FetchType
or percentage for FetchType
of members to be contained in the created segment. If not specified, 0 is assumed.
POST https://{hostname}/v3/lists/{MailingListID}/segments/create.{Format}?apikey=

Request body:
{
  "Name": "New Customers",
  "MatchType": "All",
  "FetchType": "Top",
  "FetchValue": "200"
}
curl --include \\
     --request POST \\
     --header "Content-Type: application/json" \\
     --header "Accept: application/json" \\
     --data-raw '{
  "Name": "New Customers",
  "MatchType": "All",
  "FetchType": "Top",
  "FetchValue": "200"
}' \\
'https://{hostname}/v3/lists/{MailingListID}/segments/create.{Format}?apikey='

Response

StatusDescriptionHeadersSchema
200 OKThe request is successful.Content-Type
/jsonAccept
/json
N/A
{
  "Code": 0,
  "Error": null,
  "Context": 10199
}
  • Code - the response code. This is 0 if successful.

  • Error - the response error message. This is null if successful.

  • Context - the ID of the segment created.

If you have suggestions for improving this article, let us know!

© Copyright , Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use
SendCloud Portal