API Keys

Key dimiliki Organization, bukan user perorangan — semua resource yang diakses key otomatis ter-scope ke organization tersebut.

Membuat key

Dashboard → API Keys → pilih environment (TEST/LIVE) → Buat Key. Secret lengkap ditampilkan satu kali; setelah itu hanya prefix (18 karakter pertama) yang terlihat.

Format & penyimpanan

  • Full key: ap_test_<random> / ap_live_<random>.
  • Server menyimpan prefix + hash scrypt — plaintext tidak pernah tersimpan.
  • Verifikasi incoming key: parse prefix → lookup → verifikasi hash.

Scopes

Key yang dibuat dari dashboard mendapat semua scope: couriers:read, rates:read, quotes:read, quotes:write, shipments:read, shipments:write, tracking:read, pickup:read, pickup:write, wallet:read, transactions:read, webhooks:read, webhooks:write. Endpoint akan mengembalikan 403 FORBIDDEN bila scope tidak dimiliki.

Revoke

Tombol Cabut di dashboard langsung menonaktifkan key (status REVOKED). Request berikutnya dengan key tersebut → 401 UNAUTHORIZED.

Rate limit & usage

600 request/menit per key. Setiap request tercatat di ApiRequestLog (endpoint, status, latensi, waktu) untuk inspeksi usage.

API Keys — AntarPaket API