curl --request POST \
--url https://api.migma.ai/v1/contacts/exports \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "aaaaaaaaaaaaaaaaaaaaaaaa",
"filters": {
"status": "unsubscribed"
}
}
'import requests
url = "https://api.migma.ai/v1/contacts/exports"
payload = {
"projectId": "aaaaaaaaaaaaaaaaaaaaaaaa",
"filters": { "status": "unsubscribed" }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({projectId: 'aaaaaaaaaaaaaaaaaaaaaaaa', filters: {status: 'unsubscribed'}})
};
fetch('https://api.migma.ai/v1/contacts/exports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/contacts/exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'aaaaaaaaaaaaaaaaaaaaaaaa',
'filters' => [
'status' => 'unsubscribed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.migma.ai/v1/contacts/exports"
payload := strings.NewReader("{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.migma.ai/v1/contacts/exports")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/contacts/exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"jobId": "<string>",
"projectId": "<string>",
"status": "pending",
"contactCount": 1,
"fileName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadExpiresAt": "2023-11-07T05:31:56Z",
"error": "<string>"
},
"error": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Create Contact Export
Queue a full filtered CSV export. Requires audience:read and brand ownership. Returns 202 only after enqueue. Poll exact job for download URL; no email is sent by this API. Idempotency-Key replay uses a stable queue job ID and rejects different request bodies. Jobs retained up to seven days. Filters use tag IDs. Export does not synchronize external services.
curl --request POST \
--url https://api.migma.ai/v1/contacts/exports \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "aaaaaaaaaaaaaaaaaaaaaaaa",
"filters": {
"status": "unsubscribed"
}
}
'import requests
url = "https://api.migma.ai/v1/contacts/exports"
payload = {
"projectId": "aaaaaaaaaaaaaaaaaaaaaaaa",
"filters": { "status": "unsubscribed" }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({projectId: 'aaaaaaaaaaaaaaaaaaaaaaaa', filters: {status: 'unsubscribed'}})
};
fetch('https://api.migma.ai/v1/contacts/exports', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.migma.ai/v1/contacts/exports",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => 'aaaaaaaaaaaaaaaaaaaaaaaa',
'filters' => [
'status' => 'unsubscribed'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.migma.ai/v1/contacts/exports"
payload := strings.NewReader("{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.migma.ai/v1/contacts/exports")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.migma.ai/v1/contacts/exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"filters\": {\n \"status\": \"unsubscribed\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"jobId": "<string>",
"projectId": "<string>",
"status": "pending",
"contactCount": 1,
"fileName": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"downloadExpiresAt": "2023-11-07T05:31:56Z",
"error": "<string>"
},
"error": "<string>"
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}{
"success": false,
"error": "<string>",
"code": "<string>",
"data": {}
}Authorizations
API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → Developers → API Keys.
Headers
1 - 100Body
^[a-fA-F0-9]{24}$^[a-fA-F0-9]{24}$Each group combines its conditions and child groups using match: all (AND) by default, or any (OR). Values within one condition keep their existing semantics. At most 3 nested group levels below the root (root depth 0), 10 child groups per group, and 50 conditions across the entire tree. Each nonempty tags or excludeTags array, status, validationStatus, nonempty customFields key, fields entry, or activity entry counts as one condition; group containers do not count. Nested groups must contain a condition or a nonempty child group; the root may be empty. Campaign-specific activity requires all in its own group and every ancestor, but an any sibling is allowed. Send eligibility and project scope always apply outside these conditions.
Show child attributes
Show child attributes
Was this page helpful?