API Documentation

Learn how to integrate the mailing service with your applications.

Authentication

All API requests must include your API key in the Authorization header.

Authorization: Bearer your_api_key_here

Sending Emails

To send an email, make a POST request to the /api/mail endpoint with the following parameters:

curl -X POST https://your-domain.com/api/mail \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key_here" \
  -d '{
    "to": "recipient@example.com",
    "subject": "Hello from MailAPI",
    "text": "This is a test email from MailAPI.",
    "html": "<p>This is a test email from <strong>MailAPI</strong>.</p>"
  }'

Rate Limits

The API is rate-limited to 100 requests per minute per API key. If you exceed this limit, you will receive a 429 Too Many Requests response.

Error Handling

The API returns standard HTTP status codes to indicate the success or failure of a request.

  • 200 OK - The request was successful.
  • 400 Bad Request - The request was invalid or missing required parameters.
  • 401 Unauthorized - The API key is invalid or missing.
  • 429 Too Many Requests - You have exceeded the rate limit.
  • 500 Internal Server Error - An error occurred on the server.