MPZ API > Add a Segment

Use the API to add a new segment to a group.


Submit an XML Request with the following details:
Post URL:
Fields to Post
apiKey String REQUIRED The APIKey of the requesting user.
groupID Int REQUIRED The ID of the group to add the segment for.
segmentName String REQUIRED A reference name for the segment.
matchType Int REQUIRED 0 = Match ANY of the rules
1 = Match ALL of the rules
segmentRules Xml REQUIRED  
--> rule Xml REQUIRED  
----> field String REQUIRED The field affected. Fields can be any of the following:
  • firstName
  • lastName
  • email
  • houseNo
  • address1
  • address2
  • town
  • county
  • country
  • postCode
  • dateOfBirth
  • gender
  • job
  • dateAdded
  • customField1
  • customField2
  • customField3
  • customField4
  • customField5
  • customField6
  • customField7
  • customField8
  • customField9
  • customField10
----> modifier String REQUIRED The modifier. Modifiers can include...

For Text / Number Fields:
  • Equals
  • Doesnt Equal
  • Contains
  • Does Not Contain
  • Is Provided
  • Is Not Provided
For Date Fields:
  • Is
  • Is After
  • Is Before
  • Day Is
  • Month Is
  • Year Is
----> value String REQUIRED The value to segment on.


Data Sent Back
error Int Indicated wether an error has occured. 0 for no error. 1 for error.
status String If there's been an error, a text description of the error that occured will be here.
segmentID String If successful you will receive the ID of the new segment.

Sample request XML

     <segmentName>My New Segment</segmentName>
               <modifier>Is After</modifier>

Sample response XML