Mailtarget Open API
Complete API reference for the Mailtarget email platform. 383 endpoints across email sending, contact management, analytics, security, and compliance.
Authorization: Bearer MAILTARGET_API_KEYBase URL —
https://api.mailtarget.coResponse Format — Success:
{"data": {...}, "meta": {...}} · Error: {"message": "...", "error": "ERROR_CODE"}
Campaigns
Create, manage, and send email campaigns to your contact lists. Supports scheduling, personalization with merge tags, and campaign lifecycle management.
/v?/campaigns
cURL Example
curl -X POST https://apiconfig.mailtarget.co/v?/campaigns \
-H "Authorization: Bearer MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "Welcome Email",
"type": "ONE_TIME",
"startType": "FIX_TIME",
"dueDate": "2026-04-15T10:00:00Z",
"sender": {"name": "Mailtarget", "email": "noreply@mailtarget.co"},
"recipients": {"labels": ["new-users"]},
"htmlContent": "<html><body><h1>Welcome</h1></body></html>",
"emailType": "HTMLV3",
"snippet": "Welcome to our platform"
}'
/v?/campaigns
cURL Example
curl -X GET "https://apiconfig.mailtarget.co/v?/campaigns?page=1&perPage=20&search=welcome" \
-H "Authorization: Bearer MAILTARGET_API_KEY"
/v?/campaigns/:id
cURL Example
curl -X GET https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b4c5d6e7f8a9b0c1d \
-H "Authorization: Bearer MAILTARGET_API_KEY"
/v?/campaigns/:id
cURL Example
curl -X PUT https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b4c5d6e7f8a9b0c1d \
-H "Authorization: Bearer MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"subject": "Updated Welcome Email", "snippet": "Updated"}'
/v?/campaigns/:id
curl -X DELETE https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b4c5d6e7f8a9b0c1d \
cURL Example
curl -X DELETE https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b4c5d6e7f8a9b0c1d \
-H "Authorization: Bearer MAILTARGET_API_KEY"
A/B Testing
Test different subject lines, content, or send times to find what performs best before sending to your full list.
/v?/campaigns/:id/ab-test
/v?/campaigns/:id/ab-test/results
Automation
Build automated email sequences triggered by events (signup, purchase, date-based). Set up drip campaigns and behavioral workflows.
/v?/automations
/v?/automations
/v?/automations/:id
/v?/automations/:id
/v?/automations/:id
/v?/automations/:id/activate
Campaign Actions
Perform actions on campaigns: send, pause, resume, cancel, duplicate, or schedule for later delivery.
/v?/campaigns/:id/send
Trigger immediate send untuk campaign yang sudah lengkap dan masih berada di stage yang bisa dikirim.
{
"data": {
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"stage": "SENDING",
"message": "Campaign is being sent"
}
}
{
"data": {
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"stage": "SENDING",
"message": "Campaign is being sent"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/campaigns/663f1a2b4c5d6e7f8a9b0c1d/send' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/campaigns/:id/schedule
Menjadwalkan campaign untuk dikirim di waktu tertentu.
{
"dueDate": "2026-04-15T10:00:00Z"
}
{
"data": {
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"stage": "SCHEDULED",
"dueDate": "2026-04-15T10:00:00Z",
"message": "Campaign scheduled"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/campaigns/663f1a2b4c5d6e7f8a9b0c1d/schedule' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"dueDate": "2026-04-15T10:00:00Z"
}'
/v?/campaigns/:id/cancel
Membatalkan campaign yang sudah dijadwalkan dan mengembalikannya ke stage draft.
{
"data": {
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"stage": "DRAFT",
"message": "Campaign cancelled"
}
}
{
"data": {
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"stage": "DRAFT",
"message": "Campaign cancelled"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/campaigns/663f1a2b4c5d6e7f8a9b0c1d/cancel' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Forms
Create and manage subscription forms that can be embedded on your website to collect new contacts.
/v?/forms
/v?/forms/:id
/v?/forms/:id/submissions
Vouchers
Generate and manage promotional voucher codes that can be distributed via email campaigns.
/v?/vouchers
/v?/vouchers
/v?/vouchers/:id
Batch Sending
Send personalized emails to large lists in a single API call. Supports per-recipient substitution data and scheduling.
/v?/batches
{ "name": "Welcome batch", "messages": [{ "to": [{"email": "a@b.com"}], "from": {"email": "noreply@mailtarget.co", "name": "MT"}, "subject": "Welcome", "bodyHtml": "<h1>Hi</h1>" }] }
/v?/batches
— GET /v?/batches/:id
/v?/batches/:id/send
Trigger. Response: `{ "data": { "status": "sending" } }`
/v?/batches/:id
Cancel pending batch. Error 400 if already sending/completed.
Categories
Organize campaigns and single sends into categories for filtering and reporting.
/v?/categories
{ "data": [{ "name": "transactional", "description": "", "messageCount": 15000, "lastUsedAt": "2026-04-10T08:00:00Z" }] }
/v?/categories/:name/stats
Stats for a category. Query: `dateFrom`, `dateTo`.
/v?/categories/:name
Response: `{ "message": "Category removed" }`
Scheduled Messages
View and manage emails that are queued for future delivery. Cancel or reschedule pending sends.
/v?/scheduled-messages
Query: `page`, `perPage`, `dateFrom`, `dateTo`.
/v?/scheduled-messages/:id
Full message detail.
/v?/scheduled-messages/:id
Update schedule time. `{ "scheduledFor": "2026-04-16T10:00:00Z" }` Must be future.
/v?/scheduled-messages/:id
Cancel. Response: `{ "message": "Scheduled message cancelled" }`
Message Streams
Separate your sending into isolated streams (transactional, marketing, inbound) with independent reputation and settings.
/v?/message-streams
Membuat message stream baru. Default type `transactional` jika tidak diisi.
{
"name": "Transactional Emails",
"type": "transactional",
"description": "Order confirmations and receipts"
}
{
"data": {
"_id": "ms_001",
"name": "Transactional Emails",
"type": "transactional",
"description": "Order confirmations and receipts",
"active": true,
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/message-streams' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Transactional Emails",
"type": "transactional",
"description": "Order confirmations and receipts"
}'
/v?/message-streams
Mengambil semua message streams.
{
"data": [
{
"_id": "ms_001",
"name": "Transactional Emails",
"type": "transactional",
"description": "Order confirmations and receipts",
"active": true,
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/message-streams' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/message-streams/:id
Mengambil detail message stream berdasarkan ID.
{
"data": {
"_id": "ms_001",
"name": "Transactional Emails",
"type": "transactional",
"description": "Order confirmations and receipts",
"active": true,
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/message-streams/ms_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/message-streams/:id
Mengupdate message stream berdasarkan ID.
{
"name": "Marketing Emails",
"type": "marketing",
"description": "Promotional campaigns",
"active": true
}
{
"data": {
"_id": "ms_001",
"name": "Marketing Emails",
"type": "marketing",
"description": "Promotional campaigns",
"active": true,
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:05:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/message-streams/ms_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Marketing Emails",
"type": "marketing",
"description": "Promotional campaigns",
"active": true
}'
/v?/message-streams/:id/archive
Mengarsipkan message stream.
{
"message": "Stream archived"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/message-streams/ms_001/archive' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/message-streams/:id/unarchive
Mengembalikan message stream dari arsip.
{
"message": "Stream unarchived"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/message-streams/ms_001/unarchive' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Snippets
Save reusable content blocks (HTML and text) that can be inserted into multiple templates — headers, footers, CTAs.
/v?/snippets
Membuat snippet (reusable content block) baru.
{
"name": "Footer CTA",
"html": "<div class='cta'><a href='#'>Sign Up Now</a></div>",
"text": "Sign Up Now: https://example.com"
}
{
"data": {
"_id": "snp_001",
"name": "Footer CTA",
"html": "<div class='cta'><a href='#'>Sign Up Now</a></div>",
"text": "Sign Up Now: https://example.com",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/snippets' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Footer CTA",
"html": "<div class=\"cta\"><a href=\"#\">Sign Up Now</a></div>",
"text": "Sign Up Now: https://example.com"
}'
/v?/snippets
Mengambil semua snippets (tanpa pagination).
{
"data": [
{
"_id": "snp_001",
"name": "Footer CTA",
"html": "<div class='cta'><a href='#'>Sign Up Now</a></div>",
"text": "Sign Up Now: https://example.com",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/snippets' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/snippets/:id
Mengambil detail snippet berdasarkan ID.
{
"data": {
"_id": "snp_001",
"name": "Footer CTA",
"html": "<div class='cta'><a href='#'>Sign Up Now</a></div>",
"text": "Sign Up Now: https://example.com",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/snippets/snp_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/snippets/:id
Mengupdate snippet berdasarkan ID.
{
"name": "Updated Footer CTA",
"html": "<div class='cta'><a href='#'>Get Started</a></div>"
}
{
"data": {
"_id": "snp_001",
"name": "Updated Footer CTA",
"html": "<div class='cta'><a href='#'>Get Started</a></div>",
"text": "Sign Up Now: https://example.com",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:05:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/snippets/snp_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Updated Footer CTA",
"html": "<div class=\"cta\"><a href=\"#\">Get Started</a></div>"
}'
/v?/snippets/:id
Menghapus snippet berdasarkan ID.
{
"message": "Snippet deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/snippets/snp_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Template Versions
Manage template version history. Preview with substitution data, validate HTML, and rollback to previous versions.
/v?/templates/:id/versions
Mengambil daftar semua versi dari sebuah template.
{
"data": [
{
"_id": "ver_003",
"templateId": "tpl_001",
"version": 3,
"html": "<html>...</html>",
"createdAt": "2026-04-10T10:00:00Z",
"createdBy": "user@example.com"
},
{
"_id": "ver_002",
"templateId": "tpl_001",
"version": 2,
"html": "<html>...</html>",
"createdAt": "2026-04-09T10:00:00Z",
"createdBy": "user@example.com"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/templates/tpl_001/versions' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/templates/:id/versions/:versionId
Mengambil detail versi template tertentu.
{
"data": {
"_id": "ver_002",
"templateId": "tpl_001",
"version": 2,
"html": "<html>...</html>",
"createdAt": "2026-04-09T10:00:00Z",
"createdBy": "user@example.com"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/templates/tpl_001/versions/ver_002' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/templates/:id/versions/:versionId/rollback
Rollback template ke versi tertentu.
{
"message": "Template rolled back to version"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/templates/tpl_001/versions/ver_002/rollback' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/templates/:id/preview
Preview template dengan substitution data (merge tags).
{
"substitutionData": {
"name": "John Doe",
"company": "Acme Corp"
}
}
{
"data": {
"renderedHtml": "<html><body>Hello John Doe from Acme Corp</body></html>"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/templates/tpl_001/preview' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"substitutionData": {
"name": "John Doe",
"company": "Acme Corp"
}
}'
/v?/templates/validate
Validasi HTML dan subject template tanpa menyimpan.
{
"html": "<html><body>{{name}}, welcome!</body></html>",
"subject": "Welcome {{name}}"
}
{
"data": {
"valid": true,
"errors": []
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/templates/validate' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"html": "<html><body>{{name}}, welcome!</body></html>",
"subject": "Welcome {{name}}"
}'
Designs
Create and manage email designs (templates with HTML/text content). Includes prebuilt designs you can duplicate and customize.
/v?/designs
Mengambil daftar designs dengan pagination. Design: `{_id, name, htmlContent, textContent, subject, category, thumbnailUrl, createdAt, updatedAt}`. Response includes `meta`.
/v?/designs
Membuat design baru. Body: `{name, htmlContent, textContent, subject, category}`. Response (201).
/v?/designs/:id
Mengambil design by ID. Error: 404=DESIGN_NOT_FOUND
/v?/designs/:id
Mengupdate design. Error: 404=DESIGN_NOT_FOUND
/v?/designs/:id
Menghapus design. Response: `{"message": "Design deleted"}`. Error: 404=DESIGN_NOT_FOUND
/v?/designs/:id/duplicate
Menduplikasi design. Response (201). Error: 404=DESIGN_NOT_FOUND
/v?/designs/prebuilt
Mengambil semua prebuilt designs (tanpa pagination).
/v?/designs/prebuilt/:id
Mengambil prebuilt design by ID. Error: 404=DESIGN_NOT_FOUND
/v?/designs/prebuilt/:id/duplicate
Menduplikasi prebuilt design ke user designs. Response (201). Error: 404=DESIGN_NOT_FOUND
Single Sends
Create one-time email sends with full campaign features: design selection, list targeting, scheduling, and duplication.
/v?/single-sends
List dengan pagination. SingleSend: `{_id, name, subject, status, senderId, listIds[], segmentIds[], designId, sendAt, createdAt, updatedAt}`
/v?/single-sends
Membuat single send baru. Body: `{name, subject, senderId, listIds, segmentIds, designId}`. Response (201).
/v?/single-sends/:id
Get by ID. Error: 404=SINGLE_SEND_NOT_FOUND
/v?/single-sends/:id
Update. Error: 404=SINGLE_SEND_NOT_FOUND
/v?/single-sends/:id
Delete. Response: `{"message": "Single send deleted"}`. Error: 404=SINGLE_SEND_NOT_FOUND
/v?/single-sends/:id/duplicate
Duplicate. Response (201). Error: 404=SINGLE_SEND_NOT_FOUND
/v?/single-sends/bulk
Bulk delete. Body: `{"ids": ["id1","id2"]}`. Response: `{"message": "Single sends deleted"}`
/v?/single-sends/:id/schedule
Schedule pengiriman. Body: `{"sendAt": "2026-04-15T10:00:00Z"}`.
/v?/single-sends/:id/unschedule
Batalkan schedule.
/v?/single-sends/search?q=keyword
Search single sends by keyword.
/v?/single-sends/categories
Mengambil daftar categories (string array).
Sending Queues
Monitor the sending queue status (regular and scheduled). Purge scheduled queue or resend failed messages.
/v?/sending-queues
Mengambil snapshot kondisi sending queue saat ini (regular dan scheduled).
{
"data": {
"regular": {
"pending": 120,
"processing": 15,
"failed": 3
},
"scheduled": {
"pending": 45,
"processing": 0,
"failed": 0
}
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/sending-queues' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/sending-queues/scheduled
Menghapus semua pesan di scheduled queue (purge).
{
"message": "Scheduled queue purged"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/sending-queues/scheduled' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/sending-queues/resend
Mengirim ulang pesan yang gagal berdasarkan message ID.
{
"messageId": "msg_001"
}
{
"message": "Message resent"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/sending-queues/resend' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"messageId": "msg_001"
}'
Contacts
Store and manage your email recipients. Add, update, search, and delete contacts with custom fields and metadata.
/v1/contacts
Membuat contact baru.
{
"email": "alice@example.com",
"name": "Alice Tan",
"firstname": "Alice",
"lastname": "Tan",
"dayOfBirth": "1995-06-12",
"gender": "FEMALE",
"phone": "+628123456789",
"city": "Jakarta",
"country": "Indonesia",
"note": "Lead from enterprise form",
"company": "Mailtarget",
"customPeriod": [],
"customField": {
"source": "landing-page"
},
"labels": [
"enterprise",
"trial"
],
"segments": [
"segment-a"
],
"index": "contacts-main",
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false,
"unsubscribeReason": "",
"unsubscribeOrigin": "",
"funnel": "sales",
"subscribeSource": {
"channel": "CONTACT_BOOK",
"id": "book-001",
"name": "Main Contact Book"
},
"campaigns": [],
"scenarios": []
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48101",
"email": "alice@example.com",
"createdAt": "2026-04-10T08:00:00Z",
"name": "Alice Tan",
"firstname": "Alice",
"lastname": "Tan",
"dayOfBirth": "1995-06-12",
"gender": "FEMALE",
"phone": "+628123456789",
"city": "Jakarta",
"country": "Indonesia",
"note": "Lead from enterprise form",
"company": "Mailtarget",
"customPeriod": [],
"customField": {
"source": "landing-page"
},
"labels": [
"enterprise",
"trial"
],
"segments": [
"segment-a"
],
"index": "contacts-main",
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false,
"unsubscribeReason": "",
"unsubscribeOrigin": "",
"funnel": "sales",
"subscribeSource": {
"channel": "CONTACT_BOOK",
"id": "book-001",
"name": "Main Contact Book"
},
"campaigns": [],
"scenarios": []
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/contacts' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "alice@example.com",
"name": "Alice Tan",
"firstname": "Alice",
"lastname": "Tan",
"city": "Jakarta",
"country": "Indonesia",
"labels": ["enterprise"],
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false
}'
/v1/contacts
Mengambil daftar contact dengan pagination dan pencarian sederhana.
{
"data": [
{
"_id": "66167a2b4f9b72a5c2f48101",
"email": "alice@example.com",
"createdAt": "2026-04-10T08:00:00Z",
"name": "Alice Tan",
"firstname": "Alice",
"lastname": "Tan",
"dayOfBirth": "1995-06-12",
"gender": "FEMALE",
"phone": "+628123456789",
"city": "Jakarta",
"country": "Indonesia",
"note": "Lead from enterprise form",
"company": "Mailtarget",
"customPeriod": [],
"customField": {
"source": "landing-page"
},
"labels": [
"enterprise",
"trial"
],
"segments": [
"segment-a"
],
"index": "contacts-main",
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false,
"unsubscribeReason": "",
"unsubscribeOrigin": "",
"funnel": "sales",
"subscribeSource": {
"channel": "CONTACT_BOOK",
"id": "book-001",
"name": "Main Contact Book"
},
"campaigns": [],
"scenarios": []
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 100
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/contacts?page=1&perPage=20&search=alice' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v1/contacts/:id
Mengambil detail satu contact berdasarkan ID.
{
"data": {
"_id": "66167a2b4f9b72a5c2f48101",
"email": "alice@example.com",
"createdAt": "2026-04-10T08:00:00Z",
"name": "Alice Tan",
"firstname": "Alice",
"lastname": "Tan",
"dayOfBirth": "1995-06-12",
"gender": "FEMALE",
"phone": "+628123456789",
"city": "Jakarta",
"country": "Indonesia",
"note": "Lead from enterprise form",
"company": "Mailtarget",
"customPeriod": [],
"customField": {
"source": "landing-page"
},
"labels": [
"enterprise",
"trial"
],
"segments": [
"segment-a"
],
"index": "contacts-main",
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false,
"unsubscribeReason": "",
"unsubscribeOrigin": "",
"funnel": "sales",
"subscribeSource": {
"channel": "CONTACT_BOOK",
"id": "book-001",
"name": "Main Contact Book"
},
"campaigns": [],
"scenarios": []
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/contacts/66167a2b4f9b72a5c2f48101' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v1/contacts/:id
Memperbarui data contact secara partial berdasarkan ID.
{
"email": "alice.updated@example.com",
"name": "Alice Updated",
"city": "Bandung",
"country": "Indonesia",
"labels": [
"enterprise"
],
"customField": {
"source": "api-update"
}
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48101",
"email": "alice.updated@example.com",
"createdAt": "2026-04-10T08:00:00Z",
"name": "Alice Updated",
"firstname": "Alice",
"lastname": "Tan",
"dayOfBirth": "1995-06-12",
"gender": "FEMALE",
"phone": "+628123456789",
"city": "Bandung",
"country": "Indonesia",
"note": "Lead from enterprise form",
"company": "Mailtarget",
"customPeriod": [],
"customField": {
"source": "api-update"
},
"labels": [
"enterprise"
],
"segments": [
"segment-a"
],
"index": "contacts-main",
"state": "ACTIVE",
"deletedState": "ACTIVE",
"tester": false,
"unsubscribeReason": "",
"unsubscribeOrigin": "",
"funnel": "sales",
"subscribeSource": {
"channel": "CONTACT_BOOK",
"id": "book-001",
"name": "Main Contact Book"
},
"campaigns": [],
"scenarios": []
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/contacts/66167a2b4f9b72a5c2f48101' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "alice.updated@example.com",
"name": "Alice Updated",
"city": "Bandung",
"country": "Indonesia",
"labels": ["enterprise"]
}'
/v1/contacts/:id
Menghapus contact berdasarkan ID.
{
"message": "Contact deleted successfully"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/contacts/66167a2b4f9b72a5c2f48101' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Import / Export
Bulk import contacts from CSV/JSON files and export your contact lists for backup or migration.
/v?/contacts/import
Membuat job import contacts secara asynchronous dari payload CSV atau JSON yang di-encode.
{
"format": "csv",
"data": "ZW1haWwsbmFtZQphbGljZUBleGFtcGxlLmNvbSxBbGljZQ==",
"labelIds": [
"66167a2b4f9b72a5c2f48201"
]
}
{
"data": {
"_id": "imp_001",
"status": "pending",
"totalRows": 0,
"imported": 0,
"skipped": 0,
"failed": 0,
"labelIds": [
"66167a2b4f9b72a5c2f48201"
],
"createdAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/contacts/import' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"format": "csv",
"data": "ZW1haWwsbmFtZQphbGljZUBleGFtcGxlLmNvbSxBbGljZQ==",
"labelIds": ["66167a2b4f9b72a5c2f48201"]
}'
/v?/contacts/export
Membuat job export contacts secara asynchronous berdasarkan filter yang diberikan.
{
"format": "csv",
"labelIds": [
"66167a2b4f9b72a5c2f48201"
],
"query": "jakarta"
}
{
"data": {
"_id": "exp_001",
"status": "pending",
"totalRows": 0,
"format": "csv",
"createdAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/contacts/export' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"format": "csv",
"labelIds": ["66167a2b4f9b72a5c2f48201"],
"query": "jakarta"
}'
/v?/contacts/export/:id
Mengambil status export job dan download URL jika file sudah selesai dibuat.
{
"data": {
"_id": "exp_001",
"status": "completed",
"totalRows": 500,
"format": "csv",
"downloadUrl": "https://storage.mailtarget.co/exports/exp_001.csv",
"createdAt": "2026-04-10T08:00:00Z",
"completedAt": "2026-04-10T08:02:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/contacts/export/exp_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Labels
Organize contacts into color-coded groups for easier targeting and segmentation.
/v?/labels
Membuat label baru untuk grouping contact.
{
"name": "VIP",
"description": "Contacts with high purchase intent",
"color": "#FF6B6B"
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48201",
"name": "VIP",
"description": "Contacts with high purchase intent",
"color": "#FF6B6B",
"contactCount": 0,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/labels' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "VIP",
"description": "Contacts with high purchase intent",
"color": "#FF6B6B"
}'
/v?/labels
Mengambil daftar label dengan pagination dan pencarian sederhana.
{
"data": [
{
"_id": "66167a2b4f9b72a5c2f48201",
"name": "VIP",
"description": "Contacts with high purchase intent",
"color": "#FF6B6B",
"contactCount": 42,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/labels?page=1&perPage=20&search=vip' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/labels/:id
Mengambil detail satu label berdasarkan ID.
{
"data": {
"_id": "66167a2b4f9b72a5c2f48201",
"name": "VIP",
"description": "Contacts with high purchase intent",
"color": "#FF6B6B",
"contactCount": 42,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/labels/66167a2b4f9b72a5c2f48201' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/labels/:id
Memperbarui label secara partial berdasarkan ID.
{
"name": "VIP Customers",
"description": "Updated label description",
"color": "#4ECDC4"
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48201",
"name": "VIP Customers",
"description": "Updated label description",
"color": "#4ECDC4",
"contactCount": 42,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/labels/66167a2b4f9b72a5c2f48201' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "VIP Customers",
"description": "Updated label description",
"color": "#4ECDC4"
}'
/v?/labels/:id
Menghapus label berdasarkan ID.
{
"data": {
"deleted": true
}
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/labels/66167a2b4f9b72a5c2f48201' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Segments
Create dynamic contact groups based on rules and conditions (e.g. opened last campaign, location, custom field values).
/v?/segments
Membuat segment baru untuk grouping contact berbasis rules.
{
"name": "Active Jakarta Contacts",
"description": "Contacts from Jakarta with active subscription",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
},
{
"field": "state",
"operator": "equals",
"value": "ACTIVE"
}
]
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48301",
"name": "Active Jakarta Contacts",
"description": "Contacts from Jakarta with active subscription",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
],
"contactCount": 0,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/segments' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Active Jakarta Contacts",
"description": "Contacts from Jakarta with active subscription",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
]
}'
/v?/segments
Mengambil daftar segment dengan pagination dan pencarian sederhana.
{
"data": [
{
"_id": "66167a2b4f9b72a5c2f48301",
"name": "Active Jakarta Contacts",
"description": "Contacts from Jakarta with active subscription",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
],
"contactCount": 128,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/segments?page=1&perPage=20&search=jakarta' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/segments/:id
Mengambil detail satu segment berdasarkan ID.
{
"data": {
"_id": "66167a2b4f9b72a5c2f48301",
"name": "Active Jakarta Contacts",
"description": "Contacts from Jakarta with active subscription",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
],
"contactCount": 128,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/segments/66167a2b4f9b72a5c2f48301' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/segments/:id
Memperbarui segment secara partial berdasarkan ID.
{
"name": "High Value Jakarta Contacts",
"description": "Updated segment description",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
},
{
"field": "tester",
"operator": "equals",
"value": false
}
]
}
{
"data": {
"_id": "66167a2b4f9b72a5c2f48301",
"name": "High Value Jakarta Contacts",
"description": "Updated segment description",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
],
"contactCount": 128,
"createdAt": "2026-04-10T08:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/segments/66167a2b4f9b72a5c2f48301' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "High Value Jakarta Contacts",
"description": "Updated segment description",
"rules": [
{
"field": "city",
"operator": "equals",
"value": "Jakarta"
}
]
}'
/v?/segments/:id
Menghapus segment berdasarkan ID.
{
"data": {
"deleted": true
}
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/segments/66167a2b4f9b72a5c2f48301' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Recipient Lists
Create named lists of email addresses for quick targeting. Useful for one-off sends to specific groups.
/v?/recipient-lists
Membuat recipient list baru.
{
"name": "Newsletter Subscribers",
"description": "Active newsletter recipients",
"recipients": ["user1@example.com", "user2@example.com"]
}
{
"data": {
"_id": "rl_001",
"name": "Newsletter Subscribers",
"description": "Active newsletter recipients",
"totalCount": 2,
"recipients": ["user1@example.com", "user2@example.com"],
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/recipient-lists' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Newsletter Subscribers",
"description": "Active newsletter recipients",
"recipients": ["user1@example.com", "user2@example.com"]
}'
/v?/recipient-lists
Mengambil daftar recipient lists dengan pagination dan search.
{
"data": [
{
"_id": "rl_001",
"name": "Newsletter Subscribers",
"description": "Active newsletter recipients",
"totalCount": 2,
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/recipient-lists?page=1&perPage=20&search=newsletter' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/recipient-lists/:id
Mengambil detail recipient list berdasarkan ID.
{
"data": {
"_id": "rl_001",
"name": "Newsletter Subscribers",
"description": "Active newsletter recipients",
"totalCount": 2,
"recipients": ["user1@example.com", "user2@example.com"],
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/recipient-lists/rl_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/recipient-lists/:id
Mengupdate recipient list berdasarkan ID.
{
"name": "VIP Subscribers",
"description": "Updated description",
"recipients": ["user1@example.com", "user3@example.com"]
}
{
"data": {
"_id": "rl_001",
"name": "VIP Subscribers",
"description": "Updated description",
"totalCount": 2,
"recipients": ["user1@example.com", "user3@example.com"],
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:05:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/recipient-lists/rl_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "VIP Subscribers",
"description": "Updated description",
"recipients": ["user1@example.com", "user3@example.com"]
}'
/v?/recipient-lists/:id
Menghapus recipient list berdasarkan ID.
{
"message": "Recipient list deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/recipient-lists/rl_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Contact Activity
View the complete engagement history of a specific contact: every email sent, opened, clicked, and bounced.
/v?/contacts/:id/activity
Mengambil activity log (events) untuk contact tertentu dengan pagination.
{
"data": [
{
"event": "open",
"timestamp": "2026-04-10T10:00:00Z",
"campaignId": "cmp_001",
"messageId": "msg_001",
"metadata": {
"userAgent": "Mozilla/5.0",
"ip": "203.0.113.1"
}
},
{
"event": "click",
"timestamp": "2026-04-10T10:01:00Z",
"campaignId": "cmp_001",
"messageId": "msg_001",
"metadata": {
"url": "https://example.com/promo"
}
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 2
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/contacts/cnt_001/activity?page=1&perPage=20' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Mailing Lists
Create and manage mailing lists with addresses, member management, and bulk operations.
/v?/mailing-lists
Mengambil daftar mailing lists dengan pagination.
{
"data": [
{
"_id": "ml_001",
"address": "newsletter@lists.example.com",
"name": "Newsletter",
"description": "Monthly newsletter",
"memberCount": 1500,
"createdAt": "2026-04-10T10:00:00Z"
}
],
"meta": { "page": 1, "perPage": 20, "total": 1 }
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/mailing-lists?page=1&perPage=20' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/mailing-lists
Membuat mailing list baru.
{
"address": "newsletter@lists.example.com",
"name": "Newsletter",
"description": "Monthly newsletter"
}
{
"data": {
"_id": "ml_001",
"address": "newsletter@lists.example.com",
"name": "Newsletter",
"description": "Monthly newsletter",
"memberCount": 0,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id
Mengambil detail mailing list berdasarkan ID.
{
"data": {
"_id": "ml_001",
"address": "newsletter@lists.example.com",
"name": "Newsletter",
"description": "Monthly newsletter",
"memberCount": 1500,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id
Mengupdate mailing list.
{
"name": "Updated Newsletter",
"description": "Weekly newsletter"
}
{
"data": {
"_id": "ml_001",
"address": "newsletter@lists.example.com",
"name": "Updated Newsletter",
"description": "Weekly newsletter",
"memberCount": 1500,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id
Menghapus mailing list.
{
"message": "Mailing list deleted"
}
/v?/mailing-lists/:id/members
Mengambil daftar members dari mailing list dengan pagination.
{
"data": [
{
"email": "user@example.com",
"name": "John Doe",
"vars": { "company": "Acme" },
"subscribed": true,
"createdAt": "2026-04-10T10:00:00Z"
}
],
"meta": { "page": 1, "perPage": 20, "total": 1 }
}
/v?/mailing-lists/:id/members
Menambahkan member ke mailing list.
{
"email": "user@example.com",
"name": "John Doe",
"vars": { "company": "Acme" }
}
{
"data": {
"email": "user@example.com",
"name": "John Doe",
"vars": { "company": "Acme" },
"subscribed": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id/members/bulk
Bulk add members ke mailing list.
{
"members": [
{ "email": "user1@example.com", "name": "User 1" },
{ "email": "user2@example.com", "name": "User 2" }
]
}
{
"data": {
"added": 2,
"skipped": 0
}
}
/v?/mailing-lists/:id/members/:email
Mengambil detail member dari mailing list.
{
"data": {
"email": "user@example.com",
"name": "John Doe",
"vars": { "company": "Acme" },
"subscribed": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id/members/:email
Mengupdate member mailing list.
{
"name": "Updated Name",
"subscribed": false
}
{
"data": {
"email": "user@example.com",
"name": "Updated Name",
"vars": { "company": "Acme" },
"subscribed": false,
"createdAt": "2026-04-10T10:00:00Z"
}
}
/v?/mailing-lists/:id/members/:email
Menghapus member dari mailing list.
{
"message": "Member removed"
}
Custom Fields
Define custom data fields for contacts beyond the defaults (e.g. company, industry, plan). Used for personalization and segmentation.
/v?/custom-fields
Mengambil semua custom field definitions. CustomFieldDef: `{_id, name, fieldType, createdAt}`
{
"data": [
{ "_id": "cf_001", "name": "company", "fieldType": "text", "createdAt": "2026-04-10T10:00:00Z" }
]
}
/v?/custom-fields
Membuat custom field baru. Body: `{name, fieldType}`. Default fieldType="text". Validation: NAME_REQUIRED.
{
"data": { "_id": "cf_002", "name": "industry", "fieldType": "text", "createdAt": "2026-04-10T10:00:00Z" }
}
/v?/custom-fields/:id
Update custom field. Body: `{name, fieldType}`. Error: 404=CUSTOM_FIELD_NOT_FOUND
/v?/custom-fields/:id
Delete custom field. Response: `{"message": "Custom field deleted"}`. Error: 404=CUSTOM_FIELD_NOT_FOUND
Webhooks
Receive real-time event notifications (delivered, opened, clicked, bounced, etc.) via HTTP callbacks to your server.
/v?/webhooks
cURL Example
curl -X POST https://apiconfig.mailtarget.co/v?/webhooks \
-H "Authorization: Bearer MAILTARGET_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Delivery notifications",
"targetUrl": "https://example.com/webhook",
"eventIds": [1, 3]
}'
/v?/webhooks
cURL Example
curl -X GET "https://apiconfig.mailtarget.co/v?/webhooks?page=1&perPage=20" \
-H "Authorization: Bearer MAILTARGET_API_KEY"
/v?/webhooks/:id
cURL Example
curl -X DELETE https://apiconfig.mailtarget.co/v?/webhooks/42 \
-H "Authorization: Bearer MAILTARGET_API_KEY"
Webhook Testing
Send test events to your webhook URLs to verify they are correctly configured before going live.
/v?/webhooks/:id/test
Mengirim test event ke webhook URL untuk memverifikasi konfigurasi.
{
"data": {
"webhookId": "wh_001",
"testStatus": "success",
"responseCode": 200,
"responseTime": 120,
"sentAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/webhooks/wh_001/test' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/webhooks/:id/batch-status
Mengambil status batch delivery webhook (jumlah pending, delivered, failed).
{
"data": {
"webhookId": "wh_001",
"pending": 5,
"delivered": 142,
"failed": 3,
"lastDelivered": "2026-04-10T09:55:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/webhooks/wh_001/batch-status' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Relay Webhooks
Forward incoming emails to your application. Configure which inbound domains relay to which webhook URLs.
/v?/relay-webhooks
Membuat relay webhook baru untuk forwarding inbound email ke URL tertentu.
{
"name": "Support Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/inbound",
"authToken": "secret-token-123"
}
{
"data": {
"_id": "rw_001",
"name": "Support Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/inbound",
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/relay-webhooks' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Support Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/inbound",
"authToken": "secret-token-123"
}'
/v?/relay-webhooks
Mengambil semua relay webhooks.
{
"data": [
{
"_id": "rw_001",
"name": "Support Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/inbound",
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/relay-webhooks' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/relay-webhooks/:id
Mengambil detail relay webhook berdasarkan ID.
{
"data": {
"_id": "rw_001",
"name": "Support Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/inbound",
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/relay-webhooks/rw_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/relay-webhooks/:id
Mengupdate relay webhook.
{
"name": "Updated Relay",
"targetUrl": "https://app.example.com/webhooks/v2/inbound",
"active": false
}
{
"data": {
"_id": "rw_001",
"name": "Updated Relay",
"domain": "inbound.example.com",
"targetUrl": "https://app.example.com/webhooks/v2/inbound",
"active": false,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/relay-webhooks/rw_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Updated Relay",
"targetUrl": "https://app.example.com/webhooks/v2/inbound",
"active": false
}'
/v?/relay-webhooks/:id
Menghapus relay webhook.
{
"message": "Relay webhook deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/relay-webhooks/rw_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Webhook Security
Manage HMAC signing policies for webhook payloads. Verify webhook authenticity and prevent spoofing.
/v?/webhooks/security
Mengambil semua security policies. Policy: `{_id, name, enabled, createdAt}` (signingKey hanya via dedicated `/signing-key` route)
/v?/webhooks/security
Membuat security policy baru. Body: `{name, enabled}`. Response (201).
/v?/webhooks/security/:id
Get by ID. Error: 404=WEBHOOK_SECURITY_POLICY_NOT_FOUND
/v?/webhooks/security/:id
Update policy. Error: 404=WEBHOOK_SECURITY_POLICY_NOT_FOUND
/v?/webhooks/security/:id
Delete policy. Response: `{"message": "Security policy deleted"}`. Error: 404=WEBHOOK_SECURITY_POLICY_NOT_FOUND
/v?/webhooks/security/:id/signing-key
Mengambil HMAC signing key untuk policy.
/v?/webhooks/security/:id/signing-key
Toggle/update webhook signing. Body: `{enabled: true}`
Webhook Egress
Configure outbound webhook delivery behavior: rate limiting, batching, retry policies, and delivery statistics.
/v?/webhooks/egress-config
Mengambil konfigurasi webhook egress (rate limiting, batching, retry).
{
"data": {
"maxPerSecond": 100,
"batchingEnabled": true,
"batchSize": 50,
"batchWindowMs": 5000,
"retryEnabled": true,
"maxRetries": 5,
"retryBackoffMs": 1000
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/webhooks/egress-config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/webhooks/egress-config
Mengupdate konfigurasi webhook egress.
{
"maxPerSecond": 200,
"batchingEnabled": true,
"batchSize": 100,
"batchWindowMs": 3000,
"retryEnabled": true,
"maxRetries": 3,
"retryBackoffMs": 2000
}
{
"data": {
"maxPerSecond": 200,
"batchingEnabled": true,
"batchSize": 100,
"batchWindowMs": 3000,
"retryEnabled": true,
"maxRetries": 3,
"retryBackoffMs": 2000
}
}
cURL Example
curl --request PATCH 'https://api.mailtarget.co/v1/webhooks/egress-config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"maxPerSecond": 200,
"batchingEnabled": true,
"batchSize": 100,
"batchWindowMs": 3000,
"retryEnabled": true,
"maxRetries": 3,
"retryBackoffMs": 2000
}'
/v?/webhooks/egress-stats
Mengambil statistik webhook egress (delivery rates, failures, queue depth).
{
"data": {
"totalDelivered": 15230,
"totalFailed": 42,
"totalPending": 8,
"avgLatencyMs": 120,
"successRate": 99.7
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/webhooks/egress-stats' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Campaign Analytics
Track campaign performance: open rates, click rates, bounce rates, unsubscribes, and engagement over time.
/v?/campaigns/:id/analytics
cURL Example
curl -X GET https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b4c5d6e7f8a9b0c1d/analytics \
-H "Authorization: Bearer {API_KEY}"
/v?/campaigns/:id/recipients
cURL Example
curl -X GET "https://apiconfig.mailtarget.co/v?/campaigns/663f1a2b/recipients?page=1&perPage=20&status=bounced" \
-H "Authorization: Bearer {API_KEY}"
Message Events
Query the event stream for individual messages: delivery attempts, opens, clicks, bounces, and complaints.
/v?/events
Query: `page`, `perPage`, `event` (delivered/opened/clicked/bounced/complained/unsubscribed), `email`, `dateFrom`, `dateTo`, `campaignId`.
/v?/events/:messageId
All events for a specific message, ordered chronologically.
Deliverability
Monitor inbox placement rates, spam folder rates, and domain reputation across major mailbox providers.
/v?/deliverability/report
Overall deliverability report.
/v?/deliverability/domains
Per-domain breakdown. Query: `page`, `perPage`.
/v?/deliverability/reputation
Reputation score + trend. Query: `dateFrom`, `dateTo`.
Stats Aggregate
Get aggregated sending statistics across all campaigns: total sent, delivered, opened, clicked, bounced over configurable time periods.
/v?/stats
Query: `dateFrom`, `dateTo`, `aggregatedBy` (day/week/month).
/v?/stats/categories
Stats grouped by transmission category. Same query params.
/v?/stats/mailbox-providers
By ISP. `{ "data": [{ "provider": "Gmail", "delivered": 2000, "opens": 900, "inboxRate": 98.5 }] }`
/v?/stats/devices
`{ "data": [{ "device": "mobile", "opens": 1200, "clicks": 400, "percentage": 57.1 }] }`
/v?/stats/geo
Query: optional `country`. `{ "data": [{ "country": "ID", "city": "Jakarta", "opens": 800, "clicks": 300 }] }`
/v?/stats/browsers
`{ "data": [{ "client": "Gmail", "opens": 900, "percentage": 42.8 }, { "client": "Apple Mail", "opens": 500, "percentage": 23.8 }] }`
Advanced Metrics
Drill down into sending metrics by IP, template, subaccount, bounce reason, delay reason, and link engagement.
/v?/metrics/sending-ip
Mengambil breakdown metrics berdasarkan sending IP.
{
"data": [
{
"key": "192.0.2.10",
"label": "IP Pool A",
"count": 15230,
"percentage": 62.3
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/sending-ip?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/template
Mengambil breakdown metrics berdasarkan template.
{
"data": [
{
"key": "tpl_001",
"label": "Welcome Email",
"count": 8420,
"percentage": 34.5
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/template?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/subaccount
Mengambil breakdown metrics berdasarkan subaccount.
{
"data": [
{
"key": "sub_001",
"label": "Marketing Team",
"count": 12000,
"percentage": 49.1
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/subaccount?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/bounce-reasons
Mengambil breakdown alasan bounce.
{
"data": [
{
"key": "550",
"label": "Mailbox not found",
"count": 342,
"percentage": 68.4
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/bounce-reasons?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/bounce-classifications
Mengambil breakdown klasifikasi bounce (hard, soft, etc.).
{
"data": [
{
"key": "hard",
"count": 230,
"percentage": 46.0
},
{
"key": "soft",
"count": 270,
"percentage": 54.0
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/bounce-classifications?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/delay-reasons
Mengambil breakdown alasan delay pengiriman.
{
"data": [
{
"key": "throttled",
"label": "Remote server throttling",
"count": 89,
"percentage": 71.2
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/delay-reasons?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/metrics/link-engagement
Mengambil breakdown link engagement (click per link).
{
"data": [
{
"key": "https://example.com/promo",
"label": "Promo Link",
"count": 1523,
"percentage": 42.8
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/metrics/link-engagement?dateFrom=2026-04-01&dateTo=2026-04-10' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Email Activity
Search and export detailed message activity — every email sent, with recipient, status, and timestamp.
/v?/email-activity/messages
Mencari message activity dengan pagination dan filter.
{
"data": [
{
"id": "msg_001",
"to": "user@example.com",
"from": "sender@example.com",
"subject": "Welcome",
"status": "delivered",
"timestamp": "2026-04-10T10:00:00Z"
}
],
"meta": { "page": 1, "perPage": 20, "total": 1 }
}
/v?/email-activity/messages/:id
Mengambil detail message. Error: 404=MESSAGE_NOT_FOUND
/v?/email-activity/export
Request export message activity (async). Body: `{to, from, subject, status, dateFrom, dateTo}`.
{
"data": {
"downloadId": "exp_001",
"status": "pending"
}
}
/v?/email-activity/export/:id
Mengambil status export job. Error: 404=MESSAGE_EXPORT_NOT_FOUND
{
"data": {
"downloadId": "exp_001",
"status": "completed",
"downloadUrl": "https://export.mailtarget.co/exp_001.csv"
}
}
Engagement Quality
Get an overall engagement quality score for your account based on open rates, click rates, bounce rates, and complaint rates.
/v?/engagement/scores
Mengambil engagement quality scores untuk akun.
{
"data": {
"score": 85,
"metrics": {
"openRate": 32.5,
"clickRate": 8.2,
"bounceRate": 1.1,
"complaintRate": 0.02
}
}
}
/v?/engagement/subaccount-scores
Mengambil engagement scores per subaccount.
{
"data": [
{
"subaccountId": "sub_001",
"name": "Marketing Team",
"score": 82,
"openRate": 30.1,
"clickRate": 7.5
}
]
}
Marketing Stats
Get aggregated stats for marketing campaigns and automations, including per-link click tracking and CSV exports.
/v?/marketing-stats/campaigns
Mengambil stats semua campaigns (array of maps).
/v?/marketing-stats/campaigns/:id
Mengambil stats campaign by ID.
/v?/marketing-stats/campaigns/:id/links
Mengambil link-level stats untuk campaign.
/v?/marketing-stats/automations
Mengambil stats semua automations.
/v?/marketing-stats/automations/:id
Mengambil stats automation by ID.
/v?/marketing-stats/automations/:id/links
Mengambil link-level stats untuk automation.
/v?/marketing-stats/campaigns/export
Export campaign stats (async). Response (202): `{"data": {"downloadId": "...", "status": "pending"}}`
/v?/marketing-stats/automations/export
Export automation stats (async). Response (202).
Bounces
Track hard and soft bounces. Hard bounces are automatically suppressed to protect your sender reputation.
/v?/bounces
Mengambil daftar bounced emails dengan filter opsional.
{
"data": [
{
"email": "invalid@example.com",
"type": "hard",
"reason": "mailbox does not exist",
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"bouncedAt": "2026-04-10T08:05:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 15
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/bounces?page=1&perPage=20&type=hard&campaignId=663f1a2b4c5d6e7f8a9b0c1d' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Suppression
Manage the global suppression list. Addresses on this list will not receive any emails regardless of campaign or list membership.
/v?/suppression
/v?/suppression/:email
cURL Example
curl -X DELETE https://apiconfig.mailtarget.co/v?/suppression/bounce@example.com \
-H "Authorization: Bearer {API_KEY}"
Unsubscribes
View and manage contacts who have opted out of receiving emails. Required for CAN-SPAM and GDPR compliance.
/v?/unsubscribes
Mengambil daftar kontak yang sudah unsubscribe.
{
"data": [
{
"email": "user@example.com",
"reason": "Requested via support",
"origin": "api",
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"unsubscribedAt": "2026-04-10T08:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 42
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/unsubscribes?page=1&perPage=20&search=user@example.com' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/unsubscribes
Menambahkan email ke unsubscribe list secara manual.
{
"email": "user@example.com",
"reason": "Requested via support",
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d"
}
{
"data": {
"email": "user@example.com",
"reason": "Requested via support",
"origin": "api",
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d",
"unsubscribedAt": "2026-04-10T08:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/unsubscribes' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com",
"reason": "Requested via support",
"campaignId": "663f1a2b4c5d6e7f8a9b0c1d"
}'
Block List
Manually block specific email addresses or domains from receiving any emails from your account.
/v?/blocks
Query: `page`, `perPage`, `search`.
/v?/blocks/:email
Response: `{ "message": "Email unblocked" }`
Spam Reports
View contacts who marked your emails as spam. These addresses are automatically suppressed.
/v?/spam-reports
Query: `page`, `perPage`, `dateFrom`, `dateTo`.
/v?/spam-reports/:email
Response: `{ "message": "Spam report removed" }`
Unsubscribe Groups
Let contacts opt out of specific email types (marketing, updates, etc.) instead of unsubscribing from everything.
/v?/unsubscribe-groups
{ "name": "Marketing", "description": "Marketing emails opt-out" }
/v?/unsubscribe-groups
— GET /:id — PUT /:id — DELETE /:id
/v?/unsubscribe-groups/:id/emails
Add emails to group. `{ "emails": ["a@b.com", "c@d.com"] }`
/v?/unsubscribe-groups/:id/emails
List emails in group. Query: `page`, `perPage`.
/v?/unsubscribe-groups/:id/emails/:email
Remove email from group.
Bounce Extras
Access raw bounce diagnostic data and reactivate bounced addresses after fixing the underlying issue.
/v?/bounces/:id/dump
Mengambil raw bounce dump (full diagnostic data) berdasarkan bounce ID.
{
"data": {
"bounceId": "bnc_001",
"email": "user@example.com",
"type": "hard",
"diagnosticCode": "550 5.1.1 User unknown",
"mxHost": "mx.example.com",
"rawHeaders": "...",
"timestamp": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/bounces/bnc_001/dump' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/bounces/:id/reactivate
Reactivate bounced email — menghapus dari suppression list sehingga bisa dikirim lagi.
{
"message": "Bounce reactivated"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/bounces/bnc_001/reactivate' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Allowlist
Maintain a list of email addresses or domains that should always receive emails, bypassing suppression rules.
/v?/allowlist
Mengambil daftar allowlist entries dengan pagination.
{
"data": [
{
"value": "user@example.com",
"type": "email",
"createdAt": "2026-04-10T10:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/allowlist?page=1&perPage=20' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/allowlist/:value
Mengambil detail allowlist entry berdasarkan value (email/domain).
{
"data": {
"value": "user@example.com",
"type": "email",
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/allowlist/user@example.com' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/allowlist
Menambahkan entry ke allowlist.
{
"value": "user@example.com",
"type": "email"
}
{
"data": {
"value": "user@example.com",
"type": "email",
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/allowlist' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"value": "user@example.com",
"type": "email"
}'
/v?/allowlist/import
Import bulk allowlist entries.
{
"entries": [
{ "value": "user1@example.com", "type": "email" },
{ "value": "example.com", "type": "domain" }
]
}
{
"data": {
"imported": 2,
"skipped": 0
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/allowlist/import' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"entries": [
{ "value": "user1@example.com", "type": "email" },
{ "value": "example.com", "type": "domain" }
]
}'
/v?/allowlist/:value
Menghapus entry dari allowlist.
{
"message": "Entry removed"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/allowlist/user@example.com' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/allowlist
Menghapus semua entries dari allowlist.
{
"message": "All entries removed"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/allowlist' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Invalid Emails
View and manage email addresses that failed validation — syntax errors, nonexistent domains, or mailbox issues.
/v?/invalid-emails
Mengambil daftar invalid emails dengan pagination. InvalidEmail: `{email, reason, createdAt}`. Response includes `meta`.
/v?/invalid-emails/:email
Mengambil invalid email by email address. Error: 404=INVALID_EMAIL_NOT_FOUND. Validation: EMAIL_REQUIRED.
/v?/invalid-emails/:email
Menghapus satu invalid email. Response: `{"message": "Invalid email removed"}`. Error: 404=INVALID_EMAIL_NOT_FOUND.
/v?/invalid-emails
Menghapus semua invalid emails. Response: `{"message": "All invalid emails removed"}`
Senders
Configure the "from" addresses for your emails. Each sender requires domain verification for deliverability.
/v?/senders
Create sender identity. Required: `name`, `email`.
/v?/senders
Query: `page`, `perPage`, `search`. Response: array + meta.
/v?/senders/:id
— PUT /v?/senders/:id — DELETE /v?/senders/:id
/v?/senders/:id/verify
Trigger verification email. Response: `{ "message": "Verification email sent" }`
Tracking Domains
Set up custom domains for click and open tracking links instead of the default Mailtarget domain.
/v?/tracking-domains
Required: `domain`.
/v?/tracking-domains
— GET /v?/tracking-domains/:id — DELETE /v?/tracking-domains/:id
/v?/tracking-domains/:id/verify
Verify CNAME record. Response: updated object with `verified: true` or error.
Alerts
Configure notifications for important events: quota approaching limit, bounce rate spike, blocklist detection.
/v?/alerts
{ "type": "bounce_rate", "threshold": 5.0, "channel": "email" }
/v?/alerts
— GET /v?/alerts/:id — PUT /v?/alerts/:id — DELETE /v?/alerts/:id
Integrations
Connect Mailtarget with third-party services. Manage integration configurations and credentials.
/v?/integrations
Mengambil semua integrations. Response: `{"data": [{_id, name, provider, config, active, createdAt}]}`
/v?/integrations
Membuat integration baru. Body: `{name, provider, config, active}`. Response (201): `{"data": {...}}`
/v?/integrations/:id
Mengambil detail integration. Error: 404=INTEGRATION_NOT_FOUND
/v?/integrations/:id
Mengupdate integration. Error: 404=INTEGRATION_NOT_FOUND
/v?/integrations/:id
Menghapus integration. Response: `{"message": "Integration deleted"}`. Error: 404=INTEGRATION_NOT_FOUND
/v?/integrations/bulk
Bulk delete integrations. Body: `{"ids": ["id1","id2"]}`. Response: `{"message": "Integrations deleted"}`
Mail Settings
Configure account-wide email settings: footer, bounce purge policy, forward bounce/spam, address whitelist, and template defaults.
/v?/mail-settings
Mengambil daftar semua mail settings. Response: `{"data": [{name, enabled}]}`
/v?/mail-settings/bounce-purge
Mengambil bounce purge setting. Response: `{"data": {enabled, hardBouncesPurgeAfterDays, softBouncesPurgeAfterDays}}`
/v?/mail-settings/bounce-purge
Update bounce purge. Body: `{enabled, hardBouncesPurgeAfterDays, softBouncesPurgeAfterDays}`
/v?/mail-settings/forward-bounce
Mengambil forward bounce setting. Response: `{"data": {enabled, email}}`
/v?/mail-settings/forward-bounce
Update forward bounce. Body: `{enabled, email}`
/v?/mail-settings/forward-spam
Mengambil forward spam setting. Response: `{"data": {enabled, email}}`
/v?/mail-settings/forward-spam
Update forward spam. Body: `{enabled, email}`
/v?/mail-settings/address-whitelist
Mengambil address whitelist config.
/v?/mail-settings/address-whitelist
Update address whitelist.
/v?/mail-settings/template
Mengambil template setting.
/v?/mail-settings/template
Update template setting.
Tracking Settings
Enable or disable click tracking, open tracking, Google Analytics UTM parameters, and subscription tracking.
/v?/tracking-settings
Mengambil daftar semua tracking settings (array of maps).
/v?/tracking-settings/click
Mengambil click tracking config.
/v?/tracking-settings/click
Update click tracking. Body: `{enabled: true}`
/v?/tracking-settings/open
Mengambil open tracking config.
/v?/tracking-settings/open
Update open tracking.
/v?/tracking-settings/google-analytics
Mengambil Google Analytics tracking config.
/v?/tracking-settings/google-analytics
Update GA tracking. Body: `{enabled, utmSource, utmMedium, utmCampaign}`
/v?/tracking-settings/subscription
Mengambil subscription tracking config.
/v?/tracking-settings/subscription
Update subscription tracking.
Verified Senders
Register and verify sender identities (from addresses). Required before you can send email from a new address.
/v?/verified-senders
Mengambil semua verified senders (array of maps).
/v?/verified-senders
Membuat verified sender baru. Body: `{fromEmail, fromName, replyTo, nickname}`. Response (201).
/v?/verified-senders/:id
Mengupdate verified sender.
/v?/verified-senders/:id
Menghapus verified sender. Response: `{"message": "Verified sender deleted"}`
/v?/verified-senders/:id/resend
Mengirim ulang verification email. Response: `{"message": "Verification resent"}`
/v?/verified-senders/:id/steps-completed
Mengambil completed verification steps untuk sender.
/v?/verified-senders/:id/domain-warnings
Mengambil domain warnings (SPF/DKIM issues) untuk sender.
/v?/verified-senders/verify
Verify sender menggunakan token dari email. Body: `{"token": "..."}`. Response: `{"message": "Sender verified"}`
IP Addresses
Manage your dedicated sending IP addresses, including warmup status and assignment to pools.
/v?/ips
Query: `page`, `perPage`, `poolId`, `warmupStatus`.
/v?/ips/:id
/v?/ips/:id/warmup
Start IP warmup schedule. Response: `{ "data": { "id": 1, "warmupStatus": "in_progress", "warmupStartedAt": "..." } }`
/v?/ips/:id/warmup
Stop warmup. Response: `{ "message": "Warmup stopped" }`
IP Pools
Group dedicated IPs into pools and assign them to different sending streams (transactional vs marketing) to isolate reputation.
/v?/ip-pools
Create pool. Required: `name`.
/v?/ip-pools
— GET /v?/ip-pools/:id — PUT /v?/ip-pools/:id — DELETE /v?/ip-pools/:id
SMTP Credentials
Generate SMTP username/password pairs for sending email via SMTP relay instead of the REST API.
/v?/smtp-credentials
Response (201) — password shown ONLY on creation:
/v?/smtp-credentials
List. Password masked.
/v?/smtp-credentials/:id
Response: `{ "message": "SMTP credential deleted" }`
Domain Auth
Set up SPF, DKIM, and DMARC authentication for your sending domains to improve deliverability and prevent spoofing.
/v?/domain-auth
List all. `{ "data": [{ "id": 1, "domain": "example.com", "spfStatus": "verified", "dkimStatus": "verified", "dmarcStatus": "pending" }] }`
/v?/domain-auth/:id
Full details.
/v?/domain-auth/:id/verify
Trigger DNS verification. Response: updated status.
/v?/domain-auth/:id/dns-records
Get required DNS records to add.
Link Branding
Replace default tracking links with your own branded domain (e.g. links.yourdomain.com) for better click-through rates and trust.
/v?/link-branding
Membuat branded link domain baru.
{
"domain": "links.example.com"
}
{
"data": {
"id": 1,
"domain": "links.example.com",
"verified": false,
"isDefault": false,
"dns": {
"cname1": {
"host": "links.example.com",
"value": "sendlinks.mailtarget.co",
"valid": false
},
"cname2": {
"host": "12345.links.example.com",
"value": "sendlinks2.mailtarget.co",
"valid": false
}
},
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/link-branding' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "links.example.com"
}'
/v?/link-branding
Mengambil semua branded link domains.
{
"data": [
{
"id": 1,
"domain": "links.example.com",
"verified": true,
"isDefault": true,
"dns": {
"cname1": {
"host": "links.example.com",
"value": "sendlinks.mailtarget.co",
"valid": true
},
"cname2": {
"host": "12345.links.example.com",
"value": "sendlinks2.mailtarget.co",
"valid": true
}
},
"createdAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/link-branding' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/link-branding/:id
Mengambil detail branded link berdasarkan ID.
{
"data": {
"id": 1,
"domain": "links.example.com",
"verified": true,
"isDefault": true,
"dns": {
"cname1": {
"host": "links.example.com",
"value": "sendlinks.mailtarget.co",
"valid": true
},
"cname2": {
"host": "12345.links.example.com",
"value": "sendlinks2.mailtarget.co",
"valid": true
}
},
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/link-branding/1' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/link-branding/:id
Mengupdate branded link domain.
{
"domain": "tracking.example.com"
}
{
"data": {
"id": 1,
"domain": "tracking.example.com",
"verified": false,
"isDefault": true,
"dns": {
"cname1": {
"host": "tracking.example.com",
"value": "sendlinks.mailtarget.co",
"valid": false
},
"cname2": {
"host": "12345.tracking.example.com",
"value": "sendlinks2.mailtarget.co",
"valid": false
}
},
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/link-branding/1' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "tracking.example.com"
}'
/v?/link-branding/:id
Menghapus branded link domain.
{
"message": "Branded link deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/link-branding/1' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/link-branding/:id/verify
Memverifikasi DNS records untuk branded link domain.
{
"data": {
"id": 1,
"domain": "links.example.com",
"verified": true,
"isDefault": true,
"dns": {
"cname1": {
"host": "links.example.com",
"value": "sendlinks.mailtarget.co",
"valid": true
},
"cname2": {
"host": "12345.links.example.com",
"value": "sendlinks2.mailtarget.co",
"valid": true
}
},
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/link-branding/1/verify' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Reverse DNS
Set up reverse DNS (PTR records) for your dedicated IPs. Improves deliverability by matching IP to your domain.
/v?/reverse-dns
Mengambil semua reverse DNS records. ReverseDNS: `{id (int), ip, rdns, subdomain, domain, valid, createdAt}`
/v?/reverse-dns
Membuat reverse DNS record baru (no body needed). Response (201).
/v?/reverse-dns/:id
Mengambil reverse DNS by ID. Error: 404=REVERSE_DNS_NOT_FOUND
/v?/reverse-dns/:id
Menghapus reverse DNS. Response: `{"message": "Reverse DNS deleted"}`. Error: 404=REVERSE_DNS_NOT_FOUND
/v?/reverse-dns/:id/validate
Memvalidasi reverse DNS record. Response: `{"data": {"valid": true}}`. Error: 404=REVERSE_DNS_NOT_FOUND
Inbound
Process incoming emails. Mailtarget receives emails on your behalf and forwards the parsed content to your application via webhooks.
/v?/inbound/routes
Required: `domain`, `forwardUrl`.
/v?/inbound/routes
— PUT /v?/inbound/routes/:id — DELETE /v?/inbound/routes/:id
/v?/inbound/messages
Query: `page`, `perPage`, `dateFrom`, `dateTo`.
/v?/inbound/messages/:id
Full message: from, to, subject, bodyText, bodyHtml, headers, attachments (with downloadUrl), receivedAt.
Inbound Domains
Register domains for receiving inbound email. Requires MX record verification.
/v?/inbound-domains
Menambahkan domain untuk inbound email processing.
{
"domain": "inbound.example.com"
}
{
"data": {
"_id": "ibd_001",
"domain": "inbound.example.com",
"mxVerified": false,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/inbound-domains' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "inbound.example.com"
}'
/v?/inbound-domains
Mengambil semua inbound domains.
{
"data": [
{
"_id": "ibd_001",
"domain": "inbound.example.com",
"mxVerified": true,
"createdAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/inbound-domains' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/inbound-domains/:id
Mengambil detail inbound domain berdasarkan ID.
{
"data": {
"_id": "ibd_001",
"domain": "inbound.example.com",
"mxVerified": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/inbound-domains/ibd_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/inbound-domains/:id
Menghapus inbound domain.
{
"message": "Inbound domain deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/inbound-domains/ibd_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Inbound Parse
Configure how incoming emails are parsed and forwarded. Set up hostname-to-URL routing with spam checking options.
/v?/inbound-parse/settings
Mengambil semua parse settings. ParseSetting: `{hostname, url, spamCheck, sendRaw}`
/v?/inbound-parse/settings
Membuat parse setting baru. Body: `{hostname, url, spamCheck, sendRaw}`. Validation: hostname required, url required. Response (201).
/v?/inbound-parse/settings/:hostname
Mengambil parse setting by hostname. Error: 404=PARSE_SETTING_NOT_FOUND
/v?/inbound-parse/settings/:hostname
Update parse setting. Error: 404=PARSE_SETTING_NOT_FOUND. Validation: HOSTNAME_REQUIRED.
/v?/inbound-parse/settings/:hostname
Hapus parse setting. Response: `{"message": "Parse setting deleted"}`. Error: 404=PARSE_SETTING_NOT_FOUND
/v?/inbound-parse/stats
Mengambil inbound parse statistics (array of maps).
Email Validation
Validate email addresses before sending to reduce bounces. Checks syntax, MX records, and mailbox existence.
/v?/validate/single
Body: `{ "email": "test@example.com" }`
/v?/validate/bulk
Body: `{ "emails": ["a@b.com", "c@d.com", ...] }`
/v?/validate/bulk/:id
Response (200) when completed:
Email Preview
Render email templates with sample data to preview how they look before sending.
/v?/preview/render
Render HTML with substitution data.
/v?/preview/spam-check
{ "html": "<h1>Buy now!!!</h1>", "subject": "FREE OFFER" }
/v?/preview/inbox
Preview across email clients. Async.
/v?/preview/inbox/:id
{ "data": { "_id": "prev_001", "status": "completed", "screenshots": [{ "client": "Gmail", "device": "desktop", "imageUrl": "https://..." }, { "client": "Apple Mail", "device": "mobile", "imageUrl": "https://..." }] } }
Seed Lists
Maintain lists of test email addresses used to verify inbox placement across different providers before sending to real contacts.
/v?/seed-lists
`{ "name": "Gmail seeds", "emails": ["seed1@gmail.com", "seed2@yahoo.com"] }`
/v?/seed-lists
— DELETE /v?/seed-lists/:id
/v?/seed-tests
Run inbox placement test.
/v?/seed-tests/:id
{ "data": { "_id": "st_001", "status": "completed", "results": [{ "email": "seed1@gmail.com", "provider": "Gmail", "inbox": true, "spam": false, "missing": false }, { "email": "seed2@yahoo.com", "provider": "Yahoo", "inbox": false, "spam": true, "missing": false }], "inboxRate": 50.0 } }
Email Testing
Test your email HTML for code compatibility, broken links, broken images, accessibility issues, and send test emails.
/v?/email-testing/code-analysis
Membuat code analysis baru — menganalisis HTML email untuk compatibility issues.
{
"html": "<html><body>Your email HTML</body></html>"
}
{
"data": {
"_id": "ca_001",
"status": "completed",
"issues": [],
"score": 95
}
}
/v?/email-testing/code-analysis/:id
Mengambil hasil code analysis berdasarkan ID.
{
"data": {
"_id": "ca_001",
"status": "completed",
"issues": [],
"score": 95
}
}
/v?/email-testing/code-analysis
Mengambil semua code analysis yang pernah dijalankan.
{
"data": [
{ "_id": "ca_001", "status": "completed", "score": 95 }
]
}
/v?/email-testing/link-validation
Membuat link validation — mengecek semua link dalam email HTML.
{
"html": "<html><body><a href='https://example.com'>Link</a></body></html>"
}
{
"data": {
"_id": "lv_001",
"status": "completed",
"totalLinks": 3,
"brokenLinks": 0
}
}
/v?/email-testing/link-validation/:id
Mengambil hasil link validation.
/v?/email-testing/link-validation
Mengambil semua link validations.
/v?/email-testing/image-validation
Membuat image validation — mengecek semua gambar dalam email.
{
"html": "<html><body><img src='https://example.com/img.png'/></body></html>"
}
{
"data": {
"_id": "iv_001",
"status": "completed",
"totalImages": 5,
"brokenImages": 1
}
}
/v?/email-testing/image-validation/:id
Mengambil hasil image validation.
/v?/email-testing/image-optimization
Optimize images dalam email HTML (resize, compress).
{
"html": "<html><body><img src='https://example.com/large.png'/></body></html>"
}
{
"data": {
"optimized": 3,
"totalSaved": "1.2MB"
}
}
/v?/email-testing/accessibility
Membuat accessibility check — mengecek email untuk WCAG compliance.
{
"html": "<html><body>...</body></html>"
}
{
"data": {
"_id": "ac_001",
"status": "completed",
"issues": [],
"score": 88
}
}
/v?/email-testing/accessibility/:id
Mengambil hasil accessibility check.
/v?/email-testing/accessibility
Mengambil semua accessibility checks.
/v?/email-testing/send-test
Mengirim test marketing email ke alamat tertentu.
{
"to": ["test@example.com"],
"subject": "Test Campaign",
"html": "<html><body>Preview</body></html>",
"from": "sender@example.com"
}
{
"message": "Test email sent"
}
Quotas
Check your account sending limits, current usage, and remaining quota for the billing period.
/v?/quotas
Current quota and rate limit usage.
/v?/quotas/history
Usage history. Query: `dateFrom`, `dateTo`, `aggregatedBy` (day/week/month).
Teammates
Invite team members to your account with role-based access (admin, editor, viewer).
/v?/teammates
Invite. `{ "email": "dev@mailtarget.co", "name": "Dev Team", "role": "developer" }`
/v?/teammates
— GET /:id — PUT /:id — DELETE /:id
/v?/teammates/:id/resend-invite
Response: `{ "message": "Invite resent" }`
Billing
View your current plan, download invoices, and check usage costs for the billing period.
/v?/billing/plan
Mengambil informasi billing plan saat ini.
{
"data": {
"name": "Business",
"type": "monthly",
"monthlyLimit": 100000,
"price": 99.00,
"currency": "USD",
"billingDate": "2026-05-01"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/billing/plan' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/billing/invoices
Mengambil daftar invoices dengan pagination.
{
"data": [
{
"_id": "inv_001",
"date": "2026-04-01",
"amount": 99.00,
"currency": "USD",
"status": "paid",
"pdfUrl": "https://billing.mailtarget.co/invoices/inv_001.pdf"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/billing/invoices?page=1&perPage=20' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/billing/invoices/:id
Mengambil detail invoice berdasarkan ID.
{
"data": {
"_id": "inv_001",
"date": "2026-04-01",
"amount": 99.00,
"currency": "USD",
"status": "paid",
"pdfUrl": "https://billing.mailtarget.co/invoices/inv_001.pdf"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/billing/invoices/inv_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/billing/usage
Mengambil billing usage (total sent dan cost) untuk periode tertentu.
{
"data": {
"totalSent": 45230,
"totalCost": 45.23
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/billing/usage?dateFrom=2026-04-01&dateTo=2026-04-30' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Subuser Management
Manage subuser accounts: view reputation scores, sending stats, allocate credits, and assign dedicated IPs.
/v?/subusers/reputations
Mengambil reputation scores semua subusers.
/v?/subusers/stats
Mengambil sending stats semua subusers.
/v?/subusers/monthly-stats
Mengambil monthly stats semua subusers.
/v?/subusers/credits
Mengambil credit allocation subusers.
/v?/subusers/credits
Update credit allocation. Body: `{"credits": 10000, "resetDate": "monthly"}`.
/v?/subusers/ips
Update assigned IPs untuk subuser. Body: `["192.0.2.10", "192.0.2.11"]`. Response: array of assigned IPs.
User / Account
Manage your account profile, email, username, password, and view credit balance.
/v?/account
Mengambil account info.
/v?/user/profile
Mengambil user profile.
/v?/user/profile
Update user profile. Body: `{firstName, lastName, ...}`
/v?/user/email
Mengambil user email.
/v?/user/email
Update user email. Body: `{email: "new@example.com"}`
/v?/user/password
Update password. Body: `{currentPassword, newPassword}`. Response: `{"message": "Password updated"}`
/v?/user/username
Mengambil username.
/v?/user/username
Update username. Body: `{username: "newname"}`
/v?/user/credits
Mengambil credit balance.
API Logs
View detailed logs of all API requests made to your account — method, path, status code, duration, and source IP.
/v?/api-logs
Mengambil daftar API request logs dengan pagination dan filter.
{
"data": [
{
"_id": "log_001",
"method": "POST",
"path": "/v1/campaigns",
"statusCode": 500,
"duration": 245,
"apiKeyId": 3,
"ipAddress": "203.0.113.1",
"timestamp": "2026-04-10T10:00:00Z"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/api-logs?page=1&perPage=20&method=POST&statusCode=500' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Audit Logs
Track all account activity: who did what, when, and from which IP. Essential for security audits and compliance.
/v?/audit-logs
Mengambil daftar audit logs dengan pagination dan filter.
{
"data": [
{
"_id": "al_001",
"userId": 42,
"userEmail": "admin@example.com",
"action": "delete",
"resource": "campaign",
"resourceId": "cmp_001",
"ipAddress": "203.0.113.1",
"timestamp": "2026-04-10T10:00:00Z",
"details": {
"campaignName": "April Newsletter"
}
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/audit-logs?page=1&perPage=20&action=delete&dateFrom=2026-04-01' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
IP Access
Restrict API access to specific IP addresses. Only whitelisted IPs can make API calls to your account.
/v?/ip-access
Menambahkan IP address ke whitelist untuk API access.
{
"ip": "203.0.113.50",
"note": "Office IP"
}
{
"data": {
"id": 1,
"ip": "203.0.113.50",
"note": "Office IP",
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/ip-access' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"ip": "203.0.113.50",
"note": "Office IP"
}'
/v?/ip-access
Mengambil semua IP access rules.
{
"data": [
{
"id": 1,
"ip": "203.0.113.50",
"note": "Office IP",
"createdAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/ip-access' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/ip-access/:id
Menghapus IP access rule berdasarkan ID.
{
"message": "IP access rule deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/ip-access/1' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
SSO
Configure SAML-based Single Sign-On so your team can log in with your identity provider (Okta, Azure AD, etc.).
/v?/sso
Membuat konfigurasi SSO (SAML) baru.
{
"enabled": true,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----"
}
{
"data": {
"_id": "sso_001",
"enabled": true,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/sso' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"enabled": true,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----"
}'
/v?/sso
Mengambil konfigurasi SSO saat ini.
{
"data": {
"_id": "sso_001",
"enabled": true,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/sso' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/sso
Mengupdate konfigurasi SSO.
{
"enabled": false,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----"
}
{
"data": {
"_id": "sso_001",
"enabled": false,
"provider": "okta",
"entityId": "https://example.okta.com/entity",
"signOnUrl": "https://example.okta.com/sso/saml",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
"createdAt": "2026-04-10T10:00:00Z",
"updatedAt": "2026-04-10T10:05:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/sso' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"enabled": false
}'
/v?/sso
Menghapus konfigurasi SSO.
{
"message": "SSO configuration deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/sso' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Enforced TLS
Require TLS encryption for all outbound email delivery. Optionally require valid certificates from receiving servers.
/v?/enforced-tls
Mengambil konfigurasi enforced TLS.
{
"data": {
"requireTls": true,
"requireValidCert": true
}
}
/v?/enforced-tls
Mengupdate konfigurasi enforced TLS.
{
"data": {
"requireTls": true,
"requireValidCert": false
}
}
Scopes
List all available API permission scopes. Used when creating API keys with restricted access (RBAC).
/v?/scopes
Mengambil daftar semua available API scopes (untuk RBAC key management).
{
"data": [
"campaigns.read",
"campaigns.write",
"contacts.read",
"contacts.write",
"webhooks.read",
"webhooks.write",
"stats.read",
"settings.read",
"settings.write"
]
}
Idempotency
Prevent duplicate operations. Idempotency keys ensure that retrying a request (e.g. after a timeout) does not send the email twice.
/v?/idempotency/records/:key
Mengambil detail record idempotency berdasarkan key.
{
"data": {
"key": "idem-abc123",
"status": "completed",
"messageId": "msg_001",
"responseCode": 200,
"createdAt": "2026-04-10T10:00:00Z",
"expiresAt": "2026-04-11T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/idempotency/records/idem-abc123' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/idempotency/records/:key
Menghapus record idempotency berdasarkan key (expire manual).
{
"message": "Idempotency key expired"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/idempotency/records/idem-abc123' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/idempotency/config
Mengambil konfigurasi idempotency saat ini.
{
"data": {
"enabled": true,
"ttlHours": 24,
"enforcement": "strict"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/idempotency/config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/idempotency/config
Mengupdate konfigurasi idempotency.
{
"enabled": true,
"ttlHours": 48,
"enforcement": "warn"
}
{
"data": {
"enabled": true,
"ttlHours": 48,
"enforcement": "warn"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/idempotency/config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"enabled": true,
"ttlHours": 48,
"enforcement": "warn"
}'
Log Redaction
Control which email fields (body, subject, headers) are stored in logs. Redact sensitive content for compliance requirements.
/v?/log-redaction/config
Mengambil konfigurasi log redaction saat ini.
{
"data": {
"enabled": true,
"redactBody": true,
"redactSubject": false,
"redactHeaders": false,
"allowedFields": ["from", "to", "date"]
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/log-redaction/config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/log-redaction/config
Mengupdate konfigurasi log redaction.
{
"enabled": true,
"redactBody": true,
"redactSubject": true,
"redactHeaders": false,
"allowedFields": ["from", "to", "date", "subject"]
}
{
"data": {
"enabled": true,
"redactBody": true,
"redactSubject": true,
"redactHeaders": false,
"allowedFields": ["from", "to", "date", "subject"]
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/log-redaction/config' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"enabled": true,
"redactBody": true,
"redactSubject": true,
"redactHeaders": false,
"allowedFields": ["from", "to", "date", "subject"]
}'
Velocity Control
Automatic anomaly detection on sending patterns. Pauses sending when bounce rates or volume spike unexpectedly to protect your reputation.
/v?/velocity/rules
Mengambil semua velocity rules.
{
"data": [
{
"_id": "rule_001",
"name": "Bounce rate spike",
"metric": "bounce_rate",
"threshold": 5.0,
"action": "pause",
"cooldownMinutes": 30,
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/velocity/rules' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/rules
Membuat velocity rule baru untuk anomaly detection.
{
"name": "Bounce rate spike",
"metric": "bounce_rate",
"threshold": 5.0,
"action": "pause",
"cooldownMinutes": 30,
"active": true
}
{
"data": {
"_id": "rule_001",
"name": "Bounce rate spike",
"metric": "bounce_rate",
"threshold": 5.0,
"action": "pause",
"cooldownMinutes": 30,
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/velocity/rules' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Bounce rate spike",
"metric": "bounce_rate",
"threshold": 5.0,
"action": "pause",
"cooldownMinutes": 30,
"active": true
}'
/v?/velocity/rules/:id
Mengambil detail velocity rule berdasarkan ID.
{
"data": {
"_id": "rule_001",
"name": "Bounce rate spike",
"metric": "bounce_rate",
"threshold": 5.0,
"action": "pause",
"cooldownMinutes": 30,
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/velocity/rules/rule_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/rules/:id
Mengupdate velocity rule berdasarkan ID.
{
"name": "Bounce rate spike (updated)",
"threshold": 3.0,
"cooldownMinutes": 60
}
{
"data": {
"_id": "rule_001",
"name": "Bounce rate spike (updated)",
"metric": "bounce_rate",
"threshold": 3.0,
"action": "pause",
"cooldownMinutes": 60,
"active": true,
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request PUT 'https://api.mailtarget.co/v1/velocity/rules/rule_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Bounce rate spike (updated)",
"threshold": 3.0,
"cooldownMinutes": 60
}'
/v?/velocity/rules/:id
Menghapus velocity rule berdasarkan ID.
{
"message": "Velocity rule deleted"
}
cURL Example
curl --request DELETE 'https://api.mailtarget.co/v1/velocity/rules/rule_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/events
Mengambil daftar velocity events (anomaly yang terdeteksi) dengan pagination.
{
"data": [
{
"_id": "evt_001",
"ruleId": "rule_001",
"ruleName": "Bounce rate spike",
"triggeredAt": "2026-04-10T10:30:00Z",
"action": "pause",
"metricValue": 7.2,
"threshold": 5.0,
"status": "active"
}
],
"meta": {
"page": 1,
"perPage": 20,
"total": 1
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/velocity/events?page=1&perPage=20' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/events/:id/resolve
Resolve velocity event — menandai anomaly sudah diatasi dan melanjutkan pengiriman.
{
"message": "Velocity event resolved, sending resumed"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/velocity/events/evt_001/resolve' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/events/:id/dismiss
Dismiss velocity event — menandai anomaly sebagai false positive.
{
"message": "Velocity event dismissed"
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/velocity/events/evt_001/dismiss' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/velocity/status
Mengambil status velocity control secara keseluruhan (overview dashboard).
{
"data": {
"activeRules": 3,
"activeEvents": 1,
"sendingStatus": "throttled",
"lastChecked": "2026-04-10T10:35:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/velocity/status' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
Data Privacy
Handle GDPR Right to Be Forgotten (RTBF) and opt-out requests. Permanently delete all data associated with an email address.
/v?/data-privacy/rtbf
Membuat Right To Be Forgotten (RTBF) request — menghapus semua data contact.
{
"email": "user@example.com"
}
{
"data": {
"_id": "dp_001",
"type": "rtbf",
"email": "user@example.com",
"status": "pending",
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/data-privacy/rtbf' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com"
}'
/v?/data-privacy/opt-out
Membuat opt-out request — contact tidak akan menerima email lagi.
{
"email": "user@example.com"
}
{
"data": {
"_id": "dp_002",
"type": "opt_out",
"email": "user@example.com",
"status": "pending",
"createdAt": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request POST 'https://api.mailtarget.co/v1/data-privacy/opt-out' \
--header 'Authorization: Bearer MAILTARGET_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "user@example.com"
}'
/v?/data-privacy/requests/:id
Mengambil status data privacy request berdasarkan ID.
{
"data": {
"_id": "dp_001",
"type": "rtbf",
"email": "user@example.com",
"status": "completed",
"createdAt": "2026-04-10T10:00:00Z",
"completedAt": "2026-04-10T10:05:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/data-privacy/requests/dp_001' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
DMARC Monitoring
Monitor your domain DMARC/SPF/DKIM status, check blocklist status, detect spam traps, and track overall email health score.
/v?/dmarc/domains
Mengambil daftar semua DMARC domains.
{
"data": [
{
"domain": "example.com",
"dmarcStatus": "pass",
"lastChecked": "2026-04-10T10:00:00Z"
}
]
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/dmarc/domains' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/dmarc/domains/:domain
Mengambil detail DMARC status untuk domain tertentu.
{
"data": {
"domain": "example.com",
"dmarcStatus": "pass",
"policy": "reject",
"spfAligned": true,
"dkimAligned": true,
"lastChecked": "2026-04-10T10:00:00Z"
}
}
cURL Example
curl --request GET 'https://api.mailtarget.co/v1/dmarc/domains/example.com' \
--header 'Authorization: Bearer MAILTARGET_API_KEY'
/v?/dmarc/domains/:domain/records
Mengambil DMARC DNS records untuk domain.
{
"data": {
"domain": "example.com",
"dmarcRecord": "v=DMARC1; p=reject; rua=mailto:dmarc@example.com",
"spfRecord": "v=spf1 include:mailtarget.co -all",
"dkimSelector": "mt1"
}
}
/v?/dmarc/domains/:domain/setup
Mengambil setup instructions untuk DMARC domain.
{
"data": {
"domain": "example.com",
"steps": [
{ "record": "TXT", "host": "_dmarc.example.com", "value": "v=DMARC1; p=none; rua=mailto:dmarc@example.com" }
],
"currentStatus": "not_configured"
}
}
/v?/dmarc/monitored-domains
Mengambil daftar domain yang aktif dimonitor.
{
"data": [
{
"domain": "example.com",
"monitoringSince": "2026-01-01",
"status": "active"
}
]
}
/v?/dmarc/domains/:domain/blocklists
Mengambil status blocklist untuk domain.
{
"data": {
"domain": "example.com",
"listed": false,
"blocklists": [],
"lastChecked": "2026-04-10T10:00:00Z"
}
}
/v?/dmarc/domains/:domain/blocklist-events
Mengambil history blocklist events untuk domain.
{
"data": [
{
"blocklist": "spamhaus.org",
"listedAt": "2026-03-15T10:00:00Z",
"delistedAt": "2026-03-16T08:00:00Z",
"reason": "High complaint rate"
}
]
}
/v?/dmarc/spam-traps
Mengambil data spam trap hits.
{
"data": [
{
"email": "trap@spamtrap.example.com",
"hitCount": 3,
"lastHit": "2026-04-09T14:00:00Z",
"source": "purchased_list"
}
]
}
/v?/dmarc/health-score
Mengambil email health score keseluruhan.
{
"data": {
"score": 87,
"grade": "B+",
"factors": {
"dmarc": 95,
"spf": 100,
"dkim": 100,
"blocklist": 80,
"spamTraps": 60,
"bounceRate": 90
}
}
}
Data Erasure
Permanently erase all data associated with an email address. Asynchronous processing with job status tracking.
/v?/data-erasure/jobs
Membuat data erasure job — menghapus semua data terkait email address.
{
"data": {
"jobId": "de_001",
"status": "pending",
"email": "user@example.com"
}
}
/v?/data-erasure/jobs/:id
Mengambil status data erasure job.
{
"data": {
"jobId": "de_001",
"status": "completed"
}
}