openapi: 3.0.3
info:
  title: forms.app API
  version: 1.0.0
  description: >
    ## Overview


    The **forms.app API** gives you programmatic, read-only access to your forms
    and their

    submissions. You can list all the forms in your account, fetch a specific
    form's complete

    structure (questions, design settings, submission behaviour, thank-you
    pages), and page

    through the answers your respondents have submitted.


    ## Authentication


    Every request must be authenticated with exactly **one** of the two methods
    below.

    Providing both in the same request is not allowed and will return `401
    Unauthorized`.


    ### Option 1 — OAuth 2.0 Bearer Token


    Obtain a JWT via the forms.app OAuth 2.0 flow and pass it in the
    `Authorization` header:


    ```

    Authorization: Bearer <your_token>

    ```


    ### Option 2 — API Key


    Pass your API key in the `X-Api-Key` header:


    ```

    X-Api-Key: <your_api_key>

    ```


    #### How to create an API key


    1. Log in to [forms.app](https://forms.app).

    2. Click your avatar in the top-right corner and open **Account Settings**.

    3. Go to the **API Keys** tab.

    4. Click **Create API Key**, enter a descriptive name, and confirm.

    5. Copy the generated key immediately — it is shown **only once**.

    6. Store it securely (e.g. in an environment variable or secret manager).


    > You can create multiple keys (one per integration), and revoke any of them
    at any time

    > from the same **API Keys** settings page.


    > **Newly created or re-activated keys:** for up to ~30 seconds, a key whose
    validation

    > recently failed may keep returning `401 Unauthorized` from a short-lived
    cache. If a key

    > you just created or re-activated is rejected, wait ~30 seconds and retry.


    ## Response Envelope


    All endpoints return a consistent JSON envelope:


    **Success (`2xx`)**

    ```json

    {
      "success": true,
      "data": { },
      "errors": []
    }

    ```


    **Error (`4xx` / `5xx`)**

    ```json

    {
      "success": false,
      "data": null,
      "errors": [
        { "errorCode": 1001, "errorMessage": "Unauthorized" }
      ]
    }

    ```


    ## Rate Limiting


    Requests are rate-limited per API key / token (falling back to client IP
    when neither is

    present). You may send up to **300 requests per 60-second window**. When the
    limit is

    exceeded the API returns `429 Too Many Requests` with a `Retry-After` header
    indicating how

    many seconds to wait before the window resets. Wait for that period and
    retry — do not spam

    the endpoint in a tight loop.


    A short-term burst limit also applies per endpoint (about **50 requests per
    second**, with a

    burst allowance up to **100**). Spread requests out rather than firing them
    in a tight burst

    to avoid transient `429` responses.
  license:
    name: Proprietary
    url: https://forms.app/terms
servers:
  - url: https://api.forms.app
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Form
    description: >
      Read-only access to forms in your account. A form is the central resource
      — it contains

      an ordered list of questions (each with its own type, settings, and
      optional choices),

      visual design settings (colours, fonts, theme), behavioural settings
      (captcha, drafts,

      multi-page steps), logo configuration, and one or more thank-you pages
      shown after

      submission. Use these endpoints to inspect form structure and sync it with
      external systems.
  - name: Answer
    description: >
      Read submitted answers (responses) for a form. Because a form can
      accumulate thousands of

      submissions, answers are returned in pages. Each page contains a `result`
      array of answer

      objects, a `totalCount` of all submissions, and a `searchAfter` cursor you
      pass as the next

      `pageNumber` to continue walking through the full result set. Each answer
      captures the

      respondent's replies to every question, optional file attachments, user
      info, scoring points,

      and submission metadata such as creation date.
  - name: Gateway
    description: >
      Gateway-level operational endpoints. These reflect the health and status
      of the API

      gateway itself rather than any backend service. No authentication is
      required.
paths:
  /v1/form:
    get:
      summary: List all forms
      description: >
        Returns a list of all forms that belong to the authenticated account.


        Each item in the returned array contains the form's unique identifier
        (`_id`) and its

        title. Use `_id` with the `GET /form/{id}` endpoint to retrieve the full
        structure of

        a specific form including questions, design, and settings.


        Forms are returned regardless of their visibility state (`public`,
        `unlisted`, or

        `private`) as long as they belong to the authenticated user and are not
        in the trash

        or archived.
      operationId: getUserForms
      tags:
        - Form
      responses:
        '200':
          description: List of forms returned successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessWrapper'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/FormListItem'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v1/form/{id}:
    get:
      summary: Get form by ID
      description: >
        Returns the complete structure of a single form identified by its `_id`.


        The response includes everything needed to understand or reproduce the
        form:


        - **questions** — ordered list of all questions, each with its type
        (`questionType`),
          label, description, required flag, and type-specific settings (choice options, text
          constraints, file upload limits, etc.).
        - **baseSettings** — behavioural settings: captcha, draft saving,
        multi-step navigation,
          multiple-submission prevention, and more.
        - **designSettings** — visual theme: colours (background, question,
        answer, border, main),
          font family and size, border radius, background image, and theme name.
        - **logo** — logo image URL, alignment, brightness, and sticky
        behaviour.

        - **thankYouPages** — one or more thank-you screens shown after
        submission, including
          redirect configuration, sharing options, and statistics display.
        - **submitButton** — label text and alignment of the submission button.

        - **state** — visibility of the form: `public`, `unlisted`, or
        `private`.

        - **supportedLanguages** — language codes the form is available in.

        - **calculators / conditions** — scoring calculator rules and
        conditional logic (raw arrays).

        - **createDate / updateDate** — ISO 8601 timestamps of creation and last
        modification.


        Returns `404 Not Found` if the form does not exist or belongs to a
        different account.
      operationId: getFormById
      tags:
        - Form
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier (`_id`) of the form to retrieve.
          schema:
            type: string
      responses:
        '200':
          description: Form returned successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessWrapper'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Form'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v1/form/{id}/answer/p/{pageNumber}:
    get:
      summary: List form answers (paginated)
      description: >
        Returns one page of submitted answers for the specified form. Because a
        form can

        accumulate a large number of submissions, results are delivered in
        pages.


        **Pagination flow:**

        1. Call with `pageNumber: 1` to get the first page.

        2. The response contains `totalCount` (total number of submissions) and
        a `searchAfter`
           cursor array that points to the last record in the current page.
        3. Increment `pageNumber` by 1 for each subsequent request. The
        `searchAfter` cursor
           in the response can be used for cursor-based navigation in advanced scenarios.
           Repeat until you have fetched all pages (compare collected count against `totalCount`).

        **Each answer object contains:**

        - **answers** — array of per-question replies. Each entry uses
        short-hand field names:
          `q` (question ID), `t` (text), `n` (number), `d` (date), `b` (boolean),
          `c` (choice selections with text `t`, value `v`, and order `o`),
          `fn` (name fields: first, last, middle, prefix, suffix),
          `a` (address fields: line 1, line 2, city, state, postal code, country),
          `p` (phone: country code, area, number, extension),
          `f` (uploaded files: file ID, type, size), `ac` (answer comment).
        - **userInfo** — optional respondent info (full name) if collected.

        - **point** — total score (`tp`) when the form uses a calculator / quiz
        scoring.

        - **answerFiles** — metadata for files attached to the submission.

        - **fileToken** — token used to download file attachments.

        - **publicId** — public-facing submission identifier.

        - **createDate** — ISO 8601 timestamp of when the answer was submitted.


        Returns `404 Not Found` if the form does not exist or belongs to a
        different account.
      operationId: listFormAnswersByPage
      tags:
        - Answer
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier (`_id`) of the form whose answers to retrieve.
          schema:
            type: string
        - name: pageNumber
          in: path
          required: true
          description: >
            Page number to retrieve. Starts at `1`. Increment by 1 for each
            subsequent page.
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: Answer page returned successfully.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessWrapper'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/AnswerPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
  /v1/health:
    get:
      summary: Gateway health check
      description: >
        Returns the operational status of the API gateway (KrakenD) itself.

        Use this endpoint for infrastructure liveness probes and uptime
        monitoring.


        This is a KrakenD built-in endpoint — it reflects the gateway process
        status,

        not any upstream backend service. Authentication is **not** required.
      operationId: gatewayHealth
      tags:
        - Gateway
      security: []
      responses:
        '200':
          description: The gateway is up and running.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                    description: Always `"ok"` when the gateway is healthy.
                  now:
                    type: string
                    description: Current gateway time as a Go time string.
                  agents:
                    type: object
                    description: >-
                      Status of any registered async agents (empty object when
                      none are configured).
              example:
                status: ok
                now: 2024-03-15 10:30:00.000000000 +0000 UTC m=+3600.123
                agents: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        OAuth 2.0 Bearer token (HS256 JWT) issued by the forms.app OAuth 2.0
        flow.


        Pass the token in the `Authorization` header:

        ```

        Authorization: Bearer <your_token>

        ```


        **Cannot be combined with `X-Api-Key`** — use one or the other per
        request.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >
        API key generated from your forms.app account settings.


        Pass the key in the `X-Api-Key` header:

        ```

        X-Api-Key: <your_api_key>

        ```


        **How to create an API key:**

        1. Log in to [forms.app](https://forms.app).

        2. Open **Account Settings** → **API Keys**.

        3. Click **Create API Key**, give it a name, and copy the key.
           The key is shown **only once** — store it securely.

        **Cannot be combined with `Authorization: Bearer`** — use one or the
        other per request.
  schemas:
    SuccessWrapper:
      description: >
        Standard envelope wrapping all successful responses. The `data` field
        contains the

        actual payload and its shape varies per endpoint (object or array).
        `success` is always

        `true` and `errors` is always an empty array on success.
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
          description: Always `true` for successful responses.
        data:
          description: The response payload. Shape depends on the endpoint.
        errors:
          type: array
          items: {}
          maxItems: 0
          description: Always an empty array on success.
    FormListItem:
      type: object
      properties:
        _id:
          type: string
        title:
          type: string
    ApiError:
      description: A single error entry describing what went wrong.
      type: object
      properties:
        errorCode:
          type: integer
          description: Machine-readable error code identifying the specific failure reason.
        errorMessage:
          type: string
          description: Human-readable description of the error.
    ErrorWrapper:
      description: >
        Standard envelope for all error responses. `success` is always `false`,

        `data` is `null`, and `errors` contains one or more error objects
        explaining

        what went wrong.
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always `false` for error responses.
        data:
          type: object
          nullable: true
          description: Always `null` for error responses.
        errors:
          type: array
          description: One or more error objects describing the failure.
          items:
            $ref: '#/components/schemas/ApiError'
    BaseSettings:
      type: object
      properties:
        autoPassSingle:
          type: boolean
        backButton:
          type: boolean
        cardDesign:
          type: boolean
        forceShowCaptchaFromAdmin:
          type: boolean
        hideCaptcha:
          type: boolean
        isEnabledMessages:
          type: boolean
        isEnabledSaveAsDraft:
          type: boolean
        isEnabledSignupForSaveAsDraft:
          type: boolean
        isRtl:
          type: boolean
        isShouldShowCookieModal:
          type: boolean
        preventMultipleSubmissions:
          type: boolean
        removeBranding:
          type: boolean
        showSubmissionSummary:
          type: boolean
        steps:
          type: boolean
        captchaChoice:
          type: boolean
        cardDesignFadeIn:
          type: boolean
        cardDesignTransition:
          type: string
        hideFormTitle:
          type: boolean
        hideQuestionNumber:
          type: boolean
        isDisabledMessages:
          type: boolean
        isOnlySelectedUsers:
          type: boolean
        questionMustValid:
          type: boolean
        requireLoginForSubmission:
          type: boolean
        showLoginBeforeForm:
          type: boolean
    Calculator:
      type: object
      properties:
        questionId:
          type: string
        questionType:
          type: string
        actions:
          type: array
          items:
            type: object
            properties:
              answer:
                type: string
              command:
                type: string
                enum:
                  - increase
                  - decrease
              value:
                type: number
    Condition:
      type: object
      properties:
        name:
          type: string
        version:
          type: integer
        triggers:
          type: array
          items:
            type: object
            properties:
              questionId:
                type: string
              answer:
                type: array
                items:
                  type: string
              operator:
                type: string
                enum:
                  - and
                  - or
              case:
                type: string
                enum:
                  - is
                  - is not
                  - includes
                  - startsWith
                  - endsWith
                  - greaterThan
                  - lesserThan
                  - isEmpty
                  - isFilled
        actions:
          type: array
          items:
            type: object
            properties:
              targetQuestionId:
                type: string
              action:
                type: string
                enum:
                  - show
                  - hide
    DesignSettings:
      type: object
      properties:
        answerColor:
          type: string
        backgroundColor:
          type: string
        backgroundImage:
          type: string
          nullable: true
        borderColor:
          type: string
        borderRadius:
          type: string
        font:
          type: string
        fontSize:
          type: string
        inputColor:
          type: string
        mainColor:
          type: string
        questionColor:
          type: string
        themeName:
          type: string
        answerTextColor:
          type: string
        backgroundBrightness:
          type: number
        backgroundLayout:
          type: string
        backgroundPosition:
          type: string
        customCss:
          type: array
          items: {}
        customCssMediaRules:
          type: array
          items:
            type: object
            properties:
              width:
                type: string
              css:
                type: array
                items: {}
        isCustomCssEnabled:
          type: boolean
        isEnabled:
          type: boolean
    Logo:
      type: object
      properties:
        align:
          type: string
        altText:
          type: string
        brightness:
          type: number
        image:
          type: string
        isEnabled:
          type: boolean
        radius:
          type: number
        sticky:
          type: string
        isDecorative:
          type: boolean
        layout:
          type: string
    QuestionChoice:
      type: object
      properties:
        subType:
          type: string
          description: >-
            dropdown, multiplechoice, singlechoice, rating, picturechoice,
            opinionscale, ranking
        min:
          type: number
        max:
          type: number
        other:
          type: boolean
        multipleSelection:
          type: boolean
        shuffleOptions:
          type: boolean
        options:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              text:
                type: string
              fileId:
                type: string
              altText:
                type: string
        defaultValue:
          type: array
          items:
            type: string
        otherIsRequired:
          type: boolean
        otherPlaceholder:
          type: string
        isShowEmptyoption:
          type: boolean
        emptyOption:
          type: string
        rateStyle:
          type: string
        showLabel:
          type: boolean
        labelLeft:
          type: string
        labelCenter:
          type: string
        labelRight:
          type: string
        isOrder:
          type: boolean
        isShowCommentField:
          type: boolean
        commentFieldHeader:
          type: string
    QuestionText:
      type: object
      properties:
        subType:
          type: string
          description: shorttext, longtext, maskedtext
        minLength:
          type: number
        maxLength:
          type: number
        defaultValue:
          type: string
        maskPattern:
          type: string
        maskChar:
          type: string
        regexValidation:
          type: boolean
        regex:
          type: string
    QuestionImageUpload:
      type: object
      properties:
        maxFileCount:
          type: integer
    QuestionFileUpload:
      type: object
      properties:
        allowedFileTypes:
          type: array
          items:
            type: string
        maxFileCount:
          type: integer
    QuestionMedia:
      type: object
      properties:
        imageUrl:
          type: string
        videoUrl:
          type: string
        videoThumbnail:
          type: string
        iconUrl:
          type: string
        iconId:
          type: string
        iconColor:
          type: string
        size:
          type: number
        fileId:
          type: string
        cssClass:
          type: string
        mobileCssClass:
          type: string
        autoPlay:
          type: boolean
        nounProject:
          type: object
          properties:
            id:
              type: string
        fontawesome:
          type: object
          properties:
            id:
              type: string
            version:
              type: string
            style:
              type: string
        altText:
          type: string
        isDecorative:
          type: boolean
        align:
          type: string
        brightness:
          type: number
    QuestionEmail:
      type: object
      properties:
        labels:
          type: object
          properties:
            confirmation:
              type: string
        isShowConfirmation:
          type: boolean
        isLimitedDomain:
          type: boolean
        limitedDomain:
          type: string
    QuestionFullname:
      type: object
      properties:
        labels:
          type: object
          properties:
            firstName:
              type: string
            lastName:
              type: string
            prefix:
              type: string
            middle:
              type: string
            suffix:
              type: string
        middle:
          type: boolean
        prefix:
          type: boolean
        suffix:
          type: boolean
    QuestionAddress:
      type: object
      properties:
        labels:
          type: object
          properties:
            addressLine1:
              type: string
            addressLine2:
              type: string
            city:
              type: string
            state:
              type: string
            pcode:
              type: string
            country:
              type: string
        isShowAddressLine2:
          type: boolean
        isShowCity:
          type: boolean
        isShowState:
          type: boolean
        isShowPcode:
          type: boolean
        isShowCountry:
          type: boolean
        isShowMap:
          type: boolean
        showMapOnly:
          type: boolean
        defaultCountry:
          type: array
          items: {}
        defaultLocation:
          type: object
          properties:
            lat:
              type: number
            lng:
              type: number
            z:
              type: number
        defaultValue:
          type: object
          properties:
            addressLine1:
              type: string
            addressLine2:
              type: string
            city:
              type: string
            state:
              type: string
            pcode:
              type: string
    QuestionTime:
      type: object
      properties:
        defaultHour:
          type: number
        defaultMinute:
          type: number
        twelvehour:
          type: boolean
        doneText:
          type: string
        clearText:
          type: string
        cancelText:
          type: string
    QuestionDate:
      type: object
      properties:
        selectMonths:
          type: boolean
        selectYears:
          type: number
        today:
          type: string
        clear:
          type: string
        close:
          type: string
        format:
          type: string
          enum:
            - local
            - MM/DD/YYYY
            - DD/MM/YYYY
            - YYYY/MM/DD
        separator:
          type: string
          enum:
            - /
            - .
            - '-'
        isPast:
          type: boolean
        isFuture:
          type: boolean
        isWithTime:
          type: boolean
        timeFormat:
          type: string
          enum:
            - '12'
            - '24'
        timePlaceholder:
          type: string
    QuestionPhone:
      type: object
      properties:
        labels:
          type: object
          properties:
            countrycode:
              type: string
            areacode:
              type: string
            extension:
              type: string
        isShowCountrycode:
          type: boolean
        isShowAreacode:
          type: boolean
        isShowExtension:
          type: boolean
        mask:
          type: boolean
        maskPattern:
          type: string
    QuestionNumber:
      type: object
      properties:
        onlypositive:
          type: boolean
        decimals:
          type: number
        min:
          type: number
        max:
          type: number
        defaultValue:
          type: number
    QuestionTermsAndConditions:
      type: object
      properties:
        showQuestionTitle:
          type: boolean
        label:
          type: object
          properties:
            beforeLinkedText:
              type: string
            linkedText:
              type: string
            afterLinkedText:
              type: string
        content:
          type: string
        url:
          type: string
    QuestionProductBasket:
      type: object
      properties:
        currency:
          type: string
        discountCode:
          type: boolean
        tax:
          type: object
          properties:
            isEnabled:
              type: boolean
            rate:
              type: number
            type:
              type: string
              enum:
                - includes
                - excludes
        hideSummary:
          type: boolean
        viewType:
          type: object
          properties:
            viewTypes:
              type: array
              items:
                type: string
                enum:
                  - grid
                  - list
                  - grid3
            defaultViewType:
              type: string
              enum:
                - grid
                - list
                - grid3
        categories:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              parentId:
                type: string
              name:
                type: string
        defaultCategory:
          type: string
        shippings:
          type: array
          items:
            type: object
            properties:
              fee:
                type: number
              isFree:
                type: boolean
        products:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              price:
                type: number
              variantPrice:
                type: object
                properties:
                  isEnable:
                    type: boolean
                  minPrice:
                    type: number
                  maxPrice:
                    type: number
              unit:
                type: string
              desc:
                type: string
              longDesc:
                type: string
              tags:
                type: array
                items:
                  type: string
              detailUrl:
                type: string
              hidden:
                type: boolean
              variants:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    options:
                      type: array
                      items:
                        type: string
              fileIds:
                type: array
                items:
                  type: string
              fileId:
                type: string
              fileInfos:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    altText:
                      type: string
              stock:
                type: object
                properties:
                  isEnable:
                    type: boolean
                  whenOutOfStock:
                    type: string
                    enum:
                      - hide
                      - disable
                      - continue
                  showRemainingStock:
                    type: boolean
              categories:
                type: array
                items:
                  type: object
                  properties:
                    _id:
                      type: string
                    name:
                      type: string
    QuestionPayment:
      type: object
      properties:
        currency:
          type: string
        amount:
          type: number
        canAmountBeEnter:
          type: boolean
        minAmount:
          type: number
        maxAmount:
          type: number
        relatedQuestionId:
          type: string
        testmode:
          type: boolean
        paymentPageTitle:
          type: string
        gateways:
          type: object
          properties:
            paypal:
              type: boolean
            iyzico:
              type: boolean
            wirecard:
              type: boolean
            mokapazaryeri:
              type: boolean
            mokadealer:
              type: boolean
            stripe:
              type: boolean
            cash:
              type: boolean
            bankTransfer:
              type: boolean
        cashDesc:
          type: string
        cashOptionTypes:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
        defaultGateway:
          type: string
        gatewayOrder:
          type: array
          items:
            type: string
        gatewaySettings:
          type: object
    QuestionSelectionMatrix:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                enum:
                  - radio
                  - checkbox
              text:
                type: string
        columns:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
        defaultValue:
          type: object
        requiredEachRow:
          type: boolean
    QuestionGrid:
      type: object
      properties:
        columns:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                type: string
                enum:
                  - text
                  - date
                  - number
                  - dropdown
                  - maskedtext
              hidden:
                type: boolean
              required:
                type: boolean
              placeholder:
                type: string
              sumOption:
                type: boolean
              options:
                type: array
                items:
                  type: object
                  properties:
                    text:
                      type: string
              maskPattern:
                type: string
              date:
                type: object
                properties:
                  format:
                    type: string
                    enum:
                      - local
                      - MM/DD/YYYY
                      - DD/MM/YYYY
                      - YYYY/MM/DD
                  separator:
                    type: string
                    enum:
                      - /
                      - .
                      - '-'
        hasRowLimit:
          type: boolean
        rowLimitCount:
          type: number
        allRowOpen:
          type: boolean
    QuestionDrawing:
      type: object
      properties:
        subType:
          type: string
          description: drawing or signature
        backgroundFileId:
          type: string
        isUserUploadBackground:
          type: boolean
        lineColor:
          type: string
    Question:
      type: object
      properties:
        _id:
          type: string
        displayOrder:
          type: integer
        isActive:
          type: boolean
        isDeleted:
          type: boolean
        isRequired:
          type: boolean
        question:
          type: string
        questionType:
          type: string
        description:
          type: string
        hiddenQuestion:
          type: boolean
        readonly:
          type: boolean
        parentId:
          type: string
        choice:
          $ref: '#/components/schemas/QuestionChoice'
        text:
          $ref: '#/components/schemas/QuestionText'
        imageUpload:
          $ref: '#/components/schemas/QuestionImageUpload'
        fileUpload:
          $ref: '#/components/schemas/QuestionFileUpload'
        isWithAi:
          type: boolean
        placeholder:
          type: string
        getValueFromUrl:
          type: boolean
        showOnResponses:
          type: boolean
        media:
          $ref: '#/components/schemas/QuestionMedia'
        email:
          $ref: '#/components/schemas/QuestionEmail'
        fullname:
          $ref: '#/components/schemas/QuestionFullname'
        address:
          $ref: '#/components/schemas/QuestionAddress'
        time:
          $ref: '#/components/schemas/QuestionTime'
        date:
          $ref: '#/components/schemas/QuestionDate'
        phone:
          $ref: '#/components/schemas/QuestionPhone'
        number:
          $ref: '#/components/schemas/QuestionNumber'
        termsandconditions:
          $ref: '#/components/schemas/QuestionTermsAndConditions'
        imageContent:
          type: object
        pagebreak:
          type: object
        wysiwyg:
          type: object
          properties:
            content:
              type: string
        productbasket:
          $ref: '#/components/schemas/QuestionProductBasket'
        payment:
          $ref: '#/components/schemas/QuestionPayment'
        selectionmatrix:
          $ref: '#/components/schemas/QuestionSelectionMatrix'
        grid:
          $ref: '#/components/schemas/QuestionGrid'
        drawing:
          $ref: '#/components/schemas/QuestionDrawing'
        questiongroup:
          type: object
    SubmitButton:
      type: object
      properties:
        align:
          type: string
          enum:
            - left
            - center
            - right
        isShow:
          type: boolean
        text:
          type: string
    ThankYouPage:
      type: object
      properties:
        _id:
          type: string
        desc:
          type: string
        isSaveAndReturn:
          type: boolean
        isShareRecords:
          type: boolean
        isShowResponseCount:
          type: boolean
        popupBtnText:
          type: string
        popupText:
          type: string
        popupTitle:
          type: string
        redirectAfterSubmit:
          type: boolean
        redirectUrl:
          type: string
        showPrintButton:
          type: boolean
        showPublicId:
          type: boolean
        showShare:
          type: boolean
        showStatistic:
          type: boolean
        showThankYouPage:
          type: boolean
        statisticDesc:
          type: string
        statisticTitle:
          type: string
        title:
          type: string
        pdfTemplateId:
          type: string
    AfterSubmissionSettings:
      type: object
      properties:
        isRedirect:
          type: boolean
        isSaveAndReturn:
          type: boolean
        redirectUrl:
          type: string
        showReportPage:
          type: boolean
        showThankYouPage:
          type: boolean
    CalculatorSettings:
      type: object
      properties:
        calculatorDetailText:
          type: string
        calculatorResultText:
          type: string
        customizeMessages:
          type: array
          items:
            type: object
            properties:
              min:
                type: number
              max:
                type: number
              message:
                type: string
        isShowCalculatorDetail:
          type: boolean
        isShowCalculatorResult:
          type: boolean
        isShowCustomizeMessage:
          type: boolean
    ConversionCodes:
      type: object
      properties:
        remarketing:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              provider:
                type: string
              eventName:
                type: string
    Cover:
      type: object
      properties:
        altText:
          type: string
        brightness:
          type: number
        image:
          type: string
        isDecorative:
          type: boolean
        isEnabled:
          type: boolean
        layout:
          type: string
        position:
          type: string
        zoom:
          type: number
    DirectMessageSettings:
      type: object
      properties:
        facebook:
          type: object
          properties:
            isEnable:
              type: boolean
            messengerAddress:
              type: string
        whatsapp:
          type: object
          properties:
            isEnable:
              type: boolean
            phone:
              type: string
    LastEdited:
      type: object
      properties:
        date:
          type: string
          format: date-time
        fullname:
          type: string
        userId:
          type: string
    LocationSettings:
      type: object
      properties:
        isEnable:
          type: boolean
        lat:
          type: number
        lng:
          type: number
        provinceCode:
          type: string
        radius:
          type: number
    MetaData:
      type: object
      properties:
        description:
          type: string
        fileId:
          type: string
        title:
          type: string
    PageSettings:
      type: object
      properties:
        firstPageId:
          type: string
        firstPageTitle:
          type: string
    DateActionSettings:
      type: object
      properties:
        date:
          type: string
          format: date-time
        isEnabled:
          type: boolean
        redirectButtonText:
          type: string
        redirectUrl:
          type: string
        wysiwyg:
          type: string
    ThankYouPageSettings:
      type: object
      properties:
        desc:
          type: string
        hidePrintButton:
          type: boolean
        hideShare:
          type: boolean
        showPublicId:
          type: boolean
        title:
          type: string
    Timer:
      type: object
      properties:
        hoursText:
          type: string
        isCountUp:
          type: boolean
        isEnabled:
          type: boolean
        minutesText:
          type: string
        seconds:
          type: number
        secondsText:
          type: string
        timeExpiredButton:
          type: string
        timeExpiredButtonWithInvalidForm:
          type: string
        timeExpiredMessage:
          type: string
        timeExpiredMessageWithInvalidForm:
          type: string
        timeExpiredTitle:
          type: string
    WelcomePageSettings:
      type: object
      properties:
        buttonText:
          type: string
        desc:
          type: string
        showWelcomePage:
          type: boolean
        title:
          type: string
    Form:
      type: object
      properties:
        _id:
          type: string
        baseSettings:
          $ref: '#/components/schemas/BaseSettings'
        calculators:
          type: array
          items:
            $ref: '#/components/schemas/Calculator'
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/Condition'
        createDate:
          type: string
          format: date-time
        updateDate:
          type: string
          format: date-time
        creatorId:
          type: string
        currencySymbolLocation:
          type: string
          enum:
            - before
            - after
            - symbol
        designSettings:
          $ref: '#/components/schemas/DesignSettings'
        isArchived:
          type: boolean
        isTrash:
          type: boolean
        isUsedCalculator:
          type: boolean
        isUserInaccessible:
          type: boolean
        logo:
          $ref: '#/components/schemas/Logo'
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
        state:
          type: string
          enum:
            - public
            - unlisted
            - private
        submitButton:
          $ref: '#/components/schemas/SubmitButton'
        supportedLanguages:
          type: array
          items:
            type: string
        thankYouPages:
          type: array
          items:
            $ref: '#/components/schemas/ThankYouPage'
        title:
          type: string
        version:
          type: integer
        afterSubmissionSettings:
          $ref: '#/components/schemas/AfterSubmissionSettings'
        calculatorSettings:
          $ref: '#/components/schemas/CalculatorSettings'
        conversionCodes:
          $ref: '#/components/schemas/ConversionCodes'
        cover:
          $ref: '#/components/schemas/Cover'
        defaultLanguage:
          type: string
        directMessageSettings:
          $ref: '#/components/schemas/DirectMessageSettings'
        enableCustomMessage:
          type: boolean
        folderIds:
          type: array
          items:
            type: string
        googleMapApiKey:
          type: string
        importedFormId:
          type: string
        importedUserId:
          type: string
        isEnabledWhenDowngrade:
          type: boolean
        isImportUncomplated:
          type: boolean
        isStarred:
          type: boolean
        isSuspended:
          type: boolean
          nullable: true
        isSuspendedWhenDowngrade:
          type: boolean
        lastEdited:
          $ref: '#/components/schemas/LastEdited'
        locationSettings:
          $ref: '#/components/schemas/LocationSettings'
        metaData:
          $ref: '#/components/schemas/MetaData'
        pageSettings:
          $ref: '#/components/schemas/PageSettings'
        publishDateSettings:
          $ref: '#/components/schemas/DateActionSettings'
        unpublishDateSettings:
          $ref: '#/components/schemas/DateActionSettings'
        reportState:
          type: string
        thankYouPageSettings:
          $ref: '#/components/schemas/ThankYouPageSettings'
        timer:
          $ref: '#/components/schemas/Timer'
        trashDate:
          type: string
          format: date-time
        userInfo:
          type: object
        userLabelSetId:
          type: string
        welcomePageSettings:
          $ref: '#/components/schemas/WelcomePageSettings'
        withAI:
          type: boolean
    AnswerUserInfo:
      type: object
      properties:
        fullname:
          type: string
    QuestionAnswer:
      type: object
      properties:
        q:
          type: string
        t:
          type: string
        'n':
          type: number
        d:
          type: string
          format: date-time
        b:
          type: boolean
        c:
          type: array
          items:
            type: object
            properties:
              t:
                type: string
              v:
                type: string
              o:
                type: string
        fn:
          type: object
          properties:
            f:
              type: string
            l:
              type: string
            m:
              type: string
            p:
              type: string
            s:
              type: string
        a:
          type: object
          properties:
            a1:
              type: string
            a2:
              type: string
            c:
              type: string
            s:
              type: string
            p:
              type: string
            co:
              type: object
              properties:
                c:
                  type: string
                'n':
                  type: string
            l:
              type: object
              properties:
                lat:
                  type: number
                lng:
                  type: number
                z:
                  type: number
        p:
          type: object
          properties:
            c:
              type: string
            a:
              type: string
            p:
              type: string
            e:
              type: string
        f:
          type: array
          items:
            type: object
            properties:
              fid:
                type: string
              t:
                type: string
              s:
                type: number
        ti:
          type: object
          properties:
            h:
              type: number
            m:
              type: number
        pb:
          type: object
          properties:
            c:
              type: string
            t:
              type: number
            sf:
              type: number
            tx:
              type: object
              properties:
                a:
                  type: number
                t:
                  type: string
                r:
                  type: number
            d:
              type: object
              properties:
                a:
                  type: number
                c:
                  type: string
                t:
                  type: string
                v:
                  type: number
            p:
              type: array
              items:
                type: object
                properties:
                  pid:
                    type: string
                  'n':
                    type: string
                  ta:
                    type: array
                    items:
                      type: string
                  p:
                    type: number
                  u:
                    type: string
                  a:
                    type: number
                  t:
                    type: number
                  v:
                    type: array
                    items:
                      type: object
                      properties:
                        'n':
                          type: string
                        v:
                          type: string
        py:
          type: object
          properties:
            pid:
              type: string
            a:
              type: number
            c:
              type: string
            gw:
              type: string
            rc:
              type: string
            ct:
              type: array
              items:
                type: string
            b:
              type: object
              properties:
                'n':
                  type: string
                sn:
                  type: string
                e:
                  type: string
                i:
                  type: string
                a:
                  type: string
                ci:
                  type: string
                co:
                  type: string
        sm:
          type: array
          items:
            type: object
            properties:
              rid:
                type: string
              rn:
                type: string
              rt:
                type: string
              c:
                type: array
                items:
                  type: object
                  properties:
                    cid:
                      type: string
                    cn:
                      type: string
        g:
          type: array
          items:
            type: object
            properties:
              c:
                type: array
                items:
                  type: object
                  properties:
                    cid:
                      type: string
                    cn:
                      type: string
                    d:
                      type: string
                      format: date-time
                    'n':
                      type: number
                    t:
                      type: string
                    mt:
                      type: string
        dw:
          type: object
          properties:
            fid:
              type: string
        ac:
          type: string
    AnswerPoint:
      type: object
      properties:
        tp:
          type: number
        pl:
          type: array
          items:
            type: object
            properties:
              q:
                type: string
              p:
                type: number
              c:
                type: string
                enum:
                  - increase
                  - decrease
    Answer:
      type: object
      properties:
        answerFiles:
          type: array
          items: {}
        userInfo:
          $ref: '#/components/schemas/AnswerUserInfo'
        answers:
          type: array
          items:
            $ref: '#/components/schemas/QuestionAnswer'
        id:
          type: string
        point:
          $ref: '#/components/schemas/AnswerPoint'
        publicId:
          type: string
        createDate:
          type: string
          format: date-time
        _id:
          type: string
        fileToken:
          type: string
    AnswerPage:
      type: object
      properties:
        totalCount:
          type: integer
        result:
          type: array
          items:
            $ref: '#/components/schemas/Answer'
        searchAfter:
          type: array
          items:
            type: integer
  responses:
    BadRequest:
      description: >
        **400 Bad Request** — The request is malformed or contains invalid
        parameters.

        Check the `errors` array for details on which field or value is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWrapper'
    Unauthorized:
      description: >
        **401 Unauthorized** — The request is missing authentication, the
        provided token or

        API key is invalid / expired, or both authentication methods were
        supplied simultaneously.

        Ensure you are passing exactly one of `Authorization: Bearer <token>` or

        `X-Api-Key: <key>`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWrapper'
    TooManyRequests:
      description: >
        **429 Too Many Requests** — The rate limit for this API key or token has
        been exceeded.

        Back off and retry after a short delay. Avoid retrying in a tight loop.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWrapper'
    InternalServerError:
      description: >
        **500 Internal Server Error** — An unexpected error occurred on the
        server.

        This is not caused by the request itself. If the problem persists,
        contact support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWrapper'
    NotFound:
      description: >
        **404 Not Found** — The requested resource does not exist, or belongs to
        a different

        account and is not accessible with the current credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorWrapper'
