TUNGKAO Dokumentasi API
📧
API · email

Kirim email + OTP + SMTP

Kirim email dari situs lewat API atau SMTP (WordPress bisa), plus kode OTP email beserta verifikasi — otomatis berpindah antar penyedia email.

🕒 Terakhir diperbarui: Waktu Thailand (UTC+07:00) · ✅ Kode lama tetap berjalan

🤖 Minta AI menulis integrasinya

Salin tautan ini untuk dibaca AI (seluruh API dalam Markdown) atau tekan tombol: prompt disalin dan AI dibuka

https://app.tungkao.com/docs/api/email.md?lang=id
https://api.tungkao.com/changelog/email.json

Tautan ini mengembalikan pembaruan API ini sebagai JSON (tanpa key, dari asal mana pun). Tampilkan di halaman admin sebagai kotak “Pengumuman pembaruan” dan tandai “Baru” saat last_updated berubah

Salin + buka di: Menekan tombol AI otomatis menyalin prompt — jika kotak chat kosong, tinggal tempel

🔑 Key yang dipakai

Buat key email di portal merchant (API key) dan kirim header ini di setiap request — key layanan lain tidak berfungsi di sini

Authorization: Bearer $TUNGKAO_KEY

📋 Langkah

  1. Buat key email (key uji hanya ke alamat Anda sendiri, 50 per hari).
  2. SMTP: host smtp.tungkao.com, port 587 (STARTTLS) atau 465 (SSL), username bebas, password = API key Anda.
  3. API: kirim email, atau minta OTP lalu verifikasi dengan otp_id yang diterima (5 percobaan, sekali pakai).

📡 Panggilan API + contoh kode

POST/v1/email/send
curl -X POST https://api.tungkao.com/v1/email/send \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["[email protected]"],"subject":"Order #1001 confirmed","html":"<h1>Thanks for your order</h1>","text":"Thanks for your order","from_name":"My Shop","reply_to":"[email protected]"}'
POST/v1/email/otp/send
curl -X POST https://api.tungkao.com/v1/email/otp/send \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"[email protected]","brand":"My Shop","lang":"th","length":6,"ttl_seconds":300}'
POST/v1/email/otp/verify
curl -X POST https://api.tungkao.com/v1/email/otp/verify \
  -H "Authorization: Bearer $TUNGKAO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"otp_id":"8f6c2a1e-…","code":"123456"}'

📚 Contoh penggunaan

Contoh 1

Order confirmation email

Situasi: A customer completes an order

Permintaan
POST /v1/email/send
{
  "to": [
    "[email protected]"
  ],
  "subject": "Order #1001 confirmed",
  "html": "<h1>Thanks for your order</h1>",
  "text": "Thanks for your order",
  "from_name": "My Shop",
  "reply_to": "[email protected]"
}

➡️ Always send html and text; replies go to reply_to

Contoh 2

Send an email OTP

Situasi: A new sign-up must confirm their email

Permintaan
POST /v1/email/otp/send
{
  "to": "[email protected]",
  "brand": "My Shop",
  "lang": "th",
  "length": 6,
  "ttl_seconds": 300
}
Contoh respons
{
  "success": true,
  "data": {
    "otp_id": "8f6c2a1e-…"
  }
}

➡️ Keep otp_id; the code expires in 5 minutes

Contoh 3

Check the OTP

Situasi: The user types the 6-digit code

Permintaan
POST /v1/email/otp/verify
{
  "otp_id": "8f6c2a1e-…",
  "code": "123456"
}

➡️ Correct = email confirmed · too many wrong tries = code locked, send a new one

Contoh 4

Send to several people

Situasi: Tell three staff about a large order

Permintaan
POST /v1/email/send
{
  "to": [
    "[email protected]",
    "[email protected]",
    "[email protected]"
  ],
  "subject": "Large order #1002",
  "text": "Order #1002: 25,000 THB"
}

➡️ Everyone listed receives the email

Contoh 5

Review sent emails

Situasi: A customer says the email never arrived

Permintaan
GET /v1/email/messages

➡️ Check the delivery status of each email

💡 Lainnya

📜 Riwayat pembaruan API ini

  1. Ditambah Waktu Thailand (UTC+07:00)
    API update announcements by webhook: new api.update event (opt in per key on the key card; off by default)
  2. Ditambah Waktu Thailand (UTC+07:00)
    error.user_message: ready-to-show text for end users on outages, no credits or key problems (white-label keys omit tungkao.com)
  3. Ditambah Waktu Thailand (UTC+07:00)
    GET /status: status API per layanan (tanpa key)
  4. Baru Waktu Thailand (UTC+07:00)
    Layanan email diluncurkan: API + SMTP + OTP email
  5. Ditambah Waktu Thailand (UTC+07:00)
    Sakelar on/off key dengan waktu perubahan + satu key per layanan per situs
  6. Ditingkatkan Waktu Thailand (UTC+07:00)
    API v1 dibekukan permanen (hanya penambahan) + header X-Tungkao-Api-Version + pemberitahuan penghentian 12 bulan
  7. Dokumen Waktu Thailand (UTC+07:00)
    Halaman dokumen per API dengan tautan AI (10 bahasa)
  8. Keamanan Waktu Thailand (UTC+07:00)
    Verifikasi domain per API key (1 key = 1 situs) — key lama tetap berfungsi
  9. Ditambah Waktu Thailand (UTC+07:00)
    Tanda tangan request HMAC opsional — tidak ada yang berubah jika tidak diaktifkan
  10. Ditambah Waktu Thailand (UTC+07:00)
    Masa berlaku API key, pengingat, dan perpanjangan — string key tidak berubah
  11. Ditambah Waktu Thailand (UTC+07:00)
    Key mode test (simulasi, gratis) untuk semua layanan

✅ Kode lama tetap berjalan

🛡️ Janji stabilitas: integrasi sekali, terus berjalan

🚦 Status sistem (GET /status)

Cek kapan saja apakah API normal — tanpa key

GET https://api.tungkao.com/status

curl https://api.tungkao.com/status
{
  "success": true,
  "data": {
    "status": "ok",
    "services": [
      { "id": "slip_verify", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "slip_deposit", "status": "ok", "routes": ["ok", "ok", "busy"] },
      { "id": "login", "status": "ok" },
      { "id": "telegram", "status": "ok" },
      { "id": "discord", "status": "ok" },
      { "id": "email", "status": "busy" },
      { "id": "crypto", "status": "ok" },
      { "id": "core", "status": "ok" }
    ],
    "paused": [],
    "updated_at": "2026-11-14T12:00:00.000Z"
  }
}

🏷️ Ketentuan mencantumkan kredit TUNGKAO

Powered by TUNGKAO