Skip to main content
UGMail lets you create fully functional email accounts with a single API call. There are no per-user fees and no hard limits on the number of mailboxes you can create, so whether you’re provisioning one account for a new hire or thousands of accounts during a bulk onboarding, the process is identical. This guide walks you through creating a mailbox, verifying it exists, and testing that it accepts connections over SMTP and IMAP.

Prerequisites

1

Ensure your domain is set up

The mailbox address you create must belong to a domain that is already registered in your UGMail account and has its DNS records configured. If you haven’t done that yet, follow the Set Up Your First Domain guide before continuing.
2

Create the mailbox

Send a POST request to /api/principal with the individual type, a name matching the full email address, the initial password in the secrets array, and the email address in the emails array.
A 201 Created response confirms the mailbox is live and ready to use immediately.
3

Verify the mailbox was created

You can confirm the mailbox exists by fetching the principal record you just created. If the request returns the account details without error, the mailbox is active.
4

Test login via SMTP or IMAP

Use the credentials you set during creation to verify the mailbox accepts authenticated connections. The connection details are the same for every mailbox on your account:You can test SMTP login quickly with curl:
A successful SMTP AUTH exchange confirms the mailbox is working end-to-end.
Never hardcode passwords in your provisioning scripts. Instead, generate cryptographically secure random passwords at runtime — for example, using Python’s secrets.token_urlsafe(16) or Node’s crypto.randomBytes(16).toString('hex') — and store them in your secrets manager before passing them to the API.

Next steps

Manage Aliases

Add additional addresses like support@ or billing@ to this mailbox.

Connect an AI Agent

Give an AI agent its own dedicated mailbox and hook it up over SMTP.
Last modified on July 17, 2026