Webhook
Purpose
The Webhook target sends variables, devices, alarms, and plugin events to an HTTP endpoint. It supports raw JSON, text notification formats, Markdown notification formats, custom headers, and request signing.
Configure the forwarding group and target through Data Forwarding. This page covers Webhook-specific request settings, templates, and debug actions.
Open the plugin
Open Development Configuration → Data Forwarding and:
- Configure and save the forwarding group range, trigger, interval, online filter, and batching.
- Add a target, choose Webhook, and fill in the basic target information.
- Open Target properties and configure endpoint templates, message format, authentication, scripts, templates, and cache.
- Save and enable the group and target, then use Target debug for a read-only probe or a confirmed test request.
Basic target information
| Setting | Default | Configuration |
|---|---|---|
| Group | - | Select a saved forwarding group. |
| Target name | - | Required and unique within the group. |
| Enable | Enabled | Disable to stop requests. |
| Log level | Info | Temporarily use Debug for HTTP, signing, or template diagnostics. |
| Start timeout | 60 seconds | Valid range is 1 to 3600 seconds. |
Target properties
Message and endpoints
| Setting | Default | Configuration |
|---|---|---|
| Message format | Raw | Raw sends generated JSON; Text wraps it as a DingTalk/WeCom/Feishu text message; Markdown wraps DingTalk/WeCom Markdown. Feishu requires its card format. |
| Device Topic template | Empty | HTTP/HTTPS URL for device records. Empty disables device posts. |
| Variable Topic template | http://127.0.0.1:7502/ThingsGateway/Variable | URL for variable records. ${DeviceName} and ${Name} can be used. |
| Alarm Topic template | Empty | URL for alarm records; empty disables alarm posts. |
| Plugin-event Topic template | Empty | URL for plugin-event records; empty disables plugin-event posts. |
| Request timeout (seconds) | 10 | Positive maximum wait for one POST request. |
In this plugin, “Topic template” means the final HTTP request URL, not an MQTT Topic. ${field} must exist on the entity or entity-script output.
Security
| Setting | Default | Configuration |
|---|---|---|
| Signing secret | Empty | DingTalk robot signing Secret only. The target appends timestamp and sign query parameters automatically. |
| Custom headers | Empty | A JSON object of string pairs, for example {"Authorization":"Bearer <token>","X-Environment":"test"}. Invalid JSON causes the request to fail. |
The signing secret and headers are sensitive. Signing does not replace a receiver's Token or other required authentication header.
Target-variable properties
Webhook inherits the optional text fields Data1 to Data10, all empty by default. They are not added to HTTP bodies automatically. Configure membership, aliases, trigger, and batching in Data Forwarding.
| Setting | Default | Configuration |
|---|---|---|
| Data1 to Data10 | Empty | Project-specific metadata. Reference values explicitly from an entity script or upload template; never store passwords or tokens here. |
Data and scripts
| Setting | Default | Configuration |
|---|---|---|
| Detail log | Disabled | Enable briefly to inspect request payloads or counts. |
| JSON indentation | Enabled | Disable to reduce request-body size. |
| Ignore JSON nulls | Enabled | Disable when null fields must remain. |
| Device list upload | Enabled | POST devices as a list; disable for one request per device. |
| Variable list upload | Enabled | POST variables as a list; disable for one request per variable. |
| Variable dictionary upload | Disabled | Applies only to variable-list mode; groups by DeviceName → Name → Value. |
| Alarm list upload | Enabled | POST alarms as a list; disable for one request per alarm. |
| Alarm dictionary upload | Disabled | Applies only to alarm-list mode; groups by device and variable. |
| Plugin-event list upload | Enabled | POST plugin events as a list; disable for one request per event. |
| Entity scripts | Empty | Select saved device, variable, alarm, or plugin-event scripts before URL and body rendering. |
Upload template fields
For each entity in Upload Template Configuration, choose Text or Json and insert ${field} placeholders. Empty content uses default JSON serialization; preview before saving.
| Entity | Available fields |
|---|---|
| Variable | Id, Name, DeviceName, Value, RawValue, LastSetValue, CollectGroup, CollectTime, CreateTime, ChangeTime, IsOnline, DataType, Unit, RegisterAddress, OtherMethod, Description, ProtectType, RpcWriteEnable, Remark1 to Remark5, ValueInited, IsMemory |
| Device | Id, Name, ActiveTime, DeviceStatus, PluginName, Description, LastErrorMessage, Remark1 to Remark5 |
| Alarm | AlarmId, VariableId, Name, DeviceName, AlarmCode, AlarmLevel, AlarmLimit, AlarmText, RecoveryCode, AlarmTime, EventTime, FinishTime, ConfirmTime, ConfirmText, AlarmType, EventType, Remark1 to Remark5 |
| Plugin event | DeviceName, ObjectValue |
An entity script changes the upload object before endpoint grouping and template rendering. Keep placeholders aligned with the script output. An empty URL template disables that entity type.
Cache and capacity
| Setting | Default | Configuration |
|---|---|---|
| Enable failed-write retry cache | Disabled | Enable in production to retain failed requests in CacheDB and replay them after recovery. |
| Cache file maximum rows | 262144 | Maximum CacheDB outbox rows; oldest rows are removed after the limit. |
| Upload chunk size | 2000 | Maximum records per write or replay batch. |
| Memory queue limit | 100000 | Maximum in-memory records before CacheDB handoff; sustained overload can still discard old data. |
| Filter offline data | Disabled | Filters offline variables at dequeue; the forwarding-group filter also applies. |
| Upload concurrency | 1 | HTTP clients are reused; keep 1 until receiver rate limits are tested. |
Target debug
Open Development Configuration → Data Forwarding, select the forwarding group and target, and open Debug.
HTTP Webhook protocol panel

Use Probe for DNS and HTTP HEAD only; it never sends a business payload. Use Send test request to send a bounded payload to the current variable URL after confirmation. The test body is limited to 64 KiB.
Do not call production write or delete endpoints during routine debugging. Use a test URL with a small payload.
Verify the target
- Configure a test endpoint and request header.
- Select
Raw,Text, orMarkdownaccording to the receiver's contract. - Send one test variable or event.
- Confirm URL, HTTP method, status code, headers, body, and receiver logs.
- Check the target log for timeout, authentication, or retry errors.
Troubleshooting
| Symptom | Check |
|---|---|
| HTTP request fails | Endpoint URL, HTTP method, TLS certificate, firewall, receiver status code, and target log. |
| Receiver rejects authentication | Custom header JSON, signing secret, token format, and token expiration. |
| Receiver accepts request but data is wrong | Message format, template preview, entity fields, and entity-script output. |
| Notification format is invalid | Receiver format requirements: raw JSON, text, Markdown, or platform-specific card format. |
| Requests time out | Endpoint reachability, receiver load, request timeout, and target retry/cache state. |
| Test request fails | Run Probe first, then check the URL, headers JSON, signing secret, message format, and target log. |
| Signature is rejected | Use the signing secret only for DingTalk signing. The target appends timestamp and sign; do not append them manually. |
Related links
- Data Forwarding: Forwarding groups, triggers, cache, redundancy, and common target operations.
- Plugin Manual Index: Other collection and data-forwarding plugins.