Lompat ke konten utama
StableTerakhir diperbarui: 9 Okt 2026, 09.28

Referensi REST API

Referensi REST API ini memuat seluruh spesifikasi integrasi yang mendukung platform DagangBot AI. Dokumentasi ini merinci 105 operasi unik yang dikelompokkan ke dalam 21 tag layanan, mulai dari manajemen autentikasi, manipulasi knowledge base, hingga sinkronisasi data billing dan analitik. Setiap endpoint telah distandardisasi mengikuti pola arsitektur REST, menerima dan merespons dalam format JSON murni.

Stable

1. Ikhtisar & Nilai Bisnis

  • Penyatuan Sistem (Unified API): Memungkinkan integrasi menyeluruh (end-to-end) sistem ERP, CRM, atau dashboard internal perusahaan Anda secara langsung dengan instans core DagangBot tanpa memerlukan middleware konversi tambahan.
  • Isolasi Keamanan Ketat: Menggunakan pemisahan tipe key secara eksplisit antara konektivitas inter-server (dgb_all_) dan kredensial pengguna (Bearer Auth), memastikan rotasi kunci dapat dilakukan tanpa mematikan sesi peramban pengguna.
  • Prediktabilitas Skema Data: Memiliki arsitektur Error Envelope terpusat yang selalu memastikan balasan kesalahan tertata seragam. Integrator tidak perlu melakukan pengecekan ganda bentuk error di tingkat catch aplikasi klien.
  • Kontrol Limitasi (Rate-Limiting): Dilengkapi sistem throttle deterministik yang mencegah lonjakan beban trafik berlebih dari level tenant. Rate limit dikelola secara ketat melalui sistem keamanan platform, dengan batas global default 600 permintaan/menit (dapat diubah via variabel lingkungan RATE_LIMIT_PER_MINUTE), batas autentikasi 20 permintaan/menit (AUTH_RATE_LIMIT_PER_MINUTE), dan operasi sensitif 10 permintaan/menit (SENSITIVE_RATE_LIMIT_PER_MINUTE). Jika terlampaui, server akan membalas HTTP 429 dengan kode error RATE_LIMIT_EXCEEDED dan menyertakan header Retry-After.
Akurasi Dokumentasi

Referensi ini mencerminkan struktur internal per spesifikasi OpenAPI (v3) nyata di server.

2. Alur Visual & Antarmuka

Karena API beroperasi di belakang layar tanpa antarmuka grafis spesifik, konfigurasi otorisasi kunci harus dilakukan pada Dashboard Admin Tenant sebelum mulai mengirim request.

Dashboard API Management untuk membuat dan mengatur API Key All-in-One
Dasbor Manajemen Kunci API All-in-One tempat kredensial dihasilkan dan disalin.
Dasbor integrasi pengembang dengan katalog konektor dan saldo token
Konsol pengembang terpusat dengan monitoring kuota token, IP allowlist, dan katalog saluran data.

3. Panduan Langkah-demi-Langkah

Berikut ini panduan integrasi standar dari inisialisasi hingga manipulasi endpoint spesifik menggunakan perintah curl konvensional.

  1. 1

    Langkah 1: Persiapkan URL dan Kredensial

    Tentukan lingkungan target server Anda (pengembangan berlokasi di localhost:8080/api/v1 sementara basis produksi merujuk pada https://dagangbot.web.id/api/v1). Dapatkan API Key Anda melalui menu integrasi dan simpan dalam variabel environment lokal.

  2. 2

    Langkah 2: Uji Konektivitas Sistem (Liveness)

    Lakukan verifikasi kelancaran jalur lalu-lintas jaringan Anda terhadap server kami. Pengujian probe di bawah tidak mensyaratkan autentikasi.

    bash
    curl -X GET "https://dagangbot.web.id/api/v1/health" \
      -H "Accept: application/json"
  3. 3

    Langkah 3: Eksekusi Query ke Sistem Terproteksi

    Setelah terhubung, kirimkan perintah mutasi (misalnya: membuat produk baru). Sisipkan kunci atau token JWT pada parameter Authorization atau X-API-Key di header.

    bash
    curl -X POST "https://dagangbot.web.id/api/v1/all-in-one/products" \
      -H "X-API-Key: dgb_all_abc123" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Layanan Premium Integrasi",
        "price": 500000,
        "description": "Deskripsi layanan panjang lebar."
      }'
  4. 4

    Langkah 4: Validasi Format Kesalahan

    Selalu rancang interseptor (interceptor) jaringan pada pustaka fetch HTTP Anda yang mengantisipasi skema 4xx atau 5xx untuk diselaraskan ke fungsi UI atau notifikasi pelaporan eror internal.

4. Parameter & Spesifikasi Teknis

Semua komunikasi data harus menyertakan tipe konten application/json (kecuali tipe formulir unggahan multipart).

4.1. Skema Autentikasi & Otorisasi

DagangBot menggunakan pemisahan yang tegas antara token Personal/User dan Machine-to-Machine (M2M) Key untuk memitigasi penyalahgunaan kredensial. Setiap endpoint mensyaratkan salah satu dari pendekatan ini:

  1. Bearer Token (JWT): Digunakan oleh aplikasi dasbor atau peramban pengguna. Dikirim pada Authorization: Bearer <token>. Masa berlaku (Time-to-Live) lebih singkat dan terkait dengan sesi pengguna individu serta izin (RBAC scopes).
  2. API Key (M2M): Spesifik untuk klaster /api/v1/all-in-one/*. Dikirim pada header X-API-Key atau Authorization dengan awalan dgb_all_. Bersifat statis, tidak terikat ke satu pengguna, dan digunakan secara eksklusif untuk integrasi server antar peladen (misal: penarikan katalog otomatis dari ERP).

4.2. Konvensi Paginasi

Endpoint berdata besar mendukung dua jenis paginasi yang tidak dapat dicampur:

  • Paginasi Berbasis Halaman (Offset-based): Digunakan pada API daftar standar (seperti /customers atau /products). Memanfaatkan parameter URL page (default 1) dan per_page (default tergantung endpoint, maksimum 100). Balasan akan mengembalikan bungkusan meta dengan format:

    json
    "meta": {
      "page": 1,
      "per_page": 20,
      "total": 512,
      "total_pages": 26
    }
  • Paginasi Kursor (Cursor-based / Monotonic): Dirancang khusus untuk sinkronisasi sekstensif dan berkecepatan tinggi, seperti modul antrean pesan atau pengunduhan log antrean internal (event/outbox). Klien memberikan cursor (berupa sequence ID, atau -1/0 untuk dari awal) beserta limit limit. Klien lalu menelusuri balasan Cursor (atau CursorRef) untuk pemanggilan selanjutnya. Pendekatan cursor sangat resisten terhadap insiden penambahan data acak (phantom reads) saat paginasi berjalan.

4.3. Tabel A. Header Fundamental Jaringan

Nama Header Deskripsi & Tujuan Status Wajib
Content-Type Harus application/json pada beban kerja baca-tulis baku. Wajib untuk POST/PUT
Authorization Menyimpan Bearer Token JWT sesi dashboard pengguna. Spesifik endpoint
X-API-Key Memegang kredensial statis layanan untuk akses antarsistem. Spesifik endpoint
Idempotency-Key String unik dari klien (UUID). Wajib untuk mutasi krusial seperti /billing/topup. Spesifik endpoint mutasi
Retry-After Waktu jeda (detik) yang diperlukan klien sebelum mencoba ulang API bila terkena HTTP 429 Rate Limit. -

4.4. Tabel Parameter URL Global (Query Params)

Nama Parameter Tipe Data Deskripsi Standar Default
page int Indeks halaman pengambilan (Offset pagination). 1
per_page int Batasan jumlah data per balasan. Umumnya 20 (Maks 100)
cursor int64 / string Penanda posisi terakhir penarikan sinkronisasi (Cursor pagination). 0
limit int Batas tarikan khusus paginasi kursor. Umumnya 100 (Maks 1000)
search string Pencarian teks berbasis kueri leksikal ringan. null

4.5. Struktur Bungkusan (Envelope)

Sukses Envelope (SuccessResponse)

Setiap keberhasilan membalas dalam bentuk standar yang selalu memiliki field data, serta field opsional meta untuk parameter paginasi.

json
{
  "data": [
    { "id": "123", "name": "Budi" }
  ],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 1,
    "total_pages": 1
  }
}

Bungkusan Error Berstandar (ErrorResponse)

Platform kami menggunakan ErrorResponse deterministik. Semua 4xx dan 5xx mematuhi JSON berikut ini (pesan internal pangkalan data / SQLSTATE leak tidak akan disajikan, ditangani oleh fungsi sanitizeMessage).

Field JSON Tipe Data Keterangan
error object Bungkusan luar yang menjamin payload adalah eror.
error.code string Kode kategorikal standar, misal VALIDATION_ERROR, NOT_FOUND, FORBIDDEN.
error.message string Penjelasan ramah manusia tentang alasan penolakan (telah tersanitasi).
error.details array / object Opsional. Detail untuk struktur yang melanggar (contohnya request_id saat 500).

Daftar Katalog Endpoint Aktif

Terdapat 105 titik akses API yang tercatat aktif beroperasi, tersebar melintasi klaster sub-sistem utama.

All-in-One API

GET/all-in-one/accountApiKeyAuth

Baca detail akun merchant

Identitas, langganan, saldo token, statistik. Scope `account:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/account" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail akun
GET/all-in-one/mediaApiKeyAuth

Daftar media library tenant

Daftar aset (foto produk, media katalog WA, lampiran bukti bayar). Read-only. Scope `media:read`. Query `module`, `file_type`, `page`, `per_page` (maks 100).

Parameter

NamaLokasiWajibTipeDeskripsi
modulequeryTidakstring-
file_typequeryTidakstring-
pagequeryTidakinteger-
per_pagequeryTidakinteger-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/media" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar aset beserta meta paginasi
403Key tidak punya scope media:read (key lama perlu migrasi 000341)
POST/all-in-one/otp/sendApiKeyAuth

Kirim OTP

Scope `otp:send`.

Body (wajib)

FieldWajibTipeDeskripsi
phoneYastring-
contoh-body.json
{
  "phone": "6281234567890"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/otp/send" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "6281234567890" }'

Respons

StatusDeskripsi
200OTP terkirim
POST/all-in-one/otp/verifyApiKeyAuth

Verifikasi OTP

Scope `otp:send`.

Body (wajib)

FieldWajibTipeDeskripsi
phoneYastring-
otp_codeYastring-
contoh-body.json
{
  "phone": "6281234567890",
  "otp_code": "123456"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/otp/verify" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "6281234567890", "otp_code": "123456" }'

Respons

StatusDeskripsi
200OTP tervalidasi
POST/all-in-one/rag/queryApiKeyAuth

Query RAG (jawaban dari knowledge base)

Pencarian vektor + sintesis jawaban AI atas knowledge base merchant. Scope `rag:read`. Bila provider embedding tidak tersedia, otomatis beralih ke pencarian kata kunci (field `used_fallback` = true).

Body (wajib)

FieldWajibTipeDeskripsi
queryYastring-
top_kTidakinteger-
contoh-body.json
{
  "query": "<teks>",
  "top_k": 0
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/rag/query" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "query": "<teks>", "top_k": 0 }'

Respons

StatusDeskripsi
200Jawaban + hasil pencarian
POST/all-in-one/notify/sendApiKeyAuth

Kirim notifikasi multi-kanal

Scope `notify:send`.

Body (wajib)

FieldWajibTipeDeskripsi
phoneYastring-
template_typeYastring-
contentTidakstring-
variablesTidakobject-
contoh-body.json
{
  "phone": "6281234567890",
  "template_type": "<teks>",
  "content": "<teks>",
  "variables": {}
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/notify/send" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "6281234567890", "template_type": "<teks>", "content": "<teks>", "variables": {} }'

Respons

StatusDeskripsi
200Notifikasi terkirim
POST/all-in-one/messages/sendApiKeyAuth

Kirim pesan WhatsApp ke satu nomor

Scope `messages:send`.

Body (wajib)

FieldWajibTipeDeskripsi
phoneYastring-
contentTidakstring-
media_urlTidakstring-
contoh-body.json
{
  "phone": "6281234567890",
  "content": "<teks>",
  "media_url": "https://contoh.id"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/messages/send" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "6281234567890", "content": "<teks>", "media_url": "https://contoh.id" }'

Respons

StatusDeskripsi
200Pesan terkirim
422Nomor / konten tidak valid
POST/all-in-one/webhookApiKeyAuth

Terima event webhook masuk (dua arah)

Menyimpan event ke inbox tenant. Scope `webhook:receive`.

Body (opsional)

FieldWajibTipeDeskripsi
eventTidakstring-
dataTidakobject-
contoh-body.json
{
  "event": "<teks>",
  "data": {}
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/webhook" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "event": "<teks>", "data": {} }'

Respons

StatusDeskripsi
202Event diterima
GET/all-in-one/wa/instancesApiKeyAuth

Daftar instance WhatsApp

Menampilkan nomor WhatsApp milik tenant beserta status koneksinya (id, instance_name, phone_number, connection_status, connection_type, service_role, dsb). Scope `wa:manage`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/wa/instances" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar instance WhatsApp
POST/all-in-one/wa/instancesApiKeyAuth

Tambah nomor WhatsApp baru

Membuat sesi WhatsApp baru di gateway lalu menyimpannya. Scope `wa:manage`. Rate-limited (SensitiveLimit). Untuk tenant dengan scope cabang, `branch_id` wajib diisi.

Body (wajib)

FieldWajibTipeDeskripsi
instance_nameYastring-
connection_typeTidakstring-
service_roleTidakstring-
branch_idTidakstring (uuid)Wajib bila tenant memakai scope cabang
contoh-body.json
{
  "instance_name": "Contoh Nama",
  "connection_type": "unofficial",
  "service_role": "<teks>",
  "branch_id": "<teks>"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/wa/instances" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "instance_name": "Contoh Nama", "connection_type": "unofficial", "service_role": "<teks>", "branch_id": "<teks>" }'

Respons

StatusDeskripsi
201Instance dibuat (menyertakan qr_code bila unofficial)
400Nama instance tidak valid
403Kuota nomor WA tercapai atau plan tidak mengizinkan
409Nama instance sudah dipakai
GET/all-in-one/wa/instances/{id}/qrApiKeyAuth

Ambil kode QR untuk scan

Mengembalikan QR live (data URL base64) untuk memindai nomor. Bila perangkat sudah tersambung, balasan berisi connected=true tanpa QR. Scope `wa:manage`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring (uuid)-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/wa/instances/{id}/qr" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200{ qr_code, pairing_code, status, ... }
404Instance tidak ditemukan
POST/all-in-one/wa/instances/{id}/restartApiKeyAuth

Restart koneksi sesi WhatsApp

Scope `wa:manage`. Rate-limited (SensitiveLimit).

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring (uuid)-
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/wa/instances/{id}/restart" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Sesi WhatsApp direstart
404Instance tidak ditemukan
DELETE/all-in-one/wa/instances/{id}ApiKeyAuth

Hapus instance WhatsApp

Memutus dan menghapus instance. Scope `wa:manage`. Rate-limited (SensitiveLimit).

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring (uuid)-
purge_modequeryTidakstring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/all-in-one/wa/instances/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Instance WhatsApp dihapus
404Instance tidak ditemukan
GET/all-in-one/billing/balanceApiKeyAuth

Lihat saldo token

Scope `billing:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/billing/balance" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Saldo token & ringkasan
GET/all-in-one/billing/transactionsApiKeyAuth

Riwayat transaksi token

Scope `billing:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/billing/transactions" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar transaksi
GET/all-in-one/billing/invoicesApiKeyAuth

Daftar invoice

Scope `billing:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/billing/invoices" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar invoice
POST/all-in-one/billing/topupApiKeyAuth

Topup saldo (membuat invoice pembayaran)

Membuat invoice top-up saldo token lewat payment gateway. Saldo bertambah setelah pembayaran terkonfirmasi (webhook gateway). Scope `billing:create`. Wajib header `Idempotency-Key`.

Parameter

NamaLokasiWajibTipeDeskripsi
Idempotency-KeyheaderYastring-

Body (wajib)

FieldWajibTipeDeskripsi
amountYanumber-
payment_gatewayTidakstring-
contoh-body.json
{
  "amount": 0,
  "payment_gateway": "<teks>"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/billing/topup" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 0, "payment_gateway": "<teks>" }'

Respons

StatusDeskripsi
201Invoice topup dibuat + info pembayaran
422Nominal tidak valid
GET/all-in-one/productsApiKeyAuth

Daftar produk

Scope `products:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/products" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar produk
POST/all-in-one/productsApiKeyAuth

Buat produk

Scope `products:create`.

curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/products" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
201Produk dibuat
PUT/all-in-one/products/{id}ApiKeyAuth

Ubah produk

Scope `products:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/products/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Produk diperbarui
DELETE/all-in-one/products/{id}ApiKeyAuth

Hapus produk

Scope `products:delete`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/all-in-one/products/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Produk dihapus
GET/all-in-one/ordersApiKeyAuth

Daftar pesanan

Scope `orders:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/orders" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar pesanan
POST/all-in-one/ordersApiKeyAuth

Buat pesanan

Scope `orders:create`.

curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/orders" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
201Pesanan dibuat
GET/all-in-one/orders/{id}ApiKeyAuth

Detail pesanan

Scope `orders:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/orders/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail pesanan
PUT/all-in-one/orders/{id}/statusApiKeyAuth

Ubah status pesanan

Scope `orders:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/orders/{id}/status" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Status diperbarui
GET/all-in-one/customersApiKeyAuth

Daftar pelanggan

Scope `customers:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/customers" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar pelanggan
GET/all-in-one/customers/{id}ApiKeyAuth

Detail pelanggan

Scope `customers:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/customers/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail pelanggan
PUT/all-in-one/customers/{id}ApiKeyAuth

Ubah pelanggan

Scope `customers:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/customers/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Pelanggan diperbarui
GET/all-in-one/vouchersApiKeyAuth

Daftar voucher

Scope `vouchers:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/vouchers" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar voucher
POST/all-in-one/vouchersApiKeyAuth

Buat voucher

Scope `vouchers:create`.

curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/vouchers" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
201Voucher dibuat
POST/all-in-one/vouchers/validateApiKeyAuth

Validasi voucher

Scope `vouchers:read`.

curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/vouchers/validate" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Hasil validasi
GET/all-in-one/vouchers/{id}ApiKeyAuth

Detail voucher

Scope `vouchers:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/vouchers/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail voucher
PUT/all-in-one/vouchers/{id}ApiKeyAuth

Ubah voucher

Scope `vouchers:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/vouchers/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Voucher diperbarui
DELETE/all-in-one/vouchers/{id}ApiKeyAuth

Hapus voucher

Scope `vouchers:delete`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/all-in-one/vouchers/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Voucher dihapus
GET/all-in-one/servicesApiKeyAuth

Daftar layanan (service catalog)

Scope `services:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/services" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar layanan
POST/all-in-one/servicesApiKeyAuth

Buat layanan

Scope `services:create`.

curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/services" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
201Layanan dibuat
PUT/all-in-one/services/{id}ApiKeyAuth

Ubah layanan

Scope `services:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/services/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Layanan diperbarui
DELETE/all-in-one/services/{id}ApiKeyAuth

Hapus layanan

Scope `services:delete`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/all-in-one/services/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Layanan dihapus
GET/all-in-one/bookingsApiKeyAuth

Daftar booking

Scope `bookings:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/bookings" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar booking
GET/all-in-one/bookings/{id}ApiKeyAuth

Detail booking

Scope `bookings:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/bookings/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail booking
PUT/all-in-one/bookings/{id}/statusApiKeyAuth

Ubah status booking

Scope `bookings:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/bookings/{id}/status" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Status booking diperbarui
PUT/all-in-one/bookings/{id}/cancelApiKeyAuth

Batalkan booking

Scope `bookings:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/all-in-one/bookings/{id}/cancel" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Booking dibatalkan
GET/all-in-one/conversationsApiKeyAuth

Daftar percakapan (inbox)

Scope `conversations:read`.

curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/conversations" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar percakapan
GET/all-in-one/conversations/{id}ApiKeyAuth

Detail percakapan

Scope `conversations:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/conversations/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail percakapan
GET/all-in-one/conversations/{id}/messagesApiKeyAuth

Pesan dalam percakapan

Scope `conversations:read`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/conversations/{id}/messages" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar pesan
POST/all-in-one/conversations/{id}/replyApiKeyAuth

Balas percakapan

Scope `conversations:create` atau `conversations:update`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-

Body (wajib)

FieldWajibTipeDeskripsi
contentTidakstring-
media_urlTidakstring-
contoh-body.json
{
  "content": "<teks>",
  "media_url": "https://contoh.id"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/conversations/{id}/reply" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "content": "<teks>", "media_url": "https://contoh.id" }'

Respons

StatusDeskripsi
200Balasan terkirim
POST/all-in-one/article-gen/generateApiKeyAuth

Buat antrian generate artikel AI

Scope `article_gen`. Menerima project_id atau daftar keywords langsung untuk generate artikel SEO otomatis.

Body (wajib)

FieldWajibTipeDeskripsi
project_idTidakstring-
keywordsTidakstring[]-
toneTidakstring-
categoryTidakstring-
webhook_urlTidakstring-
webhook_secretTidakstring-
company_contextTidakstring-
contoh-body.json
{
  "project_id": "<teks>",
  "keywords": [],
  "tone": "<teks>",
  "category": "<teks>",
  "webhook_url": "https://contoh.id",
  "webhook_secret": "<teks>",
  "company_context": "<teks>"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/article-gen/generate" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "project_id": "<teks>", "keywords": [], "tone": "<teks>", "category": "<teks>", "webhook_url": "https://contoh.id", "webhook_secret": "<teks>", "company_context": "<teks>" }'

Respons

StatusDeskripsi
202Batch generate diterima
GET/all-in-one/article-gen/batches/{id}ApiKeyAuth

Status dan progres antrian batch artikel

Scope `article_gen`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/article-gen/batches/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail status batch artikel
GET/all-in-one/article-gen/batches/{id}/articlesApiKeyAuth

Daftar artikel dalam batch

Scope `article_gen`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/article-gen/batches/{id}/articles" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Daftar artikel dalam batch
GET/all-in-one/article-gen/articles/{id}ApiKeyAuth

Detail artikel hasil generate

Scope `article_gen`.

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/all-in-one/article-gen/articles/{id}" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Detail lengkap artikel
POST/all-in-one/article-gen/estimateApiKeyAuth

Estimasi biaya dan kuota artikel

Scope `article_gen`.

Body (wajib)

FieldWajibTipeDeskripsi
keyword_idsYastring[]-
contoh-body.json
{
  "keyword_ids": []
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/all-in-one/article-gen/estimate" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "keyword_ids": [] }'

Respons

StatusDeskripsi
200Estimasi kuota gratis dan biaya IDR
Metode Path Tujuan Autentikasi
GET /all-in-one/account Baca detail akun merchant API Key
GET /all-in-one/media Daftar media library tenant API Key
POST /all-in-one/otp/send Kirim OTP API Key
POST /all-in-one/otp/verify Verifikasi OTP API Key
POST /all-in-one/rag/query Query RAG (jawaban dari knowledge base) API Key
POST /all-in-one/notify/send Kirim notifikasi multi-kanal API Key
POST /all-in-one/messages/send Kirim pesan WhatsApp ke satu nomor API Key
POST /all-in-one/webhook Terima event webhook masuk (dua arah) API Key
GET /all-in-one/wa/instances Daftar instance WhatsApp API Key
POST /all-in-one/wa/instances Tambah nomor WhatsApp baru API Key
GET /all-in-one/wa/instances/{id}/qr Ambil kode QR untuk scan API Key
POST /all-in-one/wa/instances/{id}/restart Restart koneksi sesi WhatsApp API Key
DELETE /all-in-one/wa/instances/{id} Hapus instance WhatsApp API Key
GET /all-in-one/billing/balance Lihat saldo token API Key
GET /all-in-one/billing/transactions Riwayat transaksi token API Key
GET /all-in-one/billing/invoices Daftar invoice API Key
POST /all-in-one/billing/topup Topup saldo (membuat invoice pembayaran) API Key
GET /all-in-one/products Daftar produk API Key
POST /all-in-one/products Buat produk API Key
PUT /all-in-one/products/{id} Ubah produk API Key
DELETE /all-in-one/products/{id} Hapus produk API Key
GET /all-in-one/orders Daftar pesanan API Key
POST /all-in-one/orders Buat pesanan API Key
GET /all-in-one/orders/{id} Detail pesanan API Key
PUT /all-in-one/orders/{id}/status Ubah status pesanan API Key
GET /all-in-one/customers Daftar pelanggan API Key
GET /all-in-one/customers/{id} Detail pelanggan API Key
PUT /all-in-one/customers/{id} Ubah pelanggan API Key
GET /all-in-one/vouchers Daftar voucher API Key
POST /all-in-one/vouchers Buat voucher API Key
POST /all-in-one/vouchers/validate Validasi voucher API Key
GET /all-in-one/vouchers/{id} Detail voucher API Key
PUT /all-in-one/vouchers/{id} Ubah voucher API Key
DELETE /all-in-one/vouchers/{id} Hapus voucher API Key
GET /all-in-one/services Daftar layanan (service catalog) API Key
POST /all-in-one/services Buat layanan API Key
PUT /all-in-one/services/{id} Ubah layanan API Key
DELETE /all-in-one/services/{id} Hapus layanan API Key
GET /all-in-one/bookings Daftar booking API Key
GET /all-in-one/bookings/{id} Detail booking API Key
PUT /all-in-one/bookings/{id}/status Ubah status booking API Key
PUT /all-in-one/bookings/{id}/cancel Batalkan booking API Key
GET /all-in-one/conversations Daftar percakapan (inbox) API Key
GET /all-in-one/conversations/{id} Detail percakapan API Key
GET /all-in-one/conversations/{id}/messages Pesan dalam percakapan API Key
POST /all-in-one/conversations/{id}/reply Balas percakapan API Key
POST /all-in-one/article-gen/generate Buat antrian generate artikel AI API Key
GET /all-in-one/article-gen/batches/{id} Status dan progres batch artikel API Key
GET /all-in-one/article-gen/batches/{id}/articles Daftar artikel dalam batch API Key
GET /all-in-one/article-gen/articles/{id} Detail artikel hasil generate API Key
POST /all-in-one/article-gen/estimate Estimasi biaya dan kuota artikel API Key

Analytics

GET/analytics/overviewBearerAuth

Analytics KPI and conversion overview

Parameter

NamaLokasiWajibTipeDeskripsi
branch_idqueryTidakstring-
start_datequeryTidakstring (date)-
end_datequeryTidakstring (date)-
curl
curl -X GET "https://dagangbot.co.id/api/v1/analytics/overview" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200KPI and conversion overview stats
Metode Path Tujuan Autentikasi
GET /analytics/overview Analytics KPI overview Bearer
GET /analytics/funnel Pipeline conversion funnel Bearer

Anti-Fraud

GET/fraud/flagsBearerAuth

List fraud flags

curl
curl -X GET "https://dagangbot.co.id/api/v1/fraud/flags" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Flags list
PUT/fraud/flags/{id}/resolveBearerAuth

Resolve fraud flag

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-

Body (opsional)

FieldWajibTipeDeskripsi
statusTidakstring-
notesTidakstring-
contoh-body.json
{
  "status": "resolved",
  "notes": "<teks>"
}
curl
curl -X PUT "https://dagangbot.co.id/api/v1/fraud/flags/{id}/resolve" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "status": "resolved", "notes": "<teks>" }'

Respons

StatusDeskripsi
200Flag resolved
Metode Path Tujuan Autentikasi
GET /fraud/flags List fraud flags Bearer
PUT /fraud/flags/{id}/review Review fraud flag Bearer

Auth

POST/auth/registerPublik

Register merchant and trigger OTP

Body (wajib)

FieldWajibTipeDeskripsi
merchant_nameYastring-
phoneYastring-
nameYastring-
emailYastring-
passwordYastring-
accept_tosYaboolean-
accept_privacyYaboolean-
contoh-body.json
{
  "merchant_name": "Toko Saya",
  "phone": "6281234567890",
  "name": "Contoh Nama",
  "email": "[email protected]",
  "password": "KataSandi123",
  "accept_tos": true,
  "accept_privacy": true
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/register" \
  -H "Content-Type: application/json" \
  -d '{ "merchant_name": "Toko Saya", "phone": "6281234567890", "name": "Contoh Nama", "email": "[email protected]", "password": "KataSandi123", "accept_tos": true, "accept_privacy": true }'

Respons

StatusDeskripsi
201Registration initiated, OTP sent
POST/auth/verify-otpPublik

Verify registration OTP and issue JWT

Body (wajib)

FieldWajibTipeDeskripsi
phoneYastring-
otp_codeYastring-
contoh-body.json
{
  "phone": "6281234567890",
  "otp_code": "123456"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/verify-otp" \
  -H "Content-Type: application/json" \
  -d '{ "phone": "6281234567890", "otp_code": "123456" }'

Respons

StatusDeskripsi
200Tokens issued
POST/auth/loginPublik

Login with email and password

Body (wajib)

FieldWajibTipeDeskripsi
emailYastring-
passwordYastring-
contoh-body.json
{
  "email": "[email protected]",
  "password": "KataSandi123"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{ "email": "[email protected]", "password": "KataSandi123" }'

Respons

StatusDeskripsi
200Login successful
429Brute force lockout triggered
POST/auth/refreshPublik

Refresh JWT access token

Body (wajib)

FieldWajibTipeDeskripsi
refresh_tokenYastring-
contoh-body.json
{
  "refresh_token": "<token>"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/refresh" \
  -H "Content-Type: application/json" \
  -d '{ "refresh_token": "<token>" }'

Respons

StatusDeskripsi
200New token pair issued
POST/auth/logoutBearerAuth

Revoke current session JWT token

curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/logout" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Token revoked and added to blacklist
GET/auth/meBearerAuth

Inspect user and merchant profile

curl
curl -X GET "https://dagangbot.co.id/api/v1/auth/me" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Profile retrieved
POST/auth/api-key/rotateBearerAuth

Rotate tenant API Key (Owner only)

curl
curl -X POST "https://dagangbot.co.id/api/v1/auth/api-key/rotate" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200New API Key generated
Metode Path Tujuan Autentikasi
POST /auth/register Register merchant and trigger OTP None
POST /auth/verify-otp Verify registration OTP and issue JWT None
POST /auth/login Login with email and password None
POST /auth/refresh Refresh JWT access token None
POST /auth/logout Revoke current session JWT token Bearer
GET /auth/me Inspect user and merchant profile Bearer
POST /auth/api-key/rotate Rotate tenant API Key (Owner only) Bearer

Billing

GET/billing/balanceBearerAuth

Get token balance and consumption breakdown

curl
curl -X GET "https://dagangbot.co.id/api/v1/billing/balance" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Balance details
POST/billing/topupBearerAuth

Create token topup invoice

curl
curl -X POST "https://dagangbot.co.id/api/v1/billing/topup" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Invoice and payment URL created
GET/billing/invoicesBearerAuth

List billing invoices

curl
curl -X GET "https://dagangbot.co.id/api/v1/billing/invoices" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Invoices list
GET/billing/transactionsBearerAuth

List token ledger transactions

curl
curl -X GET "https://dagangbot.co.id/api/v1/billing/transactions" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Transactions list
Metode Path Tujuan Autentikasi
GET /billing/balance Get token balance and consumption breakdown Bearer
POST /billing/topup Create token topup invoice Bearer
GET /billing/invoices List billing invoices Bearer
GET /billing/transactions List token ledger transactions Bearer

Bookings

GET/bookingsBearerAuth

List bookings

curl
curl -X GET "https://dagangbot.co.id/api/v1/bookings" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Bookings list
POST/bookingsBearerAuth

Create booking

curl
curl -X POST "https://dagangbot.co.id/api/v1/bookings" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Booking created
GET/bookings/availabilityBearerAuth

Get booking availability slots for a date

Parameter

NamaLokasiWajibTipeDeskripsi
datequeryTidakstring (date)-
service_idqueryTidakstring-
practitioner_idqueryTidakstring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/bookings/availability" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Available slots
Metode Path Tujuan Autentikasi
GET /bookings List bookings Bearer
POST /bookings Create booking Bearer
GET /bookings/slots Get availability slots Bearer

Broadcast

GET/broadcast/campaignsBearerAuth

List broadcast campaigns

curl
curl -X GET "https://dagangbot.co.id/api/v1/broadcast/campaigns" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Campaigns list
POST/broadcast/campaignsBearerAuth

Create broadcast campaign

curl
curl -X POST "https://dagangbot.co.id/api/v1/broadcast/campaigns" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Campaign created
POST/broadcast/campaigns/{id}/startBearerAuth

Start throttled broadcast delivery

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X POST "https://dagangbot.co.id/api/v1/broadcast/campaigns/{id}/start" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Broadcast started
Metode Path Tujuan Autentikasi
GET /campaigns List campaigns Bearer
POST /campaigns Create broadcast campaign Bearer
POST /campaigns/{id}/start Start throttled broadcast delivery Bearer

Customers

GET/customersBearerAuth

List customers with pagination and filtering

Parameter

NamaLokasiWajibTipeDeskripsi
branch_idqueryTidakstring-
stagequeryTidakstring-
searchqueryTidakstring-
pagequeryTidakinteger-
per_pagequeryTidakinteger-
curl
curl -X GET "https://dagangbot.co.id/api/v1/customers" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Customer list
GET/customers/{id}BearerAuth

Get customer detail profile including conversations, orders, and pipeline history

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/customers/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Customer full detail
404Customer not found
GET/customers/exportBearerAuth

Export customers to CSV

Parameter

NamaLokasiWajibTipeDeskripsi
branch_idqueryTidakstring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/customers/export" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200CSV file stream
Metode Path Tujuan Autentikasi
GET /customers List customers with pagination and filtering Bearer
GET /customers/{id} Get customer detail profile including conversations, orders, and pipeline history Bearer
GET /customers/export Export customers to CSV Bearer

Health

GET/healthPublik

Liveness Probe

curl
curl -X GET "https://dagangbot.co.id/api/v1/health"

Respons

StatusDeskripsi
200Service alive
GET/health/readyPublik

Readiness Probe

curl
curl -X GET "https://dagangbot.co.id/api/v1/health/ready"

Respons

StatusDeskripsi
200Dependencies reachable
Metode Path Tujuan Autentikasi
GET /health Liveness Probe None
GET /health/ready Readiness Probe None

Knowledge Base

GET/kb/documentsBearerAuth

List KB documents

curl
curl -X GET "https://dagangbot.co.id/api/v1/kb/documents" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Documents list
POST/kb/uploadBearerAuth

Upload KB document with 512-byte MIME sniffing

Body (opsional)

FieldWajibTipeDeskripsi
fileTidakstring (binary)-
titleTidakstring-
curl
curl -X POST "https://dagangbot.co.id/api/v1/kb/upload" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Document queued for embedding
POST/kb/searchBearerAuth

Vector similarity search

curl
curl -X POST "https://dagangbot.co.id/api/v1/kb/search" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Relevant chunks
Metode Path Tujuan Autentikasi
GET /kb/documents List KB documents Bearer
POST /kb/upload Upload KB document with 512-byte MIME sniffing Bearer
POST /kb/search Vector similarity search Bearer
POST/consentBearerAuth

Record user or customer consent

curl
curl -X POST "https://dagangbot.co.id/api/v1/consent" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Consent recorded
POST/data-deletion-requestsBearerAuth

Submit PDP data deletion / anonymization request

curl
curl -X POST "https://dagangbot.co.id/api/v1/data-deletion-requests" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Deletion request submitted
Metode Path Tujuan Autentikasi
GET /legal/documents/{type} Public legal documents (ToS, Privacy Policy, DPA) None
POST /consent Record user or customer consent Bearer
POST /data-deletion-requests Submit PDP data deletion / anonymization request Bearer

Media

GET/mediaBearerAuth

List media library assets

curl
curl -X GET "https://dagangbot.co.id/api/v1/media" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Media assets
POST/mediaBearerAuth

Upload and auto-optimize media with MIME sniffing

Body (opsional)

FieldWajibTipeDeskripsi
fileTidakstring (binary)-
moduleTidakstring-
curl
curl -X POST "https://dagangbot.co.id/api/v1/media" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Media uploaded and stored
Metode Path Tujuan Autentikasi
GET /media List media library assets Bearer
POST /media Upload and auto-optimize media with MIME sniffing Bearer

Notifications

POST/notify/sendBearerAuthApiKeyAuth

Dispatch multi-channel notification

curl
curl -X POST "https://dagangbot.co.id/api/v1/notify/send" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "X-API-Key: $DAGANGBOT_API_KEY"

Respons

StatusDeskripsi
200Notification dispatched
Metode Path Tujuan Autentikasi
POST /notify/send Dispatch multi-channel notification Bearer, API Key

OTP

POST/otp/sendApiKeyAuth

Send OTP via WhatsApp or SMS fallback

Body (wajib)

FieldWajibTipeDeskripsi
phone_numberYastring-
contoh-body.json
{
  "phone_number": "6281234567890"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/otp/send" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone_number": "6281234567890" }'

Respons

StatusDeskripsi
200OTP dispatched
POST/otp/verifyApiKeyAuth

Verify OTP code

Body (wajib)

FieldWajibTipeDeskripsi
phone_numberYastring-
otp_codeYastring-
contoh-body.json
{
  "phone_number": "6281234567890",
  "otp_code": "123456"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/otp/verify" \
  -H "X-API-Key: $DAGANGBOT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "phone_number": "6281234567890", "otp_code": "123456" }'

Respons

StatusDeskripsi
200OTP validated
Metode Path Tujuan Autentikasi
POST /otp/send Send OTP via WhatsApp or SMS fallback API Key
POST /otp/verify Verify OTP code API Key

Orders

GET/ordersBearerAuth

List tenant orders

curl
curl -X GET "https://dagangbot.co.id/api/v1/orders" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Paginated orders
POST/ordersBearerAuth

Create new order

curl
curl -X POST "https://dagangbot.co.id/api/v1/orders" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Order created
GET/orders/{id}BearerAuth

Get order by ID

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/orders/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Order detail
PUT/orders/{id}/statusBearerAuth

Update order status

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/orders/{id}/status" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Status updated
Metode Path Tujuan Autentikasi
GET /orders List tenant orders Bearer
POST /orders Create new order Bearer
GET /orders/{id} Get order by ID Bearer
PUT /orders/{id}/status Update order status Bearer

Pipeline

GET/pipelineBearerAuth

Retrieve pipeline Kanban board with stages and contacts

Parameter

NamaLokasiWajibTipeDeskripsi
branch_idqueryTidakstringOptional branch ID to narrow customer scope
curl
curl -X GET "https://dagangbot.co.id/api/v1/pipeline" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Pipeline stages and customer list
403Branch access denied
POST/pipeline/stagesBearerAuth

Create new pipeline stage

Body (wajib)

FieldWajibTipeDeskripsi
nameYastring-
positionTidakinteger-
colorYastring-
is_defaultTidakboolean-
descriptionTidakstring-
stale_after_hoursTidakinteger-
ai_classification_enabledTidakboolean-
contoh-body.json
{
  "name": "Contoh Nama",
  "position": 0,
  "color": "<teks>",
  "is_default": true,
  "description": "<teks>",
  "stale_after_hours": 0,
  "ai_classification_enabled": true
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/pipeline/stages" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Contoh Nama", "position": 0, "color": "<teks>", "is_default": true, "description": "<teks>", "stale_after_hours": 0, "ai_classification_enabled": true }'

Respons

StatusDeskripsi
201Stage created
POST/pipeline/stages/generate-criteriaBearerAuth

Generate AI classification criteria for a pipeline stage

Body (wajib)

FieldWajibTipeDeskripsi
stage_nameYastring-
descriptionTidakstring-
objectiveTidakstring-
branch_idTidakstring-
contoh-body.json
{
  "stage_name": "Contoh Nama",
  "description": "<teks>",
  "objective": "<teks>",
  "branch_id": "<teks>"
}
curl
curl -X POST "https://dagangbot.co.id/api/v1/pipeline/stages/generate-criteria" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "stage_name": "Contoh Nama", "description": "<teks>", "objective": "<teks>", "branch_id": "<teks>" }'

Respons

StatusDeskripsi
200Criteria generated
402Insufficient token balance
PUT/pipeline/stages/{id}BearerAuth

Update pipeline stage

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-

Body (opsional)

FieldWajibTipeDeskripsi
nameTidakstring-
positionTidakinteger-
colorTidakstring-
descriptionTidakstring-
stale_after_hoursTidakinteger0 clears back to null
ai_classification_enabledTidakboolean-
contoh-body.json
{
  "name": "Contoh Nama",
  "position": 0,
  "color": "<teks>",
  "description": "<teks>",
  "stale_after_hours": 0,
  "ai_classification_enabled": true
}
curl
curl -X PUT "https://dagangbot.co.id/api/v1/pipeline/stages/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Contoh Nama", "position": 0, "color": "<teks>", "description": "<teks>", "stale_after_hours": 0, "ai_classification_enabled": true }'

Respons

StatusDeskripsi
200Stage updated
DELETE/pipeline/stages/{id}BearerAuth

Delete pipeline stage and migrate contacts to default stage

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/pipeline/stages/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Stage deleted and contacts migrated
PUT/pipeline/contacts/{id}/stageBearerAuth

Move customer pipeline stage (Kanban drag) with manual cooldown pin

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-

Body (wajib)

FieldWajibTipeDeskripsi
stageTidakstring-
contoh-body.json
{
  "stage": "<teks>"
}
curl
curl -X PUT "https://dagangbot.co.id/api/v1/pipeline/contacts/{id}/stage" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "stage": "<teks>" }'

Respons

StatusDeskripsi
200Customer stage updated and manual pin active
400Invalid target stage or empty
404Customer not found
PUT/pipeline/contacts/{id}/unpinBearerAuth

Clear active manual pin on customer pipeline stage

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/pipeline/contacts/{id}/unpin" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Pin cleared
Metode Path Tujuan Autentikasi
GET /pipeline Retrieve pipeline Kanban board with stages and contacts Bearer
POST /pipeline/stages Create new pipeline stage Bearer
PUT /pipeline/stages/{id} Update pipeline stage Bearer
DELETE /pipeline/stages/{id} Delete pipeline stage and migrate contacts to default stage Bearer
PUT /pipeline/contacts/{id}/stage Move customer pipeline stage (Kanban drag) with manual cooldown pin Bearer
PUT /pipeline/contacts/{id}/unpin Clear active manual pin on customer pipeline stage Bearer

Products

GET/productsBearerAuth

List catalog products

curl
curl -X GET "https://dagangbot.co.id/api/v1/products" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Products list
POST/productsBearerAuth

Create catalog product

curl
curl -X POST "https://dagangbot.co.id/api/v1/products" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
201Product created
GET/products/{id}BearerAuth

Get product by ID

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X GET "https://dagangbot.co.id/api/v1/products/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Product detail
PUT/products/{id}BearerAuth

Update product

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X PUT "https://dagangbot.co.id/api/v1/products/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Product updated
DELETE/products/{id}BearerAuth

Delete product

Parameter

NamaLokasiWajibTipeDeskripsi
idpathYastring-
curl
curl -X DELETE "https://dagangbot.co.id/api/v1/products/{id}" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
204Product deleted
Metode Path Tujuan Autentikasi
GET /products List catalog products Bearer
POST /products Create catalog product Bearer
GET /products/{id} Get product by ID Bearer
PUT /products/{id} Update product Bearer
DELETE /products/{id} Delete product Bearer

RBAC & Permissions

GET/rbac/permissionsBearerAuth

List role permissions

curl
curl -X GET "https://dagangbot.co.id/api/v1/rbac/permissions" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Permissions list
PUT/rbac/permissionsBearerAuth

Batch update role permissions (Owner only)

curl
curl -X PUT "https://dagangbot.co.id/api/v1/rbac/permissions" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Permissions updated
GET/rbac/permissions/meBearerAuth

Get caller permissions

curl
curl -X GET "https://dagangbot.co.id/api/v1/rbac/permissions/me" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200User permissions
Metode Path Tujuan Autentikasi
GET /rbac/permissions List role permissions Bearer
PUT /rbac/permissions Batch update role permissions (Owner only) Bearer
GET /rbac/permissions/me Get caller permissions Bearer

System Configs

GET/system/configsBearerAuth

Get system configs by category

curl
curl -X GET "https://dagangbot.co.id/api/v1/system/configs" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Config items
PUT/system/configsBearerAuth

Batch update dynamic system configs

curl
curl -X PUT "https://dagangbot.co.id/api/v1/system/configs" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Configs updated and cache invalidated
Metode Path Tujuan Autentikasi
GET /system/configs Get system configs by category Bearer
PUT /system/configs Batch update dynamic system configs Bearer

WebSocket

GET/ws/ticketBearerAuth

Obtain short-lived single-use ticket for WebSocket handshake

curl
curl -X GET "https://dagangbot.co.id/api/v1/ws/ticket" \
  -H "Authorization: Bearer $DAGANGBOT_TOKEN"

Respons

StatusDeskripsi
200Short-lived WebSocket ticket issued
401Unauthorized JWT token missing or invalid
Metode Path Tujuan Autentikasi
GET /ws/ticket Obtain short-lived single-use ticket for WebSocket handshake Bearer

Webhooks

POST/webhook/payment/midtransPublik

Midtrans payment notification webhook

curl
curl -X POST "https://dagangbot.co.id/api/v1/webhook/payment/midtrans"

Respons

StatusDeskripsi
200Webhook processed
POST/webhook/wa/incomingPublik

Evolution WhatsApp incoming message webhook

curl
curl -X POST "https://dagangbot.co.id/api/v1/webhook/wa/incoming"

Respons

StatusDeskripsi
200Inbound message processed
Metode Path Tujuan Autentikasi
POST /webhook/payment/midtrans Midtrans payment notification webhook None
POST /webhook/wa/incoming Evolution WhatsApp incoming message webhook None

5. Relasi & Integrasi

Semua API yang dideskripsikan di atas terintegrasi secara mendalam dengan subsistem All-in-One API yang mana menyatukan seluruh interaksi mutasi dengan satu prefix akses kontrol kredensial (dgb_all_). Anda dapat menguji sebagian besar lalu-lintas tanpa menulis program dengan memanfaatkan API Playground.

6. Pemecahan Masalah (Troubleshooting)

Gejala Penyebab Solusi
Mendapat status 401 Unauthorized pada /all-in-one/* Anda memakai Bearer Token biasa, padahal dibutuhkan token berawalan dgb_all_ (skema API Key). Ganti token Authorization: Bearer menjadi X-API-Key.
Muncul 429 Too Many Requests saat broadcast Melanggar ambang batas panggilan simultan di titik throttle per detik atau menit. Hentikan pemanggilan sejenak; terapkan algoritme exponential backoff pada klien.
Pembuatan billing top-up mengembalikan kegagalan idempoten Header Idempotency-Key tidak terdeteksi atau kunci yang sama dipakai berulang untuk parameter masukan yang berbeda. Pastikan Idempotency-Key disematkan dan digeneralisasi sebagai UUIDv4.
Pengunggahan knowledge base ditolak tanpa status jelas Kegagalan inspeksi ekstensi berbasis MIME type sniffing 512-byte mendeteksi pemalsuan format. Pastikan berkas dokumen PDF atau CSV tidak mengalami korupsi biner dan magic bytes valid.

7. Matriks Kode Error & Penanganan

Status HTTP Kategori Error (Error Code) Panduan Penanganan Eksternal
400 VALIDATION_ERROR Cek bidang details yang merujuk pada nama field JSON Anda yang tipe datanya keliru (mis. memasukkan huruf ke angka).
401 UNAUTHORIZED Hapus kredensial dari ingatan state klien (contoh Redux atau Local Storage), lalu arahkan (redirect) ulang pengguna ke halaman log masuk.
403 FORBIDDEN Cegah eksekusi ulang otomatis. Pastikan akun tidak diturunkan jabatannya ke pangkat dengan hak baca (Read-only).
404 NOT_FOUND Periksa ulang path ID di segmen rute perantara /{id}/. Hapus rekam jejak objek lokal klien bila sudah tergusur di pangkalan data peladen.
409 CONFLICT Operasi mutasi Anda tidak sesuai dengan state peladen (misal: ID Idempotency sudah terpakai). Ganti ID dan ulangi mutasi.
422 UNPROCESSABLE_ENTITY Input masuk secara struktural (sintaks benar) namun semantiknya tertolak oleh bisnis sistem (seperti email sudah terdaftar).
429 RATE_LIMIT_EXCEEDED / TOO_MANY_REQUESTS Kuota API atau AI tercapai. Baca header HTTP Retry-After untuk melakukan perlambatan permintaan (exponential backoff).
500 INTERNAL_ERROR Kendala pemrosesan sistem, peladen mencatat detail insiden sembari mengembalikan request_id untuk pelacakan. Coba kembali beberapa saat lagi.

8. Referensi Terkait

content/docs/integrations/api-reference.mdx
Terakhir diperbarui: 9 Okt 2026, 09.28

Dokumentasi teknis DagangBot