Newsletter Subscriptions
Manage subscriber signups, lists, and segments programmatically via the API
Overview
SentinMail lets you manage your newsletter subscribers programmatically — create subscribers, organize them into lists, and target them with segments. This guide covers the API endpoints you'll use most as an integrator.
Add a Subscriber
1curl -X POST "https://api.sentinmail.app/api/emails/subscribers/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "email": "newuser@example.com",6 "first_name": "Jane",7 "last_name": "Doe"8 }'Response (201):
1{2 "id": "sub-uuid-here",3 "email": "newuser@example.com",4 "first_name": "Jane",5 "last_name": "Doe",6 "created_at": "2026-04-02T12:00:00Z"7}List All Subscribers
1curl -X GET "https://api.sentinmail.app/api/emails/subscribers/" \2 -H "X-API-Key: YOUR_API_KEY"Filter and search:
1# Search by name or email2?search=jane3 4# Sort by creation date (newest first)5?ordering=-created_at6 7# Paginate8?page=2Bulk Add Subscribers (CSV)
Upload a CSV file to add subscribers in bulk:
1curl -X POST "https://api.sentinmail.app/api/emails/subscribers/bulk/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -F "file=@subscribers.csv"CSV format:
1email,first_name,last_name2jane@example.com,Jane,Doe3john@example.com,John,SmithManage Subscriber Lists
Create a List
1curl -X POST "https://api.sentinmail.app/api/emails/lists/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "Weekly Newsletter",6 "description": "Subscribers to the weekly product update"7 }'List All Lists
1curl -X GET "https://api.sentinmail.app/api/emails/lists/" \2 -H "X-API-Key: YOUR_API_KEY"Add Subscribers to a List
Use the bulk update endpoint to add subscribers to lists:
1curl -X POST "https://api.sentinmail.app/api/emails/subscribers/bulk-update-lists/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "subscriber_ids": ["SUB_ID_1", "SUB_ID_2"],6 "add_to_lists": ["LIST_ID"],7 "remove_from_lists": []8 }'Remove a Subscriber
Delete
Permanently remove a subscriber:
1curl -X DELETE "https://api.sentinmail.app/api/emails/subscribers/SUB_ID/" \2 -H "X-API-Key: YOUR_API_KEY"Suppress (Recommended)
Instead of deleting, add them to the suppression list to prevent future emails while keeping their data:
1curl -X POST "https://api.sentinmail.app/api/emails/suppressions/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "email": "unsubscribed@example.com",6 "reason": "User requested opt-out"7 }'Segments
Create dynamic groups of subscribers based on rules:
1curl -X POST "https://api.sentinmail.app/api/emails/segments/" \2 -H "X-API-Key: YOUR_API_KEY" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "Engaged Users",6 "description": "Subscribers who opened an email in the last 30 days",7 "rules": {8 "conditions": [9 {10 "field": "last_opened",11 "operator": "within_days",12 "value": 3013 }14 ],15 "match": "all"16 }17 }'Segments are dynamic — subscribers automatically enter or exit the segment as their data changes.
Pagination
All list endpoints return paginated results:
1{2 "count": 2500,3 "next": "https://api.sentinmail.app/api/emails/subscribers/?page=2",4 "previous": null,5 "results": [...]6}Default page size is 20 items. Navigate with the ?page= parameter.