Webhooks
Webhooks send JSON notifications to your server when subscribed Komashi events occur. Open Control Center → Integration → Webhooks for the current provider.
Use the selectable event list below as the supported configuration. Do not assume the existence of a generic payment or invoice event just because a record is visible in the REST API.
Create an endpoint subscription
Section titled “Create an endpoint subscription”- Prepare a publicly reachable endpoint that accepts JSON
POSTrequests. - Click New webhook.
- Enter its Endpoint URL, for example
https://your-app.example/integrations/komashi. - Select at least one event. Select All and Unselect All change the selection for the form.
- Click Save.
A new endpoint must be a public HTTPS URL that the Komashi server can reach. Private, local and other internal addresses are rejected, including localhost, which would point to the sending machine rather than your own development machine. A provider cannot create a duplicate subscription for the same endpoint URL.
If a saved endpoint later resolves to a blocked address, Komashi stops delivering to it permanently instead of retrying.
The list shows the endpoint, selected events, creation time and actions. Use the pencil action to change event selections, then save. The edit dialog shows the existing destination; to move to a different destination, create the replacement webhook and retire the old one after checking delivery.
Deleting a webhook stops future deliveries for that configuration. It does not reverse changes already made by your receiver.
Available events
Section titled “Available events”| Category | Event names |
|---|---|
| Customers | customers.create, customers.update, customers.delete |
| Contacts | contact.create, contact.update, contact.delete |
| Services | services.create, services.update, services.delete |
| Service plans | service.plan.create, service.plan.update, service.plan.delete |
| Service periods | service.period.create, service.period.update, service.period.delete |
| Service prices | service.price.create, service.price.update, service.price.delete |
| Service add-ons | service.addon.create, service.addon.update, service.addon.delete |
| Add-on options | service.addon.option.create, service.addon.option.update, service.addon.option.delete |
| Subscription plans | subscription.plans.create, subscription.plans.update, subscription.plans.delete, subscription.plan.preview.link |
| Subscriptions | subscription.create, subscription.update, subscription.delete |
Event names are exact strings, including their singular/plural differences. Only the events selected for an endpoint are delivered to it.
Send a test webhook
Section titled “Send a test webhook”The Test webhook action is available after at least one webhook has been saved for a non-demo provider.
- Click Test webhook.
- Enter a Test URL that you control. It must be a public HTTPS address, like a new endpoint.
- Choose the Example event to send.
- Click Send test webhook.
- Inspect the received request on your server and the success or failure notification in Komashi.
The test uses fictional example data and does not create or update Komashi records. It performs one test request; it is separate from the queued retry mechanism for real events. A maximum of 10 test deliveries per minute is allowed.
The current test sender uses the first saved webhook’s signing secret. With multiple webhook configurations, do not assume the test signature uses the secret belonging to the URL entered in the test dialog.
Demo providers do not dispatch outgoing webhooks and do not offer the normal webhook mutation and test actions. A demo screen can show seeded configuration without delivering requests.
Request format
Section titled “Request format”A delivery contains these headers:
Content-Type: application/jsonX-Webhook-Event: customers.updateX-Signature: <hex-encoded HMAC-SHA256>The JSON envelope has three fields:
{ "event": "customers.update", "timestamp": "2026-10-22T10:00:00+00:00", "data": {}}data contains the event-specific resource payload. Its fields vary by event; the example above intentionally omits resource fields. Test payloads are examples and should not be treated as a complete schema for every real event. Reconcile the current resource through the API when your workflow needs authoritative state.
Verify the signature
Section titled “Verify the signature”Komashi signs the JSON body with HMAC-SHA256 using the webhook’s own secret. Verify against the original request bytes, before parsing or reserializing JSON. The signature is lowercase hexadecimal without a sha256= prefix.
The current Webhooks page does not expose a copy/reveal control for the generated secret. The verification example below requires that matching secret to have been supplied securely to your receiver; an API key cannot replace it.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyKomashiWebhook(rawBody, signature, secret) { if (!secret || !/^[a-f0-9]{64}$/.test(signature ?? '')) return false; const expected = createHmac('sha256', secret).update(rawBody).digest(); const received = Buffer.from(signature, 'hex'); return received.length === expected.length && timingSafeEqual(received, expected);}Pass your HTTP framework’s raw request-body buffer to this function. Reject a failed signature before processing the event.
Delivery and retries
Section titled “Delivery and retries”Real event notifications are queued after the database transaction commits. Delivery can therefore follow the business action with a delay.
- A delivery has up to four attempts, with retry delays of 10, 60 and 300 seconds.
- The sender uses a 3-second connection timeout and 10-second request timeout.
- Return a successful
2xxresponse promptly after accepting the event. Process slower work asynchronously in your receiver. - A connection error, timeout or unsuccessful HTTP response can cause a retry. Retries can produce duplicates, including when your receiver processed a request but its response was lost.
The payload does not provide a universal delivery ID or an ordering guarantee. Make processing idempotent using identifiers and state appropriate to your event. The timestamp and signature can change between attempts, so they are not reliable deduplication keys on their own.
Troubleshooting
Section titled “Troubleshooting”| Problem | What to check |
|---|---|
| No notification | Correct provider, saved endpoint, exact selected event, and whether the provider is a demo. |
| Test button is absent | Save a webhook first and use a non-demo provider. |
| URL is rejected | Use a publicly reachable destination accepted by the safe-URL validation. |
| Invalid signature | Matching webhook secret, raw bytes, hexadecimal signature and the test sender’s secret-selection behavior. |
| Repeated delivery | Return promptly and ensure idempotent processing. |
| Current state differs from event | Read the resource through the REST API; notifications can arrive later than the original change. |
Related: REST API integration, API keys.


