Complete guide to using Firentia Mail API for developers and bots.Panduan lengkap menggunakan API Firentia Mail untuk developer dan bot.
All API v1 requests require an API Key via the apikey query parameter.
Semua request API v1 membutuhkan API Key melalui parameter query apikey.
/config endpoint.
Cara mendapatkan API Key: Login ke panel admin atau cek endpoint /config.
curl "https://firentia.store/api/v1/messages?address=test@firentia.store&apikey=YOUR_API_KEY"
/config
Get server configuration including API key, available domains, and MX host. No authentication required.Ambil konfigurasi server termasuk API key, domain tersedia, dan MX host. Tidak perlu autentikasi.
{
"domain": "firentia.store",
"domains": ["firentia.store", "jayan.web.id", "ryuuut.my.id"],
"apiKey": "your-api-key",
"mxHost": "mail.firentia.store"
}
/api/domains
List all active (verified + shared) domains. No authentication required.Daftar semua domain aktif (terverifikasi + shared). Tidak perlu autentikasi.
{
"ok": true,
"domains": ["firentia.store", "jayan.web.id", "ryuuut.my.id", "stacyer.biz.id", "toddis.web.id"]
}
/mailbox/generate
Generate a new email address on a specific domain. No authentication required.Buat alamat email baru di domain tertentu. Tidak perlu autentikasi.
{
"user": "myname",
"domain": "firentia.store"
}
{
"ok": true,
"email": "myname@firentia.store",
"domain": "firentia.store"
}
/api/v1/messages
Get all messages for a specific address or domain. Requires API key.Ambil semua pesan untuk alamat atau domain tertentu. Membutuhkan API key.
apikey โ API Key (requiredwajib)address โ Full email address (optional)Alamat email lengkap (opsional)domain โ Domain name (optional, if no address)Nama domain (opsional, jika tanpa address)curl "https://firentia.store/api/v1/messages?address=test@firentia.store&apikey=YOUR_API_KEY"
[
{
"id": "a1b2c3d4-...",
"address": "test@firentia.store",
"domain": "firentia.store",
"from_name": "Google",
"from_addr": "noreply@google.com",
"to_addr": "test@firentia.store",
"subject": "Your verification code",
"body_text": "Your code is 123456",
"otp": "123456",
"received_at": "2026-10-24T15:00:00.000Z",
"is_read": 0
}
]
/api/v1/messages/:id
Get a single message by ID (includes full HTML body). Requires API key.Ambil satu pesan berdasarkan ID (termasuk body HTML lengkap). Membutuhkan API key.
id โ Message ID (path)ID pesan (path)apikey โ API Key (requiredwajib)curl "https://firentia.store/api/v1/messages/a1b2c3d4-...?apikey=YOUR_API_KEY"
{
"id": "a1b2c3d4-...",
"address": "test@firentia.store",
"from_addr": "noreply@google.com",
"subject": "Your verification code",
"body_text": "Your code is 123456",
"body_html": "<p>Your code is <b>123456</b></p>",
"otp": "123456",
"received_at": "2026-10-24T15:00:00.000Z",
"is_read": 1
}
/api/v1/messages/:id
Delete a single message by ID. Requires API key.Hapus satu pesan berdasarkan ID. Membutuhkan API key.
curl -X DELETE "https://firentia.store/api/v1/messages/a1b2c3d4-...?apikey=YOUR_API_KEY"
{ "ok": true }
/api/v1/messages/delete-all
Delete all messages for a specific address or domain. Requires API key.Hapus semua pesan untuk alamat atau domain tertentu. Membutuhkan API key.
{
"address": "test@firentia.store",
"apikey": "YOUR_API_KEY"
}
{ "ok": true, "deleted": 5 }
/api/v1/domain/wait-otp
Long-poll for incoming OTP. Server blocks up to the specified timeout waiting for a message containing an OTP code.Long-poll untuk OTP masuk. Server menunggu hingga timeout yang ditentukan untuk pesan yang mengandung kode OTP.
apikey โ API Key (requiredwajib)address โ Email address (optional)Alamat email (opsional)domain โ Domain name (optional)Nama domain (opsional)timeout โ Max wait in seconds (1-120, default 60)Waktu tunggu maks dalam detik (1-120, default 60)curl "https://firentia.store/api/v1/domain/wait-otp?address=test@firentia.store&timeout=60&apikey=YOUR_API_KEY"
{
"ok": true,
"otp": "123456",
"id": "a1b2c3d4-...",
"address": "test@firentia.store",
"subject": "Your verification code",
"from": "noreply@google.com"
}
{ "ok": false, "error": "timeout", "waited_ms": 60000 }
/api/domains
Add and verify a custom domain. Set MX record to the server's MX host first.Tambah dan verifikasi domain custom. Atur MX record ke MX host server terlebih dahulu.
{ "domain": "mydomain.com" }
{
"ok": true,
"verified": true,
"domain": "mydomain.com",
"message": "Domain aktif! Email siap dipakai."
}
verified will be false and the response includes the required mx_host.
Catatan: Jika MX belum mengarah ke server, verified akan false dan response menyertakan mx_host yang dibutuhkan.
import requests
BASE = "https://firentia.store"
API_KEY = "YOUR_API_KEY"
# Generate email
res = requests.post(f"{BASE}/mailbox/generate", json={
"user": "testuser",
"domain": "firentia.store"
})
email = res.json()["email"]
print(f"Email: {email}")
# Check inbox
msgs = requests.get(
f"{BASE}/api/v1/messages",
params={"address": email, "apikey": API_KEY}
).json()
for m in msgs:
print(f"From: {m['from_addr']}")
print(f"Subject: {m['subject']}")
if m.get("otp"):
print(f"OTP: {m['otp']}")
const BASE = "https://firentia.store";
const API_KEY = "YOUR_API_KEY";
// Generate email
const gen = await fetch(`${BASE}/mailbox/generate`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user: "testuser", domain: "firentia.store" })
});
const { email } = await gen.json();
console.log("Email:", email);
// Check inbox
const msgs = await fetch(
`${BASE}/api/v1/messages?address=${encodeURIComponent(email)}&apikey=${API_KEY}`
).then(r => r.json());
msgs.forEach(m => {
console.log(`From: ${m.from_addr}`);
console.log(`Subject: ${m.subject}`);
if (m.otp) console.log(`OTP: ${m.otp}`);
});
| CodeKode | DescriptionDeskripsi |
|---|---|
200 | SuccessBerhasil |
401 | Invalid or missing API keyAPI key tidak valid atau tidak ada |
404 | Resource not foundResource tidak ditemukan |
500 | Server errorServer error |