Repository navigation
Api Form Webhooks
A Form Builder block with a Webhook URL sends every submission to that URL as a JSON POST. This page is the contract for whoever writes the receiver.
Available since 2.10.0.
POST /your/endpoint HTTP/1.1
Content-Type: application/json
User-Agent: DesignSetGo/2.10.0; https://example.com/
X-DSGo-Event: form.submitted
X-DSGo-Delivery: 6f1c1d3e-8a59-4d4b-9a7e-2f0c5b1e9d42
X-DSGo-Timestamp: 1791281700
X-DSGo-Signature: sha256=5d2c…| Header | Meaning |
|---|---|
X-DSGo-Event |
Always form.submitted for now. |
X-DSGo-Delivery |
UUID of this delivery. The same on every automatic retry, so you can use it to drop duplicates. A manual Resend from the admin gets a new one, because a resend is an explicit request to deliver again. |
X-DSGo-Timestamp |
Unix time of this attempt. It changes on every retry. |
X-DSGo-Signature |
Only present when the site has a signing secret (DesignSetGo → Settings → Integrations). |
{
"version": 1,
"event": "form.submitted",
"form_id": "contact-a1b2",
"submission_id": 4821,
"submitted_at": "2026-10-06T14:15:00+00:00",
"source_url": "https://example.com/contact/",
"fields": { "your_name": "Pat Lee", "topics": ["billing", "support"] },
"labels": { "your_name": "Your name", "topics": "topics" }
}-
version— payload format. It only changes for a breaking change, and existing keys are never removed within a version. -
submission_id— stable for the submission. Use it, notX-DSGo-Delivery, if a manual Resend should update the same record instead of creating a new one. -
submitted_at— ISO 8601, UTC. -
fields— field name → value. A value is a string, or an array of strings for multi-value fields such as checkboxes. An empty form sends{}. -
labels— field name → the label the visitor saw. Fields without a label (hidden fields, and submissions stored before 2.10.0) fall back to the field name.
Sites can change the payload with the designsetgo_form_webhook_payload filter, so treat unknown keys as optional.
The signature is sha256= followed by the hex HMAC-SHA256 of:
{X-DSGo-Timestamp}.{raw request body}
…keyed with the signing secret. Verify against the raw body bytes, before any JSON parsing, and compare in constant time. Reject requests whose timestamp is more than about five minutes from your clock, so a captured request can't be replayed.
// Node.js
const crypto = require( 'crypto' );
function verify( rawBody, headers, secret ) {
const timestamp = headers[ 'x-dsgo-timestamp' ];
const signature = headers[ 'x-dsgo-signature' ] || '';
if ( Math.abs( Date.now() / 1000 - Number( timestamp ) ) > 300 ) {
return false;
}
const expected = 'sha256=' + crypto.createHmac( 'sha256', secret ).update( `${ timestamp }.${ rawBody }` ).digest( 'hex' );
return signature.length === expected.length && crypto.timingSafeEqual( Buffer.from( signature ), Buffer.from( expected ) );
}// PHP
function verify_dsgo_webhook( string $raw_body, string $timestamp, string $signature, string $secret ): bool {
if ( abs( time() - (int) $timestamp ) > 300 ) {
return false;
}
$expected = 'sha256=' . hash_hmac( 'sha256', $timestamp . '.' . $raw_body, $secret );
return hash_equals( $expected, $signature );
}Without a secret, requests are unsigned and anyone who knows the URL can post to it. Set a secret for anything that acts on the data.
| Your response | What happens |
|---|---|
2xx |
Delivered. |
No response (timeout, DNS, TLS), 408, 425, 429, 5xx
|
Retried after 1 min, 5 min, 30 min and 2 h — five attempts in all — then marked Failed. |
3xx or any other 4xx
|
Marked Failed at once. These repeat until the URL or receiver is fixed. Redirects are never followed. |
The first attempt happens just after the visitor's response is sent (on PHP-FPM and LiteSpeed), or a moment later via WP-Cron on other servers. Each attempt waits up to 5 seconds for you to answer, so respond fast and process asynchronously.
Admins can see each submission's status under DesignSetGo → Form Submissions and resend it from the row actions or the submission screen.
- The URL must be
httporhttps, on port 80, 443 or 8080, and resolve to a public IP. Loopback, private and link-local addresses are refused (WordPress'swp_http_validate_url()). - To send to one of those addresses anyway, allow its host with WordPress's
http_request_host_is_externalfilter. WordPress versions before 6.7.6, 6.8.7, 6.9.6, 7.0.3 and 7.1 let link-local (169.254.0.0/16) and CGNAT (100.64.0.0/10) hosts through their own check. On those, DesignSetGo refuses them instead, so allow them withdesignsetgo_form_webhook_allow_reserved_host. - The URL comes from the saved block, never from the visitor's request, and is copied onto the submission, so later edits to the form don't redirect pending retries.
- Anyone who can edit the page can read the URL in the block markup. Don't put a password in it; use the signing secret.
| Hook | Type | Purpose |
|---|---|---|
designsetgo_form_webhook_payload |
filter |
( array $payload, int $submission_id, string $form_id ). Change the payload. A non-array return is ignored. |
designsetgo_form_webhook_url |
filter |
( string $url, string $form_id, int $submission_id ). Return '' to block a destination. The result is validated again. |
designsetgo_form_webhook_allow_reserved_host |
filter |
( bool $allow, string $host, string $url ). Return true to send to a link-local or CGNAT host. Only consulted on WordPress versions whose own check lets those hosts through (before 6.7.6, 6.8.7, 6.9.6, 7.0.3 and 7.1); elsewhere use http_request_host_is_external. |
designsetgo_form_webhook_timeout |
filter |
( int $seconds ). Default 5, clamped to 1–30. |
designsetgo_form_webhook_retry_delays |
filter |
( int[] $delays ). Seconds before each retry; the count is the number of retries, and an empty array disables them. |
designsetgo_form_webhook_send_after_response |
filter |
( bool $after_response ). Whether the first attempt runs at shutdown (true) or on WP-Cron (false). Defaults to whether the server can flush the response early. |
designsetgo_form_webhook_delivered |
action |
( int $submission_id, string $form_id, int $code ). |
designsetgo_form_webhook_failed |
action |
( int $submission_id, string $form_id, string $error, int $code ). Fires once, when delivery gives up. |
Auto-generated from
docs/api/FORM-WEBHOOKS.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2