Docs

API referenceChangelogStatus
Documentation menu
Developers › Connector protocol

Connector protocol

All traffic between FormVigilant and the connector is signed. The only unsigned call is the one-time pairing request made from wp-admin. This page documents the protocol for security reviews and for developers writing custom adapters.

Pairing

  1. FormVigilant issues a pairing code with a 10-minute lifetime.
  2. In wp-admin the connector calls POST /v1/connector/pair with the code, the site URL and the WordPress, PHP and plugin versions.
  3. FormVigilant returns a site_id and a per-site secret. The connector stores the secret encrypted in wp_options.

Signed requests

Every other request, in both directions, carries three headers:

HeaderValue
X-FV-TimestampUnix time in whole seconds
X-FV-Nonce32 random hex characters, single use
X-FV-SignatureLowercase hex HMAC-SHA256 of the canonical string, keyed with the site secret

The canonical string is:

timestamp.nonce.METHOD.path.sha256hex(body)

path is the request target as sent, including any query string; an empty body hashes the empty string. The receiver rejects the request when the timestamp is more than 300 seconds from its own clock, when the signature does not match (compared in constant time), or when the nonce was already seen in the last 10 minutes.

Connector endpoints

Under /wp-json/formvigilant/v1/, all signed:

EndpointPurpose
GET discoverForms from every active adapter with fields, recipients and capabilities, plus SMTP plugin and versions
POST submitSubmit a synthetic test: adapter, form_id, marker, optional payload_overrides. Returns L1 and L2 results
GET entryLook up the test entry by adapter, form_id and marker
POST entry/deleteDelete a test entry by id; only entries that carry a marker can be deleted
GET diagnosticsSMTP setup, recent wp_mail failures, cron status, DNS hint
GET heartbeatVersions, active adapters, cron status

Calls from the connector

  • POST /v1/connector/heartbeat every 15 minutes.
  • POST /v1/connector/mail-event when wp_mail_succeeded or wp_mail_failed fires for a message containing an active marker (L3 evidence).

Marker scoping

A marker such as fv_9k2m7xq4ab is created per run. The connector's wp_mail filter only adds the catch recipient, and its mail hooks only report events, for messages that contain an active marker. Every other email on the site passes through untouched.