---
title: "Daftarkan endpoint webhook baru"
method: POST
path: "/api/dev/webhooks"
tags: ["Webhooks"]
---

# Daftarkan endpoint webhook baru

`POST /api/dev/webhooks`

## Request

- Base URL: `https://api.tokolaku.id`
- URL: `https://api.tokolaku.id/api/dev/webhooks`
- Auth: API key in cookie `session`

Secret ditampilkan HANYA sekali di response ini — simpan segera.

## Request body

- WebhookCreateRequest
  - `url` string, required: Harus https, bukan alamat privat/localhost
  - `tenant_id` string, nullable: null = semua sub-akun, atau id sub-akun tertentu
  - `events` string[]

## Response `200`

Webhook berhasil dibuat

- WebhookWithSecret
  - `id` string, required
  - `url` string, required
  - `tenant_id` string, nullable, required
  - `events` string[], required
  - `is_active` boolean, required
  - `created_at` string, date-time, required
  - `secret` string, required: whsec_... — HANYA muncul di response create/rotate

## Other responses

- `400`: URL tidak valid

---

[API](https://skmtc.dev/tokolaku/apis/tokolaku-engine-api.md) · [All operations](https://skmtc.dev/tokolaku/apis/tokolaku-engine-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tokolaku/apis/tokolaku-engine-api/revisions/5d95caea34ef?raw)
