API Reference
Your guide to getting things done
Search our documentation articles

Your complete guide to mastering Moosend. Search to get started.

Create an empty segment

Article: 000054612
Updated: September 11, 2025

Create an empty segment

Abstract

Describes the request and response details of this Moosend API endpoint to create an empty segment in a specific email list.

Request

Parameter

In

Type

Required

Description

Accept

header

string

true

Determines the expected format and data type to retrieve the response data.

Value: application/json

MailingListID

path

string

true

The ID of the email list where the segment is created.

Format

path

string

true

The supported file format for getting a response.

Possible values: json and xml.

apikey

query

string

true

The API key of your account.

Name

body

string

true

The name of the segment.

MatchType

body

string

false

Specifies how subscribers are returned by your segment based on matching criteria:

  • All (Default) - returns subscribers that match all the given criteria.

  • Any - returns subscribers that match any of the given criteria.

FetchType

body

string

false

Specifies how many criteria-matching subscribers are contained in your segment:

  • All - 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.

FetchValue

body

integer

false

Specifies the maximum number for FetchType:Top or percentage for FetchType:TopPercent of members to be contained in the created segment. If not specified, 0 is assumed.

Response

Status

Description

Headers

Schema

200 OK

The request is successful.

Content-Type:application/json

Accept:application/json

N/A

  • 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.

Request
POST https://{hostname}/v3/lists/{MailingListID}/segments/create.{Format}?apikey=

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



Moosend Logo

Copyright © 2026 · All Rights Reserved · Moosend · Privacy Policy