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

# Create form

> Creates a new form with multilingual text fields, sections, and fields. Keys inside multilingual objects must be valid language codes configured in your system (e.g., "en", "fa", ...).



## OpenAPI

````yaml /api-reference/ai-cms/openapi.json post /forms/create
openapi: 3.1.0
info:
  title: Blog API
  version: 1.0.0
servers:
  - url: https://api.octaviatech.app/cms
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Tags
    description: Tag management endpoints
paths:
  /forms/create:
    post:
      tags:
        - Forms
      summary: Create form
      description: >-
        Creates a new form with multilingual text fields, sections, and fields.
        Keys inside multilingual objects must be valid language codes configured
        in your system (e.g., "en", "fa", ...).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - title
                - slug
                - sections
              properties:
                title:
                  type: object
                  description: Map of language code → string (at least one entry required).
                  additionalProperties:
                    type: string
                slug:
                  type: string
                  description: >-
                    URL-friendly, unique per tenant. Must satisfy the service’s
                    slug rules (lowercase, digits, hyphens; no spaces).
                description:
                  type: object
                  description: Multilingual description (language code → string).
                  additionalProperties:
                    type: string
                submitButtonText:
                  type: object
                  description: Multilingual submit button label (language code → string).
                  additionalProperties:
                    type: string
                sections:
                  type: array
                  minItems: 1
                  description: Ordered list of sections; each section contains fields.
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - title
                      - fields
                    properties:
                      title:
                        type: object
                        description: Multilingual section title (language code → string).
                        additionalProperties:
                          type: string
                      icon:
                        type: string
                        description: Optional icon identifier/name.
                      description:
                        type: object
                        description: >-
                          Multilingual section description (language code →
                          string).
                        additionalProperties:
                          type: string
                      fields:
                        type: array
                        minItems: 1
                        description: >-
                          Section fields; each field defines label, type,
                          options, etc.
                        items:
                          type: object
                          additionalProperties: false
                          required:
                            - name
                            - type
                            - label
                            - required
                          properties:
                            name:
                              type: string
                              description: >-
                                Unique field key within the form; used as the
                                key in submissions.
                            type:
                              type: string
                              description: >-
                                Field input type. Validation is enforced per
                                type in the service.

                                Supported validations:

                                - "email": valid email

                                - "tel": international phone pattern

                                - "number": numeric value

                                - "checkbox"/"switch": boolean

                                - "multi-checkbox"/"multi-select": array of
                                values

                                - "select": one of options[].value

                                Other types (for example "text", "textarea",
                                "date") are accepted without extra format
                                checks.
                            label:
                              type: object
                              description: Multilingual label (language code → string).
                              additionalProperties:
                                type: string
                            required:
                              type: boolean
                              description: >-
                                Whether the field is required at submission
                                time.
                            options:
                              type: array
                              description: >-
                                Required for selection-type fields.

                                For "select": submitted value must match one of
                                these .value entries.

                                For "multi-select" and "multi-checkbox":
                                submitted values must be a subset.
                              items:
                                type: object
                                additionalProperties: false
                                required:
                                  - value
                                  - label
                                properties:
                                  value:
                                    type: string
                                  label:
                                    type: object
                                    description: >-
                                      Multilingual option label (language code →
                                      string).
                                    additionalProperties:
                                      type: string
                            colSpan:
                              type: number
                              description: Optional layout hint (grid column span).
                            icon:
                              type: string
                              description: Optional icon identifier/name for the field.
                            disabled:
                              type: boolean
                              description: If true, the field is ignored on submission.
                            verified:
                              type: boolean
                              description: Reserved flag for additional workflows.
                            defaultValue: {}
                            placeholder:
                              type: object
                              description: >-
                                Multilingual placeholder (language code →
                                string).
                              additionalProperties:
                                type: string
                            relation:
                              type: object
                              description: >-
                                Optional relation from this field to submissions
                                of another form.
                              additionalProperties: false
                              required:
                                - relatedFormId
                                - relationType
                              properties:
                                relatedFormId:
                                  type: string
                                  description: >-
                                    24-char hex id of the related form whose
                                    submissions are referenced.
                                  pattern: ^[a-fA-F0-9]{24}$
                                relationType:
                                  type: string
                                  enum:
                                    - one-to-one
                                    - many-to-one
                                    - one-to-many
                                    - many-to-many
                                  description: >-
                                    Controls single-value vs multi-value
                                    submission shape and uniqueness behavior.
                isActive:
                  type: boolean
                  description: Whether the form is enabled (default true).
                formType:
                  type: string
                  enum:
                    - public
                    - internal
                  description: >-
                    Whether the form is reachable on the public submit route.
                    Defaults to "public"; "internal" forms are only submittable
                    through `/forms/{id}/internal-submit`.
                captcha:
                  type: object
                  description: >-
                    Per-form CAPTCHA gate. `enabled` defaults to false.

                    `provider` defaults to the service-wide
                    `CAPTCHA_PROVIDER_DEFAULT` (falling back to "recaptcha").

                    `minScore` (0–1) applies to providers that return a score.
                  additionalProperties: false
                  properties:
                    enabled:
                      type: boolean
                      description: Require a `captchaToken` on submissions. Default false.
                    provider:
                      type: string
                      enum:
                        - recaptcha
                        - hcaptcha
                        - turnstile
                      description: >-
                        CAPTCHA provider. Optional; a default is used when
                        omitted.
                    minScore:
                      type: number
                      description: Minimum accepted CAPTCHA score (0–1).
                notification:
                  type: object
                  description: >-
                    Optional submission notifications. `enabled` defaults to
                    false.

                    `email` and `push` each take `admin` and `submitter`
                    sub-objects whose

                    `enabled` flags default to false. Notifications are
                    fire-and-forget and never

                    block or fail the HTTP response.
                  additionalProperties: false
                  properties:
                    enabled:
                      type: boolean
                      description: Master switch for notifications. Default false.
                    email:
                      type: object
                      additionalProperties: false
                      properties:
                        admin:
                          type: object
                          additionalProperties: false
                          properties:
                            enabled:
                              type: boolean
                              description: Notify administrators. Default false.
                            recipients:
                              type: array
                              items:
                                type: string
                              description: Recipient email addresses. Default [].
                            templateKey:
                              type: string
                              description: >-
                                Mail template key. Defaults to
                                "form_submission_admin".
                            locale:
                              type: string
                              description: >-
                                Mail locale. Defaults to the submission
                                language, then "fa".
                            includeFields:
                              type: array
                              items:
                                type: string
                              description: Field names to include. Default [].
                        submitter:
                          type: object
                          additionalProperties: false
                          properties:
                            enabled:
                              type: boolean
                              description: Notify the submitter. Default false.
                            recipientFieldName:
                              type: string
                              description: >-
                                Name of the field holding the submitter's email
                                address.
                            templateKey:
                              type: string
                              description: Mail template key.
                            locale:
                              type: string
                              description: >-
                                Mail locale. Defaults to the submission
                                language, then "fa".
                            includeFields:
                              type: array
                              items:
                                type: string
                              description: Field names to include. Default [].
                    push:
                      type: object
                      additionalProperties: false
                      properties:
                        admin:
                          type: object
                          additionalProperties: false
                          properties:
                            enabled:
                              type: boolean
                              description: Push admins. Default false.
                            userIds:
                              type: array
                              items:
                                type: string
                              description: User ids to notify. Default [].
                            templateKey:
                              type: string
                              description: Push template key.
                            locale:
                              type: string
                              description: Push locale.
                            includeFields:
                              type: array
                              items:
                                type: string
                              description: Field names to include. Default [].
                        submitter:
                          type: object
                          additionalProperties: false
                          properties:
                            enabled:
                              type: boolean
                              description: Push the submitter's device. Default false.
                            userIdFieldName:
                              type: string
                              description: >-
                                Name of the field holding the submitter's user
                                id.
                            templateKey:
                              type: string
                              description: Push template key.
                            locale:
                              type: string
                              description: Push locale.
                            includeFields:
                              type: array
                              items:
                                type: string
                              description: Field names to include. Default [].
                relation:
                  type: object
                  description: Optional relation to other forms for multi-step flows.
                  additionalProperties: false
                  properties:
                    parentFormId:
                      type: string
                      description: 24-char hex id of the parent form.
                      pattern: ^[a-fA-F0-9]{24}$
                    nextFormId:
                      type: string
                      description: 24-char hex id of the next form.
                      pattern: ^[a-fA-F0-9]{24}$
            examples:
              Create Form:
                value:
                  title:
                    en: Contact Us
                    fa: Contact Us
                  slug: contact-us
                  description:
                    en: Public contact form
                  submitButtonText:
                    en: Send
                  sections:
                    - title:
                        en: Basic Info
                      fields:
                        - name: fullName
                          type: text
                          label:
                            en: Full Name
                          required: true
                        - name: email
                          type: email
                          label:
                            en: Email
                          required: true
                        - name: message
                          type: textarea
                          label:
                            en: Message
                          required: true
                  isActive: true
      responses:
        '201':
          description: Created
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: Conflict (slug already exists within the tenant)
        '500':
          description: >-
            Server error, including Joi validation failures — the command
            signals those with code 406, which is not a whitelisted response
            code and is normalized to 500
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````