POST/smart-forms/:id/unpublish

Unpublish Smart Form

Stop accepting new sessions on a published smart form

Scope: SMART_FORMS_WRITE

Overview

Stops new sessions from being started on a published smart form. Supports two modes: soft (blocks new sessions but keeps the form published) and hard (reverts to DRAFT, expires all active sessions, and refunds reserved credits).

Request

POST/smart-forms/:id/unpublish

Headers

HeaderValue
AuthorizationBearer fxk_live_<your-api-key>
Content-Typeapplication/json

Path Parameters

Request Body

Unpublish Modes

ModeEffect
softSets allowNewSessions = false. The form remains PUBLISHED — existing active sessions continue. No session expiration or credit refunds.
hardSets publishStatus = DRAFT and allowNewSessions = false. Immediately expires all active sessions and refunds any reserved credits.

Hard Mode is Destructive

The hard mode expires all in-progress sessions permanently. Respondents who are mid-interview will lose their progress and will not be able to continue.

Example Request

curl -X POST "https://api.formfex.com/api/v1/public/smart-forms/SMART_FORM_ID/unpublish" \
  -H "Authorization: Bearer $FORMFEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "soft" }'

Response

Error Cases

StatusDescription
400Form is not in PUBLISHED status, or mode is not soft or hard
401Invalid or missing API key
404Smart form not found or not owned by this API key

n8n

In n8n, this operation is available as Unpublish under the Smart Form resource in the Formfex node.