API Documentation

Welcome to the Newsletter System API. This documentation provides comprehensive details on how to interact with the newsletter generation and distribution system.

Base URL
http://mails.maksimmalbasa.in.rs

Errors

The API uses standard HTTP status codes to indicate the success or failure of requests.

Code Description
200 OK The request was successful.
400 Bad Request The request was invalid or missing parameters.
404 Not Found The requested resource does not exist.
500 Internal Error Something went wrong on the server side.

System Endpoints

GET /api/health

Returns basic system status and uptime information. Use this for load balancer health checks.

Response
{
  "status": "healthy",
  "timestamp": "2024-01-15T08:00:00+01:00",
  "timezone": "Europe/Belgrade",
  "uptime": 86400,
  "service": "newsletter-system"
}

GET /api/health-full

Returns detailed system status including availability metrics.

Response
{
  "status": "healthy",
  "availability": "99.9%",
  "timestamp": "2024-01-15T08:00:00+01:00",
  "timezone": "Europe/Belgrade"
}

Newsletter Endpoints

GET /api/newsletters

Returns a list of all generated newsletter HTML files available in the public directory.

Response
{
  "newsletters": [
    "mail-01-09-2025.html",
    "mail-08-09-2025.html"
  ]
}

GET /api/unsubscribe

Unsubscribes a user from the newsletter distribution list.

Parameters
Parameter Description
email Required The email address to unsubscribe.
Response

Returns an HTML page with a confirmation message.