GitHub

API Documentation

Explore the endpoints available in Mail Assist to interact with authentication, custom emails, templated messages, and batch email functionality.

Authentication

Signup a new user.

POST /auth/signup
POST /auth/signup

Request Body:
{
  "name": "John Doe",
  "email": "john@example.com",
  "password": "securePassword123"
}

Send Custom Mail

Send a templated email by passing placeholder values.

POST /custom-mail
POST /custom-mail

Request Body:
{
  "to": "recipient@example.com",
  "templateId": "abc123",
  "placeholderData": {
    "name": "John",
    "company": "Acme Corp"
  }
}

Send Mail

Send a custom or optional template-based email.

POST /send
POST /send

Required Body:
{
  "to": "jane@example.com",
  "subject": "Job Offer",
  "bodyMessage": "We are excited to offer you a position at Acme Corp."
}

Optional for Template-Based:
{
  "templateType": "job-offer",
  "company": "Acme Corp",
  "position": "Software Engineer",
  "description": "Full-time role with benefits"
}
Available Template Types
  • job-offer: company, position, description
  • interview-invite: company, position, date, time, location
  • event-reminder: eventName, date, time, venue
  • thank-you: recipientName, message
  • payment-confirmation: recipientName, amount, transactionId, date

Send Batch Mail

Send templated emails to multiple users using placeholder arrays.

POST /send-batch
POST /send-batch

Request Body:
{
  "templateId": "event-reminder-template",
  "subject": "Event Reminder: Tech Summit",
  "rows": [
    {
      "eventName": "Tech Summit 2025",
      "date": "2025-08-15",
      "time": "10:00 AM",
      "venue": "Mumbai Convention Center",
      "to": "user1@example.com"
    },
    {
      "eventName": "Tech Summit 2025",
      "date": "2025-08-15",
      "time": "10:00 AM",
      "venue": "Mumbai Convention Center",
      "to": "user2@example.com"
    }
  ]
}

User Mails

Fetch a list of all emails sent by a specific user.

POST /user-mails
POST /user-mails

Request Body:
{
  "user_id": "uuid-of-user"
}

Response Format

Each endpoint responds with a standard structure:

response.json
{
  "success": true,
  "message": "Email sent successfully",
  "data": { /* optional payload */ }
}

Error Handling

In case of errors, the API will respond with a consistent error format.

error-response.json
{
  "success": false,
  "error": "Invalid email address",
  "code": 400
}
Tip
Always validate inputs before sending a request to minimize API errors.