Forms

Configure a form

Create or update a form definition with required fields, submit action, and limits. Use listConfiguredIntegrations first to find services. IMPORTANT: use Safari ITP-proof pattern: store session_id in sessionStorage and send it as X-Session-Id header on the session GET and form submit calls.

post/sapi/project/{projectId}/forms/configure

Request

  • Base URL: https://api.websitepublisher.ai
  • URL: https://api.websitepublisher.ai/sapi/project/{projectId}/forms/configure
  • Auth: OAuth 2 (authorization code, authorization URL https://api.websitepublisher.ai/dapi/oauth/authorize, token URL https://api.websitepublisher.ai/dapi/oauth/token, scopes: read, write)

Path parameters

projectIdinteger required

Request body

form_namestring required

Unique form identifier (lowercase a-z, 0-9, underscore, max 64 chars)

required_fieldsstring[] required

Field names the visitor must fill in

allowed_action_jsonstring

JSON-encoded single action. Keys: type (iapi/webhook/none), service, endpoint, input_template ({{fields.xxx}} placeholders). Example: {"type":"iapi","service":"resend","endpoint":"send-email","input_template":{"from":"noreply@site.com","to":"info@site.com","subject":"{{fields.name}}","text":"{{fields.message}}"}}

allowed_actions_jsonstring

JSON-encoded array of actions (max 3). Use instead of allowed_action_json when you need multiple actions (e.g. webhook + confirmation email). Actions execute in order. Example: [{"type":"webhook","url":"https://hooks.example.com/lead"},{"type":"iapi","service":"resend","endpoint":"send-email","input_template":{"from":"noreply@site.nl","to":"{{fields.email}}","subject":"Bevestiging","text":"Bedankt {{fields.naam}}"}}]

max_submits_per_sessioninteger

Max submits per visitor session (default: 3, max: 100)

Example request

{
  "form_name": "contact",
  "required_fields": [
    "name",
    "email",
    "message"
  ]
}

Response

Form updated

Changes

No recorded changes to this operation across all 1 revision of this API.