Webhooks
Webhooks let systems outside PrimeCal trigger your automation rules automatically. When an external service — a booking platform, a CRM, a web store — posts a JSON message to your rule's webhook URL, PrimeCal receives it and runs the rule.
How Webhooks Work
Every automation rule that uses the webhook.incoming trigger gets its own unique URL. When a third-party system sends an HTTP POST request to that URL with a JSON body, your rule fires.
The flow is:
- External system sends a POST request to your webhook URL
- PrimeCal receives the payload and logs it
- The rule's conditions are evaluated against the payload data
- If conditions match (or there are no conditions), the action runs
Finding Your Webhook URL
- Go to Dashboard → Automation
- Open the rule you want to connect (or create a new one with
webhook.incomingas the trigger) - In the rule detail view, open the Webhook tab
- Copy the URL — it looks like:
https://app.primecal.eu/api/automation/webhooks/abc123xyz/receive
Each rule has a different token in the URL. This token is your security key.
Anyone who has the URL can trigger your rule. Treat it like a password. If the URL is ever exposed, regenerate the token from the rule's Webhook tab.
Sending a Webhook Request
Your external system needs to send a POST request to the webhook URL with Content-Type: application/json.
Example payload:
{
"event": "order.completed",
"data": {
"order_id": "12345",
"customer": "John Doe",
"total": 99.99,
"status": "paid"
}
}
PrimeCal accepts any valid JSON structure. The top-level shape is flexible — you can use data, payload, body, or any nesting you prefer. What matters is that you reference the same paths in your conditions using dot notation (e.g., webhook.data.order_id).
Testing with curl
You can test your webhook from a terminal before wiring up your external system:
curl -X POST https://app.primecal.eu/api/automation/webhooks/YOUR_TOKEN/receive \
-H "Content-Type: application/json" \
-d '{"event":"test","data":{"priority":"high","customer_id":"123"}}'
Replace YOUR_TOKEN with the token from your rule's Webhook tab. After sending, check the rule's History tab in PrimeCal to confirm the request was received and logged.
You can also use Postman or any HTTP client that lets you set headers and send a JSON body.
Using Payload Data in Conditions
Once a webhook arrives, you can inspect its contents inside conditions using webhook.data with dot notation:
webhook.data.order_id→ theorder_idfield underdatawebhook.data.customer→ thecustomerfield underdatawebhook.data.status→ thestatusfield underdata
Example rule: Only act when status equals "paid":
- Condition field:
webhook.data.status - Operator:
equals - Value:
paid
See Smart Values for a full explanation of dot notation and nested access.
Practical Example: Booking Confirmation
A reservation platform sends a webhook to PrimeCal when someone books a pool session. The payload looks like:
{
"event": "booking.confirmed",
"data": {
"booking_id": "bk_001",
"guest_name": "Sarah Connor",
"slot": "2026-07-15T10:00:00",
"type": "pool"
}
}
You want to color-code all incoming pool bookings in cyan so they stand out on the calendar.
Rule setup:
- Trigger:
webhook.incoming - Condition:
webhook.data.typeequalspool - Action: Set event color → Cyan
When the reservation system fires the webhook, PrimeCal receives it, checks that type is pool, and applies the cyan color to the associated event.
Regenerating a Webhook Token
If you suspect your webhook URL has been exposed or you want to rotate it as a precaution:
- Open the rule in the rule detail view
- Go to the Webhook tab
- Click Regenerate Token
- Update your external system with the new URL
The old URL stops working immediately after regeneration.
Checking Webhook Logs
Every webhook request — whether it triggered the action or was filtered out by conditions — is logged in the rule's audit trail.
- Open the rule detail view
- Go to the History tab
- Each entry shows the timestamp, the incoming payload, which conditions were evaluated, and the outcome
This is the first place to check if a webhook doesn't seem to be working.
Troubleshooting
If your webhook isn't triggering the rule as expected, see Troubleshooting Automations for a full checklist. The most common issues are:
- Wrong
Content-Typeheader (must beapplication/json) - Token in the URL doesn't match the current rule token
- A condition is filtering out the request (check the History tab for the reason)
Last updated: 2026-06-30 | PrimeCal v1.3.4