> ## Documentation Index
> Fetch the complete documentation index at: https://formhug.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update form settings

> **Required scope:** `form:write`. Field-level merge within each group; null clears the corresponding feature.



## OpenAPI

````yaml /api-reference/openapi.yaml patch /api/v1/forms/{form_token}/settings
openapi: 3.0.1
info:
  title: FormHug API V1
  version: v1
  description: |
    FormHug public REST API. All request/response keys are snake_case.

    Successful response:

    ```json
    {
      "data": { ... }
    }
    ```

    Paginated response:

    ```json
    {
      "data": [ ... ],
      "pagination": {
        "total": 123,
        "next_cursor": "NQ=="
      }
    }
    ```

    Error response:

    ```json
    {
      "error": "Human-readable message",
      "error_details": [
        { "attribute": "field_name", "message": "specific error" }
      ]
    }
    ```

    `error_details` only appears for model validation failures.
servers:
  - url: https://formhug.ai
security: []
tags:
  - name: Forms
    description: Form CRUD
  - name: Attachments
    description: >-
      2-step upload for form-element images (theme, rich-text, or field-element
      images). Prepare returns an `upload_id`; consume it in a theme update,
      attachment_commitments, or the form `fields` payload depending on purpose.
  - name: Entries
    description: Entries collected by a form owned by the current user
  - name: Folders
    description: Folder CRUD
  - name: Participated Forms
    description: Forms the current user has submitted to (does not own)
  - name: Published Form Entries
    description: Submit entries to a published form
  - name: Published Forms
    description: Read a published form's public structure for filling
  - name: Entry Attachments
    description: >-
      2-step upload for `attachment` field submissions. Prepare returns an
      `upload_id`; submit it under the attachment field in `field_values` when
      creating the entry.
  - name: Me
    description: Current authenticated user
  - name: Webhooks
    description: Webhook integrations attached to a form
  - name: Form Themes
    description: Read and update a form's visual theme
  - name: Form Settings
    description: >-
      Per-form settings — submission flow, availability, access control,
      presentation
  - name: Field Rules
    description: >-
      Read and replace a form's conditional field-display and post-submission
      redirect rules.
  - name: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
paths:
  /api/v1/forms/{form_token}/settings:
    parameters:
      - name: form_token
        in: path
        description: Form token
        required: true
        schema:
          type: string
    patch:
      tags:
        - Form Settings
      summary: Update form settings
      description: >-
        **Required scope:** `form:write`. Field-level merge within each group;
        null clears the corresponding feature.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FormSettingsUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/FormSettings'
        '422':
          description: Validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorEnvelope'
      security:
        - PersonalAccessToken:
            - form:write
components:
  schemas:
    FormSettingsUpdateRequest:
      type: object
      description: >-
        PATCH body. All keys are optional; only the groups (and within them, the
        fields) present in the payload are updated. `null` clears the
        corresponding feature.
      properties:
        locale:
          type: string
          nullable: true
        timezone:
          type: string
          nullable: true
        after_submission:
          type: object
          properties:
            mode:
              type: string
              enum:
                - show_message
                - redirect
                - report
              nullable: true
              description: >-
                Authoritative mode for after-submission behavior. "report" only
                applies to exam and evaluation forms.
            show_message:
              type: object
              properties:
                style:
                  type: string
                  enum:
                    - rich_text
                    - text
                  nullable: true
                  description: >-
                    Which content branch is active. rich_text uses the rich_text
                    field; text uses the text object.
                rich_text:
                  type: string
                  nullable: true
                  description: HTML body used when style is "rich_text".
                text:
                  type: object
                  description: Plain-text payload used when style is "text".
                  properties:
                    title:
                      type: string
                      nullable: true
                      description: Title shown on the success page.
                    description:
                      type: string
                      nullable: true
                      description: Body text shown under the title.
            redirect:
              type: object
              properties:
                url:
                  type: string
                  nullable: true
                  format: uri
                fields:
                  type: array
                  items:
                    type: string
                  description: Field api_codes appended to the redirect URL.
            report:
              type: object
              description: >-
                Report-style after-submission settings. Only applies to exam and
                evaluation forms.
              properties:
                score_based_feedbacks:
                  type: array
                  description: >-
                    Score-based feedback intervals. Required to be non-empty
                    when mode is "report".
                  items:
                    type: object
                    required:
                      - start_point
                      - end_point
                      - comment
                    properties:
                      start_point:
                        type: number
                        description: Score range left bound (inclusive).
                      end_point:
                        type: number
                        description: Score range right bound (inclusive).
                      comment:
                        type: string
                        description: >-
                          HTML feedback shown when the score falls in this
                          range.
        availability:
          type: object
          properties:
            manually_closed:
              type: boolean
            schedule:
              type: object
              nullable: true
              properties:
                start_at:
                  type: string
                  format: date-time
                  nullable: true
                end_at:
                  type: string
                  format: date-time
                  nullable: true
            entries_limit:
              type: integer
              nullable: true
              minimum: 1
            show_countdown:
              type: boolean
            show_form_before_open:
              type: boolean
        access_control:
          type: object
          properties:
            access_password:
              type: string
              nullable: true
        submission_options:
          type: object
          properties:
            show_progress:
              type: boolean
            show_field_number:
              type: boolean
    FormSettings:
      type: object
      required:
        - locale
        - timezone
        - after_submission
        - availability
        - access_control
        - submission_options
      properties:
        locale:
          type: string
          nullable: true
        timezone:
          type: string
          nullable: true
        after_submission:
          type: object
          properties:
            mode:
              type: string
              enum:
                - show_message
                - redirect
                - report
              nullable: true
              description: >-
                Authoritative mode for after-submission behavior. "report" only
                applies to exam and evaluation forms.
            show_message:
              type: object
              properties:
                style:
                  type: string
                  enum:
                    - rich_text
                    - text
                  nullable: true
                  description: >-
                    Which content branch is active. rich_text uses the rich_text
                    field; text uses the text object.
                rich_text:
                  type: string
                  nullable: true
                  description: HTML body used when style is "rich_text".
                text:
                  type: object
                  description: Plain-text payload used when style is "text".
                  properties:
                    title:
                      type: string
                      nullable: true
                      description: Title shown on the success page.
                    description:
                      type: string
                      nullable: true
                      description: Body text shown under the title.
            redirect:
              type: object
              properties:
                url:
                  type: string
                  nullable: true
                  format: uri
                fields:
                  type: array
                  items:
                    type: string
                  description: Field api_codes appended to the redirect URL.
            report:
              type: object
              description: >-
                Report-style after-submission settings. Only applies to exam and
                evaluation forms.
              properties:
                score_based_feedbacks:
                  type: array
                  description: >-
                    Score-based feedback intervals. Required to be non-empty
                    when mode is "report".
                  items:
                    type: object
                    required:
                      - start_point
                      - end_point
                      - comment
                    properties:
                      start_point:
                        type: number
                        description: Score range left bound (inclusive).
                      end_point:
                        type: number
                        description: Score range right bound (inclusive).
                      comment:
                        type: string
                        description: >-
                          HTML feedback shown when the score falls in this
                          range.
        availability:
          type: object
          properties:
            manually_closed:
              type: boolean
            schedule:
              type: object
              nullable: true
              properties:
                start_at:
                  type: string
                  format: date-time
                  nullable: true
                end_at:
                  type: string
                  format: date-time
                  nullable: true
            entries_limit:
              type: integer
              nullable: true
              minimum: 1
            show_countdown:
              type: boolean
            show_form_before_open:
              type: boolean
        access_control:
          type: object
          properties:
            access_password:
              type: string
              nullable: true
        submission_options:
          type: object
          properties:
            show_progress:
              type: boolean
            show_field_number:
              type: boolean
    ValidationErrorEnvelope:
      type: object
      required:
        - error
        - error_details
      description: >-
        Returned on model validation failures. error_details lists per-field
        errors.
      properties:
        error:
          type: string
          example: Name can't be blank
        error_details:
          type: array
          items:
            type: object
            required:
              - attribute
              - message
            properties:
              attribute:
                type: string
                example: name
              message:
                type: string
                example: can't be blank
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: >
        Personal Access Token prefixed with `fh_`. Sent as `Authorization:
        Bearer fh_xxx`.

        The scope required by each endpoint is listed in that endpoint's
        description.

````