UGMail Developer Docs

Created by Mukisa Trevor, Modified on Sat, 30 Aug at 3:45 PM by Mukisa Trevor

UGMail Developer Documentation

Welcome to the UGMail Developer Hub. This guide helps you integrate UGMail Business Email into your applications, websites, or platforms. Whether you’re building SaaS tools, mobile apps, or enterprise systems, UGMail provides a secure, reliable, and scalable business email backbone with full API access.


Table of Contents


Welcome Email

Once a user signs up, UGMail automatically sends a Welcome Email to confirm their account. Example template:

Subject: Welcome to UGMail Business Email

Hello [First Name],

Welcome to UGMail — your trusted Business Email solution.
Your account has been created successfully.

Login: https://mail.ugmail.site
Username: [your-username]@[domain]
Password: [your-password]

Thank you for choosing UGMail.
- UGMail Team

IIntroduction

UGMail offers a robust API that enables developers to:

  • Create and manage email accounts
  • Validate usernames and domains
  • Send transactional and marketing emails
  • Monitor delivery status through webhooks

All operations are done via REST APIs secured with an API key.


Authentication

Every request requires an API key. Pass it in the Authorization header:

Authorization: Bearer YOUR_API_KEY

You can generate API keys from your UGMail Admin Panel.


Creating Email Accounts

To create a new user under a domain:

POST /v2/domains/{domain}/users

Headers:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body:
{
  "username": "john.doe",
  "password": "StrongPassword123!",
  "name": "John Doe"
}

Response:

201 Created
{
  "id": "12345",
  "username": "john.doe",
  "email": "john.doe@ugmail.site",
  "status": "active"
}

Validating Usernames

Check if a username exists before creating:

GET /v2/domains/{domain}/users/{username}

Responses:

  • 200 → Username exists
  • 404 → Username available

Sending Emails

Send via REST API:

POST /v2/send/email

Headers:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body:
{
  "from": "info@ugmail.site",
  "to": "client@example.com",
  "subject": "Welcome to UGMail",
  "body": "Hello, your account has been created successfully."
}

Alternatively, use standard SMTP with your username/password.


Managing Domains

Manage domains under your control:

GET /v2/domains          → List all domains
POST /v2/domains         → Add a domain
DELETE /v2/domains/{id}  → Remove a domain

? Webhooks & Callbacks

UGMail can notify your platform of real-time events:

  • User created
  • Password changed
  • Email sent / bounced / failed

Register your webhook URL in the UGMail Admin Panel.

Webhook Example:

POST https://yourapp.com/webhook

{
  "event": "email.delivered",
  "recipient": "client@example.com",
  "timestamp": "2025-08-30T12:00:00Z"
}

Error Handling

Standard error codes:

  • 400 → Bad request (invalid data)
  • 401 → Unauthorized (invalid API key)
  • 403 → Forbidden (not enough permissions)
  • 404 → Not found (domain or user missing)
  • 409 → Conflict (username already exists)
  • 500 → Internal server error

Sample Code

JavaScript (validate username):

fetch("https://api.ugmail.site/v2/domains/ugmail.site/users/johndeo", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY"
  }
})
.then(res => {
  if (res.status === 404) {
    console.log("Username available");
  } else {
    console.log("Username taken");
  }
});

Python (create account):

import requests

url = "https://api.ugmail.site/v2/domains/ugmail.site/users"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
body = {
    "username": "john.deo",
    "password": "StrongPassword123!",
    "name": "Jane Doe"
}

res = requests.post(url, headers=headers, json=body)
print(res.json())

PHP (send email):

 "support@ugmail.site",
    "to" => "client@example.com",
    "subject" => "Welcome to UGMail",
    "body" => "Your account is ready."
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

Support

If you need assistance:

Thank you for building with UGMail

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article