Tokolaku Webhooks API
Registrasi endpoint webhook penerima event — sesi login.
Registrasi endpoint webhook penerima event — sesi login.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/tokolaku-id:tokolaku-id-webhooks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Tokolaku Engine Webhooks API
version: 1.0.0
description: 'REST API untuk integrasi bot AI, pengiriman pesan (WhatsApp/Instagram/Messenger via BYON), webhook real-time, dan manajemen sub-akun/reseller di Tokolaku.
**Autentikasi**
- Endpoint publik `/api/v1/*` (Messaging): header `Authorization: Bearer ` (format `tk_live_sk_...` / `tk_test_sk_...`). Setiap key punya scope (`chat:write`, `messages:write`, dst).
- Endpoint dashboard `/api/dev/*`: sesi login (cookie) developer — dipanggil dari aplikasi/dashboard kamu sendiri, bukan server-to-server publik.
**Webhook (kami → aplikasi kamu)**
Event `message.received` dan `message.status` dikirim sebagai `POST` ke URL webhook yang kamu daftarkan, dengan header:
- `X-Tokolaku-Event`: nama event (mis. `message.received`)
- `X-Tokolaku-Signature`: `sha256=`
- `X-Tokolaku-Delivery`: id pengiriman (dipakai juga untuk dedup saat retry)
Body mengikuti skema `WebhookEvent`. Balas `2xx` untuk menandai sukses; kegagalan di-retry dengan backoff eksponensial (60s → 1920s, hingga 6x).'
contact:
name: Tokolaku
url: https://tokolaku.id
servers:
- url: https://api.tokolaku.id
description: Production
security:
- bearerAuth: []
tags:
- name: Webhooks
description: Registrasi endpoint webhook penerima event — sesi login.
paths:
/api/dev/webhooks:
get:
tags:
- Webhooks
summary: Daftar webhook terdaftar (tanpa secret)
security:
- sessionAuth: []
responses:
'200':
description: Daftar webhook
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Webhook'
example:
data:
- id: wh_...
url: https://app-anda.com/webhooks/tokolaku
tenant_id: null
events:
- message.received
is_active: true
created_at: '2026-09-04T10:00:00.000Z'
operationId: getApiDevWebhooks
x-operation-id-source: derived
post:
tags:
- Webhooks
summary: Daftarkan endpoint webhook baru
description: Secret ditampilkan HANYA sekali di response ini — simpan segera.
security:
- sessionAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookCreateRequest'
example:
url: https://app-anda.com/webhooks/tokolaku
tenant_id: null
events:
- message.received
responses:
'200':
description: Webhook berhasil dibuat
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookWithSecret'
example:
id: wh_...
url: https://app-anda.com/webhooks/tokolaku
tenant_id: null
events:
- message.received
is_active: true
created_at: '2026-09-04T10:00:00.000Z'
secret: whsec_xxx
'400':
description: URL tidak valid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
code: invalid_url
message: URL webhook harus https dan bukan alamat privat/localhost
operationId: postApiDevWebhooks
x-operation-id-source: derived
/api/dev/webhooks/events:
get:
tags:
- Webhooks
summary: Daftar nama event webhook yang tersedia
security:
- sessionAuth: []
responses:
'200':
description: Daftar event
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: string
example:
data:
- message.received
- message.status
operationId: getApiDevWebhooksEvents
x-operation-id-source: derived
/api/dev/webhooks/{id}:
patch:
tags:
- Webhooks
summary: Ubah status aktif / daftar event webhook
security:
- sessionAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookPatchRequest'
example:
is_active: false
responses:
'200':
description: Webhook berhasil diubah
content:
application/json:
schema:
type: object
properties:
data:
$ref: '#/components/schemas/Webhook'
'400':
description: Body kosong / tidak valid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
code: empty
message: Tidak ada perubahan
'404':
description: Webhook tidak ditemukan
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
code: not_found
message: Webhook tidak ditemukan
operationId: patchApiDevWebhooksById
x-operation-id-source: derived
delete:
tags:
- Webhooks
summary: Hapus webhook (cascade delivery history)
security:
- sessionAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Berhasil dihapus
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
example:
ok: true
'404':
description: Webhook tidak ditemukan
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
example:
error:
code: not_found
message: Webhook tidak ditemukan
operationId: deleteApiDevWebhooksById
x-operation-id-source: derived
components:
schemas:
WebhookCreateRequest:
type: object
properties:
url:
type: string
description: Harus https, bukan alamat privat/localhost
tenant_id:
type:
- string
- 'null'
description: null = semua sub-akun, atau id sub-akun tertentu
events:
type: array
items:
type: string
enum:
- message.received
- message.status
required:
- url
WebhookPatchRequest:
type: object
properties:
is_active:
type: boolean
events:
type: array
items:
type: string
ErrorEnvelope:
type: object
description: Envelope error konsisten untuk semua endpoint Engine API.
properties:
error:
type: object
properties:
code:
type: string
message:
type: string
required:
- code
- message
required:
- error
Webhook:
type: object
properties:
id:
type: string
url:
type: string
tenant_id:
type:
- string
- 'null'
events:
type: array
items:
type: string
is_active:
type: boolean
created_at:
type: string
format: date-time
required:
- id
- url
- tenant_id
- events
- is_active
- created_at
WebhookWithSecret:
allOf:
- $ref: '#/components/schemas/Webhook'
- type: object
properties:
secret:
type: string
description: whsec_... — HANYA muncul di response create/rotate
required:
- secret
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'Secret key developer, format `tk_live_sk_...` (produksi) atau `tk_test_sk_...` (sandbox). Kirim via header `Authorization: Bearer <key>` (atau `X-API-Key: <key>`).'
sessionAuth:
type: apiKey
in: cookie
name: session
description: Endpoint dashboard `/api/dev/*` diautentikasi via sesi login developer (cookie), bukan API key — dipanggil dari aplikasi/dashboard kamu sendiri saat sudah login.