Publish a form

Publish the submitted questions and branching logic and enable responses.


POST/api/v1/forms/{formId}/publish

Authorization

Authorization required string · header
Send Bearer <token> with an account API key that has the forms:write scope.

Path parameters

formId required string
Form ID. See FormModel.

Request body

application/json

version required integer
Current draft version, returned by Get a form or Save a form draft. A stale version returns 409.
drafts required FormField[]
Complete question and ending array. See FormField, FieldKindEnum, and navigation validation.
logicsLogic[]
Replacement branching rules. Use [] to clear them. When omitted, HeyForm uses existing draft logic or falls back to published logic. See Logic.

The request keeps the supplied version. When publishing a draft you just saved, use the version and sanitized drafts returned by the save request.

Response

201 · application/json

Source model: FormModel.

FieldTypeDescription
idstringID returned by the operation.
activebooleanWhether the form accepts responses.
versionintegerCurrent draft version.
publishedAtintegerTime of first publication as Unix seconds. 0 means the form has never been published.