NiloyFlix / Developers / API referencev5.7 · SAME REST API
BUILT FOR YOUR NEXT INTEGRATION

Your inbox.
A few lines of code.

Create an email address, receive messages and connect your workflow with a straightforward JSON API.

Get started → OpenAPI specification ↗
JSON responsesSimple, predictable payloads
40 MB per inboxPermanent message storage
API key accessManaged in your admin console

Start with an API key

Every request uses an enabled key created by the site administrator.

1
Open Admin console → Developer API and create a key.
2
Replace https://yourdomain.com with your installation URL, including any subdirectory.
3
URL-encode each email and key path segment. Make requests from your server.
QUICK START · CURL
curl "https://yourdomain.com/api/domains/YOUR_API_KEY"
v5.7: any enabled key opens any inbox — no per-key ownership, no rate limit, no customer open limit, mail password or subject filter. An installation key can read every inbox on this installation, including password-protected inboxes and hidden domains. Keep keys out of public frontend code, screenshots and logs. Use HTTPS. Rotate or disable keys in the admin console.

Gmail, Outlook & Hotmail — same API

The administrator connects each mailbox in Connected Accounts using OAuth, a Google App Password, or a compatible Microsoft Graph refresh token. App Password connections require PHP IMAP on the host. Keep your existing API key and the same endpoints. Replace the email with the connected address, or one of its aliases (you+tag@gmail.com, or a Gmail dot variant such as y.ou@gmail.com) to get only mail sent to that alias:

EXISTING ENDPOINTS
GET /api/email/you%40gmail.com/YOUR_API_KEY
GET /api/messages/you%40gmail.com/YOUR_API_KEY

The email endpoint returns the same email object; the messages endpoint returns the same message array shown below. A connected inbox that needs reconnection still returns its cached mail with HTTP 200 and X-NiloyFlix-Sync-Status: reconnect. Unconnected provider addresses are rejected. Provider domains are not added to the domain list, and this API cannot create Gmail or Microsoft accounts.

Provider Inbox messages import in batches of up to 10. The first request may return only the first batch; subsequent reads continue importing older messages and checking new mail. Automatic sync has a 30-second cooldown. The administrator can also schedule the included CLI sync. New-message checks alternate with history pages; this is not a real-time push service.

Only Inbox is fetched from the provider; Sent, Junk/Spam, Trash and attachments are not imported. Imported copies remain in NiloyFlix until locally deleted or disconnected, even if the provider later archives or deletes the original. Existing local domain inbox behavior is unchanged.

DELETE on a connected message removes only its NiloyFlix copy. It does not delete provider mail, and subsequent sync does not restore that local deletion. Disconnect stops API access and clears imported copies and saved connection tokens. A response header, X-NiloyFlix-Last-Sync, reports the last completed sync batch. When the cache is full, existing messages remain readable with HTTP 200 and X-NiloyFlix-Sync-Status: quota; new imports pause until space is freed.

Existing enabled keys can read all connected inboxes, including login/reset emails. The administrator should only connect mailboxes intended for these API users. Treat returned HTML as untrusted; render it in a sanitized sandbox.
01 / DISCOVER

List domains

Returns all configured domains available to the administrator API. Domains hidden from public signup remain available for existing inbox access.

GET/api/domains/[apikey]
200 · APPLICATION/JSON
["mail.example.com", "inbox.example.com"]
02 / CREATE

Create or validate an inbox

Trims whitespace, lowercases the address and validates the configured domain. Repeating this request returns the same address. Existing passwords and messages remain unchanged.

GET/api/email/[email]/[apikey]
PARAMETERDESCRIPTION
emailFull email address, URL-encoded. Example: demo%40mail.example.com
apikeyAn enabled installation API key
200 · APPLICATION/JSON
{"email": "demo@mail.example.com"}

This endpoint creates a permanent receiving inbox without a web password. Create an account through the website, or use the existing v1 mailbox endpoint, if you need password login. Administrator keys may provision hidden domains; public signup cannot.

03 / RECEIVE

Fetch messages

Returns a JSON array ordered newest first, including Inbox and Spam. An empty or uncreated valid inbox returns [].

GET/api/messages/[email]/[apikey]
200 · APPLICATION/JSON
[
  {
    "id": "64-character-hexadecimal-message-id",
    "subject": "Welcome to your inbox",
    "timestamp": "2026-10-18T12:30:08.000000Z",
    "date": "18 Oct 2026 12:30 PM",
    "datediff": "8 seconds ago",
    "content": "<p>Your inbox is ready.</p>",
    "sender_name": "Example Team",
    "sender_email": "hello@example.com",
    "attachments": []
  }
]
FIELDMEANING
contentStored HTML, or escaped plain text wrapped in a pre element. Treat it as untrusted; render with sanitization and an iframe sandbox.
timestampServer receipt time in UTC.
attachmentsAlways an empty array. This receiver does not retain attachments.

Keep your messages. Delete when you choose.

Inboxes no longer expire after 24 hours, and the previous 100-message deletion rule is removed. Each mailbox has 40 MiB (41,943,040 bytes) for stored text and HTML. When storage is full, new mail is rejected; existing mail is preserved. Raw incoming messages may be up to 10 MiB. Stored text and HTML are limited to 100 KB and 500 KB per message respectively; attachments are not retained.

Messages have no automatic expiry. You can permanently delete an individual message in the web inbox or with the endpoint below. A successful deletion frees its stored text and HTML space. Any enabled key can read (GET) or delete any message by ID; account deletion remains disabled.

GET/api/message/[message_id]/[apikey]
DELETE/api/message/[message_id]/[apikey]
200 · MESSAGE DELETED
{"deleted": true}
The web inbox checks for new mail every 3 seconds while visible. Upstream sender, hosting and mail-provider delays are outside this refresh interval. Messages rejected before reaching the Worker cannot be recovered by NiloyFlix. Back up your database and storage/config.php regularly.

Response codes

STATUSWHAT TO DO
200Success. Parse the JSON response.
400Check the email address, domain or request parameters.
401Use a valid, enabled API key.
404The requested route, inbox or message was not found.
405The method is not supported. Account deletion is disabled.
502Provider connection failed. Check settings or retry.
500 / 503Check hosting logs or retry later.
507The local mailbox is full; inbound delivery or connected imports are paused. Existing mail is preserved.

Existing v1 integrations

The /api/v1 Bearer API keeps its paginated response format (limit up to 1000), but no longer has per-client ownership: any enabled key can read any inbox by ?email=, including connected inboxes and their aliases, and any message by ID. Creating an address that already exists returns it (200, "existing": true) instead of 409. Mailboxes have no automatic expiry. Individual messages can be deleted; account deletion remains disabled.