Forms2web
Documentation

API for developers

REST API and webhooks: token auth, new-response events, signature verification and delivery guarantees.

Authentication

All requests go to the /api/v1 prefix and require a JWT access token in the Authorization header. The token is obtained via POST /auth/login and renewed via POST /auth/refresh.

curl -X POST https://app.forms2web.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "secret"}'

# → 200 {"accessToken": "...", "refreshToken": "..."}
# Далее: Authorization: Bearer <accessToken>

Webhooks

A webhook subscribes your server to the “completed response” event: on every new response the app makes an HTTP POST to the given URL. A webhook can be bound to a form (formId), to all forms of a list (targetList), or be global. Creating via API:

curl -X POST https://app.forms2web.com/api/v1/webhooks \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/hook",
    "secret": "my-secret-key",
    "formId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "enabled": true
  }'

Event format

The request body is JSON. The payload field contains the form field values by their keys; linkId is the id of the public link the response came from (null if not submitted via a link).

{
  "formId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "formTitle": "Опрос удовлетворённости",
  "submissionId": "9c1b2f4a-8d6e-4a3b-9f2c-1e5d7a9b0c1d",
  "respondentEmail": "ivan@example.com",
  "respondentName": "Иван Петров",
  "submittedAt": "2026-09-29T10:15:30.000Z",
  "payload": {
    "company": "ООО Ромашка",
    "score": "opt_1"
  },
  "linkId": "7f3a2b1c-5d4e-4a3b-8c9d-0e1f2a3b4c5d"
}

Verifying the signature

If a secret was set when creating the webhook, every request carries the x-webhook-signature: sha256=<hmac> header. The signature is computed over the raw request body — verify it before parsing JSON, otherwise reserialization changes the body and the signature will not match.

const crypto = require('crypto');

app.post('/hook', express.raw({type: 'application/json'}), (req, res) => {
  const signature = req.headers['x-webhook-signature'] || '';
  const expected = 'sha256=' + crypto
    .createHmac('sha256', process.env.WEBHOOK_SECRET)
    .update(req.body)
    .digest('hex');
  const valid = signature.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
  if (!valid) return res.status(401).end();
  // ... обработка ответа
  res.status(200).end();
});

Retries and idempotency

If the receiver is down or answers with a 5xx error, the request is retried up to 2 times with growing delays (~1 s and ~2 s); a single attempt times out after 15 seconds. 4xx errors (except 429) are not retried. The receiver should use submissionId as the unique key and ignore repeated deliveries.

Core resources

  • POST/auth/loginSign in with email and password → access/refresh tokens
  • POST/auth/refreshRenew the access token with a refresh token
  • GET/formsList of account forms
  • GET/forms/:idForm schema and settings
  • GET/form-submissionsForm responses (formId parameter)
  • POST/webhooksCreate a webhook: url, secret, formId, enabled
  • GET/webhooksList of webhooks (filtered by formId)