Eclatrecon AI Mail API
Complete REST API for programmatic email management, webhooks, and automation.
BASE URL
http://localhost:3001/api
PUBLIC API
/api/v1/*
FORMAT
JSON (application/json)
Quick Start
Authentication
Eclatrecon AI Mail supports two authentication methods:
1. JWT Token Internal
Used by the frontend. Obtain via login/signup endpoints.
2. API Key Public API
For external integrations. Generate via the API or Settings page.
API Keys
Manage API keys for programmatic access. Requires JWT authentication.
/api/v1/keysGenerate a new API key
| Param | Type | Required | Description |
|---|---|---|---|
| name | string | ✓ | Key name |
| permissions | string | read / write /
send / full (comma-separated) |
|
| expiresInDays | number | Key expires after N days (null = never) |
/api/v1/keysList your API keys (keys are masked)
/api/v1/keys/:idRevoke an API key
Rate Limits
API keys have a default rate limit of 100 requests/hour. Admin can configure per-key limits. The response headers include:
Emails API Key
/api/v1/emailsList emails in a folder. Permission: read
| Query Param | Default | Description |
|---|---|---|
| folder | inbox | inbox, sent, drafts, spam, trash |
| page | 1 | Page number |
| limit | 50 | Results per page |
| unread | Set true for unread only |
|
| search | Search in subject/from |
/api/v1/emails/:idGet full email details with attachments. Permission:
read
/api/v1/emails/sendSend an email via SMTP. Permission: send
| Body | Required | Description |
|---|---|---|
| to | ✓ | Recipient email(s) |
| subject | ✓ | Email subject |
| bodyText | Plain text body | |
| bodyHtml | HTML body | |
| cc, bcc | CC/BCC addresses |
/api/v1/emails/:idUpdate email (read/star/move). Permission:
write
| Body | Description |
|---|---|
| isRead | true/false |
| isStarred | true/false |
| folder | Move to folder: inbox, spam, trash |
/api/v1/emails/:idPermanently delete an email. Permission: write
Contacts API Key
/api/v1/contactsList all contacts
/api/v1/contactsCreate a contact. Body: name,
email, phone, company, notes
/api/v1/contacts/:idDelete a contact
Folders & Labels API Key
/api/v1/foldersList folders with email counts and unread counts
/api/v1/labelsList all labels
Search API Key
/api/v1/search?q=keywordFull-text search across emails (subject, body, sender). Uses FTS5 index.
| Query | Description |
|---|---|
| q | Search query (required) |
| limit | Max results (default: 20) |
Account API Key
/api/v1/meGet your account info
/api/v1/account/statsGet storage, email count, unread count, contact count
Signatures JWT
/api/signaturesList your email signatures
/api/signaturesCreate a signature. Body: name,
bodyHtml, bodyText, isDefault
/api/signatures/:idUpdate a signature
/api/signatures/:idDelete a signature
Email Templates JWT
/api/templatesList templates
/api/templatesCreate template. Body: name,
subject, bodyHtml, bodyText, category
/api/templates/:idUpdate template
/api/templates/:idDelete template
Scheduled Send JWT
Schedule emails to be sent at a future date/time. A background worker checks every 60 seconds.
/api/scheduledList scheduled emails
/api/scheduledSchedule an email
/api/scheduled/:idCancel a pending scheduled email
Contact Groups JWT
/api/contact-groupsList groups with member counts
/api/contact-groupsCreate group. Body: name,
description
/api/contact-groups/:id/membersList group members
/api/contact-groups/:id/membersAdd member. Body: contactId
/api/contact-groups/:id/members/:contactId
Remove member
/api/contact-groups/:idDelete group
Forwarding Rules JWT
/api/forwardingList forwarding rules
/api/forwardingCreate rule. Body: forwardTo,
keepCopy, conditionFrom, conditionSubject
/api/forwarding/:id/toggleToggle rule on/off
/api/forwarding/:idDelete rule
Export JWT
/api/export/emails?folder=inbox&format=json
Export emails as JSON or EML file download
| Param | Options |
|---|---|
| folder | inbox, sent, drafts, spam, trash |
| format | json or eml |
Webhooks
Receive real-time notifications when events happen in Nothing Mail.
/api/v1/webhooksRegister a webhook endpoint
/api/v1/webhooksList webhooks
/api/v1/webhooks/:id/logsView delivery logs (last 50)
/api/v1/webhooks/:id/toggleEnable/disable webhook
/api/v1/webhooks/:idDelete webhook
Webhook Events
| Event | Triggered When | Payload |
|---|---|---|
| email.received | New email arrives via IMAP | emailId, from, subject |
| email.sent | Email sent via SMTP or API | emailId, to, subject |
| email.deleted | Email permanently deleted | emailId |
| email.read | Email marked as read | emailId |
| email.starred | Email starred/unstarred | emailId, isStarred |
| email.scheduled_sent | Scheduled email was sent | emailId, subject |
| contact.created | New contact added | contactId, name, email |
| contact.deleted | Contact deleted | contactId |
| * | All events (wildcard) | varies |
Webhook Verification
Each webhook delivery includes an HMAC-SHA256 signature. Verify it to ensure authenticity:
Admin API Admin Only
All admin endpoints require JWT auth + admin role. Base:
/api/admin
/stats
Dashboard statistics
/users
List all users
/users
Create user
/users/:id
Update user
/users/:id
Delete user
/users/:id/reset-password
Reset password
/users/:id/toggle-admin
Toggle admin role
/emails
Browse all emails
/accounts
All mail accounts
/sessions
All sessions
/storage
Storage breakdown
/logs
Audit logs
/health
Server health
/broadcast
Message all users
/block-sender
Block sender
/bootstrap
First admin setup
Lead Scraper APIFY
Scrape leads from any website, Google Maps, LinkedIn, and more using Apify — then import them directly into your subscriber lists for email campaigns.
Get Your Apify API Token
Sign up for free at apify.com, then go to Settings → Integrations to copy your API token.
Save Token in Settings
Navigate to Lead Scraper in the sidebar, click ⚙ Settings, paste your token, and click Save Settings.
Start a Scrape
Click 🔍 New Scrape, pick a scraper type (e.g., Website Contacts or Google Maps), enter a URL or keyword, select a target list or create a new one, and hit Start Scraping.
Use Leads in Campaigns
Once the scrape completes, leads are auto-imported (if enabled). Or use Import or Quick Campaign to instantly create an email campaign with merge tags like {{first_name}}.
Settings Configuration
| Setting | Description | Default |
|---|---|---|
| apify_token | Your personal Apify API token from console.apify.com | empty |
| auto_import | Automatically import scraped leads into the target subscriber list | On |
| default_actor | Default scraper type when opening the scrape form | website-contacts |
Key Features
8 Scrapers
Website contacts, Google Maps, LinkedIn, Yellow Pages, Instagram, Twitter, and custom actors.
Auto Import
Leads auto-import into subscriber lists with email, name, company, phone data.
Quick Campaign
One-click campaign creation from any scrape job — with merge tag support.
CSV Export
Export all leads to CSV with email, name, company, phone, website, LinkedIn URL.
Stats Dashboard
Track total jobs, leads scraped, leads with emails, and imported counts.
Custom Actors
Use any Apify actor by providing actor ID and custom JSON input.
Available Scrapers
The following scraper types are available out of the box. You can also use any custom Apify actor.
| Scraper | Input | Output | Apify Actor |
|---|---|---|---|
| language Website Contacts | URL | Emails, phones, social links | apify/contact-info-scraper |
| map Google Maps | Keyword + Location | Business name, email, phone, address, website | compass/crawler-google-places |
| work LinkedIn Profiles | Profile URL | Name, title, company, skills | anchor/linkedin-profile-scraper |
| person_search LinkedIn Search | Keyword + Location | Name, title, company, profile URL | anchor/linkedin-search-scraper |
| menu_book Yellow Pages | Keyword + Location | Business name, phone, address, website | apify/yellow-pages-scraper |
| photo_camera Instagram | Profile URL | Bio, contact info, follower count | apify/instagram-profile-scraper |
| tag Twitter / X | Profile URL | Bio, links, contact info | apify/twitter-scraper |
| extension Custom Actor | Actor ID + JSON input | Varies by actor | any Apify actor |
Lead Scraper API JWT
All endpoints require JWT authentication. Base: /api/apify
Settings
/api/apify/settingsGet your Apify settings (token, default actor, auto-import)
/api/apify/settingsSave settings. Body: apify_token, default_actor, auto_import
Scraping
/api/apify/actorsList all available scraper types with their fields and Apify actor IDs
/api/apify/scrapeStart a new scrape job
| Body | Required | Description |
|---|---|---|
| actor_type | ✓ | Scraper type: website-contacts, google-maps, linkedin-profiles, linkedin-search, yellow-pages, instagram, twitter, custom |
| source | URL for URL-based scrapers | |
| keyword | Search keyword for keyword-based scrapers | |
| location | Location filter (e.g. "New York, USA") | |
| max_results | Max results to scrape (default: 50) | |
| list_id | Import leads to existing subscriber list ID | |
| create_list_name | Create new list with this name and import there | |
| custom_actor_id | For custom type: Apify actor ID (e.g. user/my-actor) | |
| custom_input | For custom type: JSON input string |
Job Management
/api/apify/jobsList all scrape jobs with status, lead counts, and list names
/api/apify/jobs/:idGet job details + all leads found by this job
/api/apify/jobs/:id/refreshCheck Apify for updated run status (for running jobs)
/api/apify/jobs/:idDelete a scrape job and all its associated leads
Leads
/api/apify/leadsList all scraped leads (across all jobs)
| Query Param | Description |
|---|---|
| search | Search in email, name, company |
| job_id | Filter by job ID |
| has_email | Set 1 to only show leads with email |
| limit | Max results (default: 100) |
| offset | Pagination offset |
/api/apify/leads/:idDelete a single lead
Import & Campaigns
/api/apify/importImport leads into a subscriber list
| Body | Description |
|---|---|
| job_id | Import all leads from this job |
| lead_ids | Array of specific lead IDs to import |
| list_id | Target subscriber list ID |
| create_list_name | Create new list with this name |
| filter_has_email | Only import leads with email addresses |
/api/apify/quick-campaignCreate a campaign directly from scraped leads
| Body | Required | Description |
|---|---|---|
| job_id | Source job for leads | |
| campaign_name | ✓ | Campaign name |
| subject | ✓ | Email subject line |
| body_html | Email HTML body — supports merge tags: {{first_name}}, {{last_name}}, {{company}}, {{email}} |
Stats & Export
/api/apify/statsDashboard stats: total jobs, total leads, leads with email, imported jobs, recent jobs
/api/apify/exportDownload leads as CSV file
| Query | Description |
|---|---|
| job_id | Export leads from a specific job only |
| has_email | Set 1 to export only leads with emails |
Lead Scraper Workflow
Complete pipeline from scraping to sending email campaigns:
Configure Apify Token
Lead Scraper → Settings → Paste API token → Save
Start a Scrape Job
New Scrape → Pick type → Enter URL/keyword → Choose target list → Start
Leads Extracted & Imported
Apify scrapes the target → Leads (email, name, company, phone) saved → Auto-imported to subscriber list
Create Email Campaign
Quick Campaign from leads → Write email with {{merge_tags}} → Campaign created as draft → Send via Marketing page
Merge Tags for Campaigns
When creating campaigns from scraped leads, use these merge tags in your email body for personalization:
| Tag | Replaced With | Example |
|---|---|---|
| {{first_name}} | Lead's first name | John |
| {{last_name}} | Lead's last name | Doe |
| {{company}} | Company name | Acme Inc |
| {{email}} | Lead's email address | john@acme.com |
tips_and_updates Pro Tips
- • Google Maps is the best scraper for local businesses — try "restaurants", "plumbers", "web agencies" + city name
- • Enable Auto-Import in settings to skip the manual import step — leads go straight to your list
- • Use Quick Campaign on completed jobs to create a draft campaign in one click
- • Export leads as CSV to use in other tools (Mailchimp, HubSpot, etc.)
- • The Custom Actor option lets you use any of the 2,000+ scrapers on the Apify marketplace
- • Leads are deduplicated by email when importing — no duplicate subscribers
Keyboard Shortcuts
| Key | Action |
|---|---|
| c | Compose new email |
| r | Reply to email |
| j / k | Navigate down / up in email list |
| Enter | Open selected email |
| e | Archive email |
| # | Delete email |
| s | Star / unstar email |
| / | Focus search |
| Esc | Close compose / go back |
| ? | Show shortcuts help |
Theme Toggle
Eclatrecon AI Mail supports Dark and Light themes. Toggle via Settings → Appearance or the theme button in the header. Your preference is saved per-account and synced via the API.
Security Features
Two-Factor Authentication (2FA)
TOTP-based 2FA via authenticator apps. Enable in Settings → Security.
Login History
Track all login attempts with IP address, device, and
timestamp. GET /api/login-history
Session Management
View and revoke active sessions. Admin can revoke any user's sessions.
API Key Permissions
Granular permissions: read, write,
send, full. Keys can have expiration dates.
Webhook Signatures
HMAC-SHA256 signatures on all webhook deliveries for authenticity verification.
Eclatrecon AI Mail v2.0 · Built with Node.js, Express, SQLite, Socket.IO
© 2026 Eclatrecon AI Mail. All rights reserved.