> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://mailchimp.com/developer/marketing/api/lists/create-segment/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mailchimp.com/_mcp/server. # Add segment POST https://api.mailchimp.com/3.0/lists/{list_id}/segments Content-Type: application/json Create a new segment in a specific list. Reference: https://mailchimp.com/developer/marketing/api/lists/create-segment ## Authentication - `Authorization` header (bearer token, required) — Authorization using a Mailchimp API key (a.k.a. Bearer token) - `Authorization` header (bearer token, required) — Authorization using OAuth ## Request ### Path parameters - `list_id` (string, required) — The unique ID for the list. ### Body (application/json) This endpoint expects an object. - `name` (string, required) — The name of the segment. - `options` (30ListsListIdSegmentsPostRequestBodyContentApplicationJsonSchemaOptions, optional) — The [conditions of the segment](https://mailchimp.com/help/save-and-manage-segments/). Static and fuzzy segments don't have conditions. - `static_segment` (list of string, optional) — An array of emails to be used for a static segment. Any emails provided that are not present on the list will be ignored. Passing an empty array will create a static segment without any subscribers. This field cannot be provided with the options field. ## Response ### 200 - `_links` (list of ListLinksItems, optional) — A list of link types and descriptions for the API schema documents. - `created_at` (datetime, optional) — The date and time the segment was created in ISO 8601 format. - `id` (integer, optional) — The unique id for the segment. - `list_id` (string, optional) — The list id. - `member_count` (integer, optional) — The number of active subscribers currently included in the segment. - `name` (string, optional) — The name of the segment. - `options` (ListOptions, optional) — The conditions of the segment. Static segments (tags) and fuzzy segments don't have conditions. - `type` (enum, optional) — The type of segment. Static segments are now known as tags. Learn more about [tags](https://mailchimp.com/help/getting-started-tags?utm_source=mc-api&utm_medium=docs&utm_campaign=apidocs). - Allowed values: `saved`, `static`, `fuzzy` - `updated_at` (datetime, optional) — The date and time the segment was last updated in ISO 8601 format. ## Types ### 30ListsListIdSegmentsPostRequestBodyContentApplicationJsonSchemaOptions The [conditions of the segment](https://mailchimp.com/help/save-and-manage-segments/). Static and fuzzy segments don't have conditions. - `conditions` (list of SegmentTypeItems, optional) — Segment match conditions. There are multiple possible types, see the [condition types documentation](https://mailchimp.com/developer/marketing/docs/alternative-schemas/#segment-condition-schemas). - `match` (enum, optional) — Match type. - Allowed values: `any`, `all` ### ListLinksItems This object represents a link from the resource where it is found to another resource or action that may be performed. - `href` (string, optional) — This property contains a fully-qualified URL that can be called to retrieve the linked resource or perform the linked action. - `method` (enum, optional) — The HTTP method that should be used when accessing the URL defined in 'href'. - Allowed values: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD` - `rel` (string, optional) — As with an HTML 'rel' attribute, this describes the type of link. - `schema` (string, optional) — For HTTP methods that can receive bodies (POST and PUT), this is a URL representing the schema that the body should conform to. - `targetSchema` (string, optional) — For GETs, this is a URL representing the schema that the response should conform to. ### ListOptions The conditions of the segment. Static segments (tags) and fuzzy segments don't have conditions. - `conditions` (list of SegmentTypeItems, optional) — Segment match conditions. There are multiple possible types, see the [condition types documentation](https://mailchimp.com/developer/marketing/docs/alternative-schemas/#segment-condition-schemas). - `match` (enum, optional) — Match type. - Allowed values: `any`, `all` ### SegmentTypeItems ### Aim Segment Segment by interaction with a specific campaign. - `condition_type` (enum, optional) - Allowed values: `Aim` - `field` (enum, optional) — Segment by interaction with a specific campaign. - Allowed values: `aim` - `op` (enum, optional) — The status of the member with regard to their campaign interaction. One of the following: opened, clicked, was sent, didn't open, didn't click, or was not sent. - Allowed values: `open`, `click`, `sent`, `noopen`, `noclick`, `nosent` - `value` (string, optional) — Either the web id value for a specific campaign or 'any' to account for subscribers who have/have not interacted with any campaigns. ### Automation Segment Segment by interaction with an Automation workflow. - `field` (enum, required) — Segment by interaction with an Automation workflow. - Allowed values: `automation` - `op` (enum, required) — The status of the member with regard to the automation workflow. One of the following: has started the workflow, has completed the workflow, has not started the workflow, or has not completed the workflow. - Allowed values: `started`, `completed`, `not_started`, `not_completed` - `value` (string, required) — The web id for the automation workflow to segment against. - `condition_type` (enum, optional) - Allowed values: `Automation` ### Poll Activity Segment Segment by poll activity. - `field` (enum, required) — Segment by poll activity. - Allowed values: `poll` - `op` (enum, required) — Members have/have not interacted with a specific poll in a Mailchimp email. - Allowed values: `member`, `notmember` - `value` (double, required) — The id for the poll. - `condition_type` (enum, optional) - Allowed values: `CampaignPoll` ### Conversation Segment Segment by interaction with a campaign via Conversations. - `field` (enum, required) — Segment by interaction with a campaign via Conversations. - Allowed values: `conversation` - `op` (enum, required) — The status of a member's interaction with a conversation. One of the following: has replied or has not replied. - Allowed values: `member`, `notmember` - `value` (string, required) — The web id value for a specific campaign or 'any' to account for subscribers who have/have not interacted with any campaigns. - `condition_type` (enum, optional) - Allowed values: `Conversation` ### Date Segment Segment by a specific date field. - `field` (enum, required) — The type of date field to segment on: The opt-in time for a signup, the date the subscriber was last updated, or the date of their last ecomm purchase. - Allowed values: `timestamp_opt`, `info_changed`, `ecomm_date` - `op` (enum, required) — When the event took place: Before, after, is a specific date, is not a specific date, is blank, or is not blank. - Allowed values: `greater`, `less`, `is`, `not`, `blank`, `blank_not`, `within`, `notwithin` - `value` (string, required) — What type of data to segment on: a specific date, a specific campaign, or the last campaign sent. - `condition_type` (enum, optional) - Allowed values: `Date` - `extra` (string, optional) — When segmenting on 'date' or 'campaign', the date for the segment formatted as YYYY-MM-DD or the web id for the campaign. ### Email Client Segment Segment by use of a particular email client. - `field` (enum, required) — Segment by use of a particular email client. - Allowed values: `email_client` - `op` (enum, required) — The operation to determine whether we select clients that match the value, or clients that do not match the value. - Allowed values: `client_is`, `client_not` - `value` (string, required) — The name of the email client. - `condition_type` (enum, optional) - Allowed values: `EmailClient` ### Language Segment Segment by language. - `field` (enum, required) — Segmenting based off of a subscriber's language. - Allowed values: `language` - `op` (enum, required) — Whether the member's language is or is not set to a specific language. - Allowed values: `is`, `not` - `value` (string, required) — A two-letter language identifier. - `condition_type` (enum, optional) - Allowed values: `Language` ### Member Rating Segment Segment by member rating. - `field` (enum, required) — Segment by member rating. - Allowed values: `rating` - `op` (enum, required) — Members who have have a rating that is/not exactly a given number or members who have a rating greater/less than a given number. - Allowed values: `is`, `not`, `greater`, `less` - `value` (SegmentTypeItemsOneOf7Value, required) - `condition_type` (enum, optional) - Allowed values: `MemberRating` ### Signup Source Segment Segment by signup source. - `condition_type` (enum, required) - Allowed values: `SignupSource` - `field` (enum, required) - Allowed values: `source` - `op` (enum, required) — Whether the member's signup source was/was not a particular value. - Allowed values: `source_is`, `source_not` - `value` (string, optional) — The signup source. ### Survey Monkey Segment Segment by interaction with a SurveyMonkey survey. - `field` (enum, required) — Segment by interaction with a SurveyMonkey survey. - Allowed values: `survey_monkey` - `op` (enum, required) — The status of the member with regard to the survey.One of the following: has started the survey, has completed the survey, has not started the survey, or has not completed the survey. - Allowed values: `started`, `completed`, `not_started`, `not_completed` - `value` (string, required) — The unique ID of the survey monkey survey. - `condition_type` (enum, optional) - Allowed values: `SurveyMonkey` ### VIP Segment Segment by VIP status. - `field` (enum, required) — Segment by VIP status. - Allowed values: `gmonkey` - `op` (enum, required) — Whether the member is or is not marked as VIP. - Allowed values: `member`, `notmember` - `condition_type` (enum, optional) - Allowed values: `VIP` ### Interests Segment Segment by an interest group merge field. - `condition_type` (enum, optional) - Allowed values: `Interests` - `field` (string, optional) — Segmenting based on interest group information. This should start with 'interests-' followed by the grouping id. Ex. 'interests-123'. - `op` (enum, optional) — Whether the member is a part of one, all, or none of the groups. - Allowed values: `interestcontains`, `interestcontainsall`, `interestnotcontains` - `value` (list of string, optional) — An array containing strings, each representing a group id. ### Ecommerce Category Segment Segment by purchases in specific items or categories. - `condition_type` (enum, optional) - Allowed values: `EcommCategory` - `field` (enum, optional) — Segment by purchases in specific items or categories. - Allowed values: `ecomm_cat`, `ecomm_prod` - `op` (enum, optional) — A member who has purchased from a category/specific item that is/is not a specific name, where the category/item name contains/doesn't contain a specific phrase or string, or a category/item name that starts/ends with a string. - Allowed values: `is`, `not`, `contains`, `notcontain`, `starts`, `ends` - `value` (string, optional) — The ecommerce category/item information. ### Ecommerce Number Segment Segment by average spent total, number of orders, total number of products purchased, or average number of products per order. - `field` (enum, required) — Segment by average spent total, number of orders, total number of products purchased, or average number of products per order. - Allowed values: `ecomm_spent_avg`, `ecomm_orders`, `ecomm_prod_all`, `ecomm_avg_ord` - `op` (enum, required) — Members who have spent exactly, have not spent exactly, spent more, or spent less than the segment value. - Allowed values: `is`, `not`, `greater`, `less` - `value` (SegmentTypeItemsOneOf13Value, required) - `condition_type` (enum, optional) - Allowed values: `EcommNumber` ### Ecommerce Purchased Segment Segment by whether someone has purchased anything. - `condition_type` (enum, optional) - Allowed values: `EcommPurchased` - `field` (enum, optional) — Segment by whether someone has purchased anything. - Allowed values: `ecomm_purchased` - `op` (enum, optional) — Members who have have ('member') or have not ('notmember') purchased. - Allowed values: `member`, `notmember` ### Ecommerce Spent Segment Segment by amount spent on a single order or across all orders. - `condition_type` (enum, optional) - Allowed values: `EcommSpent` - `field` (enum, optional) — Segment by amount spent on a single order or across all orders. - Allowed values: `ecomm_spent_one`, `ecomm_spent_all` - `op` (enum, optional) — Members who have spent 'more' or 'less' than then specified value. - Allowed values: `greater`, `less` - `value` (SegmentTypeItemsOneOf15Value, optional) ### Ecommerce Purchased Store Segment Segment by purchases from a specific store. - `condition_type` (enum, optional) - Allowed values: `EcommStore` - `field` (enum, optional) — Segment by purchases from a specific store. - Allowed values: `ecomm_store` - `op` (enum, optional) — Members who have or have not purchased from a specific store. - Allowed values: `is`, `not` - `value` (string, optional) — The store id to segment against. ### Goal Activity Segment Segment by Goal activity. - `field` (enum, required) — Segment by Goal activity. - Allowed values: `goal` - `op` (enum, required) — Whether the website URL is/not exactly, contains/doesn't contain, starts with/ends with a string. - Allowed values: `is`, `goal_not`, `contains`, `goal_notcontain`, `starts`, `ends` - `value` (string, required) — The URL to check Goal activity against. - `condition_type` (enum, optional) - Allowed values: `GoalActivity` ### Goal Timestamp Segment Segment by most recent interaction with a website. - `field` (enum, required) — Segment by most recent interaction with a website. - Allowed values: `goal_last_visited` - `op` (enum, required) — Whether the website activity happened after, before, or at a given timestamp. - Allowed values: `greater`, `less`, `is` - `value` (string, required) — The date to check Goal activity against. - `condition_type` (enum, optional) - Allowed values: `GoalTimestamp` ### Similar Subscribers Segment Member Segment Segment by similar subscribers. - `field` (enum, required) — Segment by similar subscribers. - Allowed values: `fuzzy_segment` - `op` (enum, required) — Members who are/are not apart of a 'similar subscribers' segment. - Allowed values: `fuzzy_is`, `fuzzy_not` - `value` (SegmentTypeItemsOneOf19Value, required) - `condition_type` (enum, optional) - Allowed values: `FuzzySegment` ### Static Segment Member Segment Segment by a given static segment. - `field` (enum, required) — Segment by a given static segment. - Allowed values: `static_segment` - `op` (enum, required) — Members who are/are not apart of a static segment. - Allowed values: `static_is`, `static_not` - `value` (SegmentTypeItemsOneOf20Value, required) - `condition_type` (enum, optional) - Allowed values: `StaticSegment` ### Location-Based Segment Segment by a specific country or US state. - `field` (enum, required) — Segmenting subscribers who are within a specific location. - Allowed values: `ipgeo` - `op` (enum, required) — Segment members who are within a specific country or US state. - Allowed values: `ipgeocountry`, `ipgeonotcountry`, `ipgeostate`, `ipgeonotstate` - `value` (string, required) — The two-letter country code or US state abbreviation. - `condition_type` (enum, optional) - Allowed values: `IPGeoCountryState` ### Geolocation Segment Segment by a specific geographic region. - `addr` (string, required) — The address of the target location. - `field` (enum, required) — Segmenting subscribers who are within a specific location. - Allowed values: `ipgeo` - `lat` (string, required) — The latitude of the target location. - `lng` (string, required) — The longitude of the target location. - `op` (enum, required) — Segment members who are within a specific geographic region. - Allowed values: `ipgeoin`, `ipgeonotin` - `value` (integer, required) — The radius of the target location. - `condition_type` (enum, optional) - Allowed values: `IPGeoIn` ### US Zip Code Segment Segment by a specific US ZIP code. - `extra` (integer, required) — The zip code to segment against. - `field` (enum, required) — Segmenting subscribers who are within a specific location. - Allowed values: `ipgeo` - `op` (enum, required) — Segment members who are within a specific US zip code. - Allowed values: `ipgeoinzip` - `value` (integer, required) — The radius of the target location. - `condition_type` (enum, optional) - Allowed values: `IPGeoInZip` ### Unknown Location-Based Segment Segment members whose location information is unknown. - `field` (enum, required) — Segmenting subscribers who are within a specific location. - Allowed values: `ipgeo` - `op` (enum, required) — Segment members for which location information is unknown. - Allowed values: `ipgeounknown` - `condition_type` (enum, optional) - Allowed values: `IPGeoUnknown` ### Zip Code Location-Based Segment Segment by a specific US ZIP code. - `field` (enum, required) — Segmenting subscribers who are within a specific location. - Allowed values: `ipgeo` - `op` (enum, required) — Segment members who are/are not within a specific US zip code. - Allowed values: `ipgeoiszip`, `ipgeonotzip` - `value` (integer, required) — The 5-digit zip code. - `condition_type` (enum, optional) - Allowed values: `IPGeoZip` ### Social Profiles Age Segment Segment by age ranges in Social Profiles data. - `field` (enum, required) — Segment by age ranges in Social Profiles data. - Allowed values: `social_age` - `op` (enum, required) — Members who are/not the exact criteria listed. - Allowed values: `is`, `not` - `value` (enum, required) — The age range to segment. - Allowed values: `18-24`, `25-34`, `35-54`, `55+` - `condition_type` (enum, optional) - Allowed values: `SocialAge` ### Social Profiles Gender Segment Segment by listed gender in Social Profiles data. - `field` (enum, required) — Segment by listed gender in Social Profiles data. - Allowed values: `social_gender` - `op` (enum, required) — Members who are/not the exact criteria listed. - Allowed values: `is`, `not` - `value` (enum, required) — The Social Profiles gender to segment. - Allowed values: `male`, `female` - `condition_type` (enum, optional) - Allowed values: `SocialGender` ### Social Profiles Influence Segment Segment by influence rating in Social Profiles data. - `field` (enum, required) — Segment by influence rating in Social Profiles data. - Allowed values: `social_influence` - `op` (enum, required) — Members who have a rating that is/not or greater/less than the rating provided. - Allowed values: `is`, `not`, `greater`, `less` - `value` (double, required) — The Social Profiles influence rating to segment. - `condition_type` (enum, optional) - Allowed values: `SocialInfluence` ### Social Profiles Social Network Segment Segment by social network in Social Profiles data. - `field` (enum, required) — Segment by social network in Social Profiles data. - Allowed values: `social_network` - `op` (enum, required) — Members who are/not on a given social network. - Allowed values: `member`, `notmember` - `value` (enum, required) — The social network to segment against. - Allowed values: `twitter`, `facebook`, `linkedin`, `flickr`, `foursquare`, `lastfm`, `myspace`, `quora`, `vimeo`, `yelp`, `youtube` - `condition_type` (enum, optional) - Allowed values: `SocialNetworkMember` ### Social Profiles Social Network Follow Segment Segment by social network in Social Profiles data. - `field` (enum, required) — Segment by social network in Social Profiles data. - Allowed values: `social_network` - `op` (enum, required) — Members who are/not following a linked account on a given social network. - Allowed values: `follow`, `notfollow` - `value` (enum, required) — The social network to segment against. - Allowed values: `twitter_follow` - `condition_type` (enum, optional) - Allowed values: `SocialNetworkFollow` ### Address Merge Field Segment Segment by an address-type merge field. - `field` (string, required) — An address-type merge field to segment. - `op` (enum, required) — Whether the member's address merge field contains/does not contain a value or is/is not blank. - Allowed values: `contains`, `notcontain`, `blank`, `blank_not` - `condition_type` (enum, optional) - Allowed values: `AddressMerge` - `value` (string, optional) — The value to segment a text merge field with. ### Address/Zip Merge Field Segment Segment by an address-type merge field within a given distance. - `extra` (string, required) — The city or the zip being used to segment against. - `field` (string, required) — An address or zip-type merge field to segment. - `op` (enum, required) — Whether the member's address merge field is within a given distance from a city or zip. - Allowed values: `geoin` - `value` (string, required) — The distance from the city/zip. - `condition_type` (enum, optional) - Allowed values: `ZipMerge` ### Birthday Merge Field Segment Segment by a contact's birthday. - `field` (string, required) — A date merge field to segment. - `op` (enum, required) — Whether the member's birthday merge information is/is not a certain date or is/is not blank. - Allowed values: `is`, `not`, `blank`, `blank_not` - `condition_type` (enum, optional) - Allowed values: `BirthdayMerge` - `value` (string, optional) — A date to segment against (mm/dd). ### Date Merge Field Segment Segment by a given date merge field. - `field` (string, required) — A date merge field to segment. - `op` (enum, required) — Whether the member's merge information is/is not, is greater/less than a value or is/is not blank. - Allowed values: `is`, `not`, `less`, `blank`, `blank_not`, `greater` - `condition_type` (enum, optional) - Allowed values: `DateMerge` - `value` (string, optional) — A date to segment against. ### Dropdown/Radio Merge Field Segment An individual segment condition - `field` (string, required) — A merge field to segment. - `op` (enum, required) — Whether the member's merge information is/is not a value or is/is not blank. - Allowed values: `is`, `not`, `blank`, `blank_not`, `notcontain`, `contains` - `condition_type` (enum, optional) - Allowed values: `SelectMerge` - `value` (string, optional) — The value to segment a text merge field with. ### Text or Number Merge Field Segment Segment by a given text or number merge field. - `field` (string, required) — A text or number merge field to segment. - `op` (enum, required) — Whether the member's merge information is/is not, contains/does not contain, starts/ends with, or is greater/less than a value - Allowed values: `is`, `not`, `contains`, `notcontain`, `starts`, `ends`, `greater`, `less`, `blank`, `blank_not` - `condition_type` (enum, optional) - Allowed values: `TextMerge` - `value` (string, optional) — The value to segment a text or number merge field with. ### Email Segment Segment by email address. - `field` (enum, required) — Segmenting based off of a subscriber's email address. - Allowed values: `merge0`, `EMAIL` - `op` (enum, required) — Whether the email address is/not exactly, contains/doesn't contain, starts/ends with a string. - Allowed values: `is`, `not`, `contains`, `notcontain`, `starts`, `ends`, `greater`, `less` - `condition_type` (enum, optional) - Allowed values: `EmailAddress` - `value` (string, optional) — The value to compare the email against. ### Predicted Gender Segment Segment by predicted gender. - `field` (enum, required) — Segment by predicted gender. - Allowed values: `predicted_gender` - `op` (enum, required) — Members who are/not the exact criteria listed. - Allowed values: `is`, `not` - `value` (enum, required) — The predicted gender to segment. - Allowed values: `male`, `female` - `condition_type` (enum, optional) - Allowed values: `PredictedGender` ### Predicted Age Segment Segment by predicted age. - `field` (enum, required) — Segment by predicted age. - Allowed values: `predicted_age_range` - `op` (enum, required) — Members who are/not the exact criteria listed. - Allowed values: `is` - `value` (enum, required) — The predicted age to segment. - Allowed values: `18-24`, `25-34`, `35-44`, `45-54`, `55-64`, `65+` - `condition_type` (enum, optional) - Allowed values: `PredictedAge` ### New Subscribers Prebuilt Segment Segment by when people subscribed. - `condition_type` (enum, optional) - Allowed values: `NewSubscribers` - `field` (enum, optional) — Segment by when people subscribed. - Allowed values: `timestamp_opt` - `op` (enum, optional) — Whe the event took place, namely within a time frame. - Allowed values: `date_within` - `value` (string, optional) — What type of data to segment on: a specific date, a specific campaign, or the last campaign sent. ### SegmentTypeItemsOneOf7Value ### SegmentTypeItemsOneOf13Value ### SegmentTypeItemsOneOf15Value ### SegmentTypeItemsOneOf19Value ### SegmentTypeItemsOneOf20Value ## Examples **Request** ```json { "name": "string" } ``` **Response** ```json { "_links": [ { "href": "string", "method": "GET", "rel": "string", "schema": "string", "targetSchema": "string" } ], "created_at": "2024-01-15T09:30:00Z", "id": 1, "list_id": "string", "member_count": 1, "name": "string", "options": { "conditions": [ { "condition_type": "Aim", "field": "aim", "op": "open", "value": "any" } ], "match": "any" }, "type": "saved", "updated_at": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.mailchimp.com/3.0/lists/list_id/segments" payload = { "name": "string" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.mailchimp.com/3.0/lists/list_id/segments'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"string"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.mailchimp.com/3.0/lists/list_id/segments" payload := strings.NewReader("{\n \"name\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.mailchimp.com/3.0/lists/list_id/segments") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.mailchimp.com/3.0/lists/list_id/segments") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"string\"\n}") .asString(); ``` ```php request('POST', 'https://api.mailchimp.com/3.0/lists/list_id/segments', [ 'body' => '{ "name": "string" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.mailchimp.com/3.0/lists/list_id/segments"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["name": "string"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.mailchimp.com/3.0/lists/list_id/segments")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` > Find all the Mailchimp API documentation and tools developers need to send marketing and transactional emails.