Webhooks
Receive real-time sensor data from your devices.
Sensor Data Webhook
Devices report sensor readings to this endpoint. You can use this to build custom integrations or data pipelines.
Incoming Webhook (Device -> Cloud)
Devices automatically send sensor data to Palpable. This data triggers automations and updates the dashboard.
POST /api/webhooks/sensor-dataRequest Body
{
"deviceId": "550e8400-e29b-41d4-a716-446655440000",
"moduleId": "SHT40",
"data": {
"temperature": 23.5,
"humidity": 45.2
}
}Response
{
"success": true
}Outgoing Webhooks (Cloud -> Your Server)
Configure automation actions to call your own webhooks when events occur.
Webhook Action
In an automation, add a webhook action:
{
"type": "webhook",
"url": "https://your-server.com/palpable-webhook",
"method": "POST",
"headers": {
"X-Custom-Header": "value"
},
"body": {
"event": "sensor_threshold",
"deviceId": "{{device.id}}",
"deviceName": "{{device.name}}",
"sensor": "temperature",
"value": "{{sensor.temperature}}",
"timestamp": "{{timestamp}}"
}
}Template Variables
Use these variables in your webhook body:
| Variable | Description |
|---|---|
{{device.id}} | Device UUID |
{{device.name}} | Device display name |
{{device.status}} | Device status |
{{sensor.temperature}} | Temperature reading |
{{sensor.humidity}} | Humidity reading |
{{sensor.lux}} | Light level |
{{sensor.*}} | Any sensor value |
{{timestamp}} | ISO 8601 timestamp |
{{automation.id}} | Automation UUID |
{{automation.name}} | Automation name |
Webhook Security
Verify webhook authenticity using the signature header:
X-Palpable-Signature: sha256=abc123...Compute the expected signature:
const crypto = require('crypto');
const expectedSignature = crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(JSON.stringify(body))
.digest('hex');
if (`sha256=${expectedSignature}` !== request.headers['x-palpable-signature']) {
throw new Error('Invalid signature');
}Webhook Retry Policy
Failed webhook deliveries are retried with exponential backoff:
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 1 minute |
| 3 | 5 minutes |
| 4 | 30 minutes |
| 5 | 2 hours |
After 5 failed attempts, the webhook is marked as failed and no further retries are attempted.
Webhook Logs
View webhook delivery history in the Palpable dashboard under Automations > [Automation Name] > Logs.
Each log entry shows:
- Timestamp
- HTTP status code
- Response time
- Request/response body (truncated)
- Error message (if failed)