POST /api/auth/register
- Description: Register a new user.
- Request Body:
{ "username": "string", "email": "string", "password": "string" }
- Response:
{ "message": "User registered successfully", "userId": "string" }
POST /api/auth/login
- Description: Authenticate a user.
- Request Body:
{ "email": "string", "password": "string" }
- Response:
{ "token": "string", "user": { "id": "string", "username": "string", "email": "string" } }
POST /api/auth/logout
- Description: Log out a user.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "message": "Logout successful" }
POST /api/emails/upload
- Description: Upload a bulk email list.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "file": "<CSV/Excel file>" }
- Response:
{ "message": "Emails uploaded successfully", "processed": "integer", "duplicates": "integer", "invalid": "integer" }
GET /api/emails
- Description: Retrieve all uploaded emails.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
[ { "email": "string", "category": "string", "status": "valid | duplicate | invalid" } ]
DELETE /api/emails/:emailId
- Description: Delete an email from the list.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "message": "Email deleted successfully" }
POST /api/campaigns
- Description: Create a new email campaign.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "name": "string", "emails": ["string"], "template": "string", "schedule": "ISO_8601 string" }
- Response:
{ "message": "Campaign created successfully", "campaignId": "string" }
GET /api/campaigns
- Description: Retrieve all campaigns.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
[ { "campaignId": "string", "name": "string", "emailsSent": "integer", "status": "pending | ongoing | completed" } ]
PUT /api/campaigns/:campaignId
- Description: Update a campaign.
- Headers:
- Authorization:
Bearer <token>
-
- Request Body:
{ "name": "string", "emails": ["string"], "template": "string", "schedule": "ISO_8601 string" }
- Authorization:
- Response:
{ "message": "Campaign updated successfully" }
GET /api/analytics/:campaignId
- Description: Retrieve analytics for a specific campaign.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "openRate": "percentage", "clickThroughRate": "percentage", "responseRate": "percentage", "bounces": "integer", "unsubscribes": "integer" }
GET /api/analytics
- Description: Retrieve overall email campaign performance.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "totalEmailsSent": "integer", "totalResponses": "integer", "totalBounces": "integer", "totalUnsubscribes": "integer" }
GET /api/compliance
- Description: Retrieve GDPR and CAN-SPAM compliance settings.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Response:
{ "optOutLink": "string", "senderVerification": "boolean" }
PUT /api/compliance
- Description: Update compliance settings.
- Headers:
- Authorization:
Bearer <token>
- Authorization:
- Request Body:
{ "optOutLink": "string", "senderVerification": "boolean" }
- Response:
{ "message": "Compliance settings updated successfully" }