Arsitektur Dokumentasi
Peta jalan panduan, SDK integration, dan API reference lengkap yang disiapkan secara terstruktur.
Webhooks
Mengkonfigurasi webhook yang akan dipanggil saat event tertentu terjadi di workspace (post published, post updated, dll). Berguna untuk integrasi dengan deployment pipeline, notifikasi, atau search indexing.
Create Webhook
Mendaftarkan URL webhook baru.
Endpoint
POST /api/webhooks
Authentication
Bearer Token (JWT) + X-Workspace-ID header · Role: editor+
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | ya | URL endpoint yang akan dipanggil. |
events | array | ya | Event yang memicu webhook. |
secret | string | tidak | Secret untuk validasi signature (rekomendasi: selalu isi). |
Event yang tersedia:
| Event | Dipicu saat |
|---|---|
post.created | Post baru dibuat. |
post.updated | Post diperbarui. |
post.published | Post status berubah ke published. |
post.deleted | Post dihapus. |
comment.created | Komentar baru (perlu moderasi). |
comment.approved | Komentar disetujui. |
{
"url": "https://my-frontend.com/api/revalidate",
"events": ["post.published", "post.updated", "post.deleted"],
"secret": "whsec_mysecret123"
}Response
{
"status": 201,
"message": "Webhook created",
"data": {
"id": "wh_abc123...",
"url": "https://my-frontend.com/api/revalidate",
"events": ["post.published", "post.updated", "post.deleted"],
"created_at": "2026-01-17T10:00:00Z"
}
}List Webhooks
Mendapatkan daftar semua webhook yang terdaftar.
Endpoint
GET /api/webhooks
Authentication · Role: editor+
Delete Webhook
Menghapus webhook.
Endpoint
DELETE /api/webhooks/:id
Authentication · Role: editor+
Webhook Delivery Logs
Melihat log pengiriman webhook (sukses/gagal).
Endpoint
GET /api/webhooks/:id/logs
Authentication · Role: editor+
Response
{
"status": 200,
"data": [
{
"id": "dl_abc123...",
"event": "post.published",
"url": "https://my-frontend.com/api/revalidate",
"status": "success",
"status_code": 200,
"response_body": "{\"revalidated\":true}",
"delivered_at": "2026-01-17T10:05:00Z"
},
{
"id": "dl_def456...",
"event": "post.updated",
"url": "https://my-frontend.com/api/revalidate",
"status": "failed",
"status_code": 500,
"error": "Internal Server Error",
"delivered_at": "2026-01-17T10:10:00Z"
}
]
}Verifikasi Signature
Tulis CMS mengirim header X-Tulis-Signature di setiap request webhook. Gunakan secret untuk memverifikasi:
// Contoh verifikasi di Node.js
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}Panduan Lengkap
Lihat Webhooks Guide untuk contoh integrasi lengkap dengan Next.js ISR dan deployment trigger.
Lini Masa Peluncuran Fitur
Docker Compose, pengaturan file environment, dan panduan setup lokal telah lengkap dibuat.
Dokumentasi route endpoint publik, otentikasi JWT, dan kontrol hak akses telah selesai disusun.
Mempersiapkan boilerplate untuk Next.js client, manajemen revisi konten, dan optimasi query.