> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://mailchimp.com/developer/marketing/api/account-exports/create/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mailchimp.com/_mcp/server. # Add export POST https://api.mailchimp.com/3.0/account-exports Content-Type: application/json Create a new account export in your Mailchimp account. Reference: https://mailchimp.com/developer/marketing/api/account-exports/create ## 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 ### Body (application/json) This endpoint expects an object. - `include_stages` (list of enum, required) — The stages of an account export to include. - Allowed values: `audiences`, `campaigns`, `events`, `gallery_files`, `reports`, `templates` - `since_timestamp` (datetime, optional) — An ISO 8601 date that will limit the export to only records created after a given time. For instance, the reports stage will contain any campaign sent after the given timestamp. Audiences, however, are excluded from this limit. ## Response ### 200 - `_links` (list of 30AccountExportsPostResponsesContentApplicationJsonSchemaLinksItems, optional) — A list of link types and descriptions for the API schema documents. - `download_url` (string, optional) — If the export is finished, the download URL for an export. URLs are only valid for 90 days after the export completes. - `export_id` (integer, optional) — The ID for the export. - `finished` (datetime, optional) — If finished, the finish time for the export. - `size_in_bytes` (integer, optional) — The size of the uncompressed export in bytes. - `started` (datetime, optional) — Start time for the export. ## Types ### 30AccountExportsPostResponsesContentApplicationJsonSchemaLinksItems 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. ## Examples **Request** ```json { "include_stages": [ "audiences", "gallery_files" ] } ``` **Response** ```json { "_links": [ { "href": "string", "method": "GET", "rel": "string", "schema": "string", "targetSchema": "string" } ], "download_url": "string", "export_id": 1, "finished": "2024-01-15T09:30:00Z", "size_in_bytes": 1, "started": "2024-01-15T09:30:00Z" } ``` **SDK Code** ```python import requests url = "https://api.mailchimp.com/3.0/account-exports" payload = { "include_stages": ["audiences", "gallery_files"] } 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/account-exports'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"include_stages":["audiences","gallery_files"]}' }; 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/account-exports" payload := strings.NewReader("{\n \"include_stages\": [\n \"audiences\",\n \"gallery_files\"\n ]\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/account-exports") 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 \"include_stages\": [\n \"audiences\",\n \"gallery_files\"\n ]\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/account-exports") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"include_stages\": [\n \"audiences\",\n \"gallery_files\"\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.mailchimp.com/3.0/account-exports', [ 'body' => '{ "include_stages": [ "audiences", "gallery_files" ] }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.mailchimp.com/3.0/account-exports"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"include_stages\": [\n \"audiences\",\n \"gallery_files\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["include_stages": ["audiences", "gallery_files"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.mailchimp.com/3.0/account-exports")! 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.