Konsep Keamanan
- Tiap owner punya API key sendiri (header
X-Owner-API-Key). - API key hanya boleh akses inbox private buyer yang dimiliki owner itu.
- Jika
domain/buyer milik Adiakses pakaiAPI key milik B, hasilnya403 Forbidden. - Jika owner expired / nonaktif, API key owner otomatis tidak valid.
Flow Singkat
- Owner login ke
/owner. - Tambah domain private dan pastikan status
active. - Generate buyer (email + PIN).
- Buat
API Key Premiumdi dashboard owner. - Pakai API key itu untuk baca inbox/OTP buyer via endpoint premium.
GET
/api/premium/emails/:addressAmbil daftar email inbox private buyer.
Header wajib: X-Owner-API-Key: your-owner-api-key
Query opsional: ?limit=50
curl -H "X-Owner-API-Key: your-owner-api-key" \ "https://emailqu.com/api/premium/emails/abc@canvamail.com?limit=20"
GET
/api/premium/emails/:address/latestAmbil email terbaru inbox private buyer.
curl -H "X-Owner-API-Key: your-owner-api-key" \ "https://emailqu.com/api/premium/emails/abc@canvamail.com/latest"
GET
/api/premium/otp/:address/latestAmbil OTP terbaru (auto extract angka 4-8 digit) dari email terbaru.
curl -H "X-Owner-API-Key: your-owner-api-key" \ "https://emailqu.com/api/premium/otp/abc@canvamail.com/latest"
Manage Owner API Key
Endpoint ini dipakai dari owner dashboard / backend owner (butuh owner token Bearer).
- GET
/api/owner/api-keys— list key owner - POST
/api/owner/api-keys— create key baru - DELETE
/api/owner/api-keys/:id— revoke key
curl -X POST "https://emailqu.com/api/owner/api-keys" \
-H "Authorization: Bearer owner_token_here" \
-H "Content-Type: application/json" \
-d '{"name":"primary","duration_days":90}'Contoh Isolasi A vs B
# buyer milik owner A GET /api/premium/emails/abc@canvamail.com X-Owner-API-Key: key_owner_B
Response
{
"error": "This private inbox is not accessible by provided API key"
}
# HTTP 403HTTP Status
| Code | Arti |
|---|---|
200 | Berhasil |
401 | Header API key owner tidak ada / invalid token owner |
403 | Inbox private tidak boleh diakses key tersebut (A vs B), atau key expired |
404 | Data key tidak ditemukan (pada revoke/list tertentu) |
500 | Server error |
Domain Management via API Key
Kelola domain, generate email + PIN, dan list buyers via API Key (X-Owner-API-Key).
GET
/api/premium/domainsList semua domain milik owner.
curl -H "X-Owner-API-Key: your-owner-api-key" \ "https://emailqu.com/api/premium/domains"
POST
/api/premium/domainsTambah domain baru. Otomatis cek MX record.
curl -X POST "https://emailqu.com/api/premium/domains" \
-H "X-Owner-API-Key: your-owner-api-key" \
-H "Content-Type: application/json" \
-d '{"domain":"tiro.com"}'POST
/api/premium/domains/:domain/verifyVerify MX record domain.
curl -X POST "https://emailqu.com/api/premium/domains/tiro.com/verify" \ -H "X-Owner-API-Key: your-owner-api-key"
POST
/api/premium/domains/:domain/generateGenerate email + PIN untuk domain. PIN hanya ditampilkan sekali.
curl -X POST "https://emailqu.com/api/premium/domains/tiro.com/generate" \
-H "X-Owner-API-Key: your-owner-api-key" \
-H "Content-Type: application/json" \
-d '{"count":5,"pin_length":6,"prefix":"u"}'GET
/api/premium/domains/:domain/buyersList semua buyer pada domain tertentu.
curl -H "X-Owner-API-Key: your-owner-api-key" \ "https://emailqu.com/api/premium/domains/tiro.com/buyers"