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

# Insert Block



## OpenAPI

````yaml put /forms/form/{form_id}/insert-block
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /forms/form/{form_id}/insert-block:
    put:
      tags:
        - provider
        - forms
      summary: Insert Block
      operationId: insert_block_forms_form__form_id__insert_block_put
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: form_id
          in: path
          required: true
          schema:
            type: string
            title: Form Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BlockDetail-Input'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FormDetail-Output'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BlockDetail-Input:
      properties:
        id:
          type: string
          title: Id
        formId:
          type: string
          title: Formid
        position:
          type: integer
          title: Position
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        blockType:
          $ref: '#/components/schemas/BlockType'
        name:
          type: string
          title: Name
        questions:
          items:
            $ref: >-
              #/components/schemas/QuestionDetail_Union_Address__Date__Text__SingleSelect__MultiSelect__Toggle__Signature__FileUpload__PaymentMethod__Tag__Disclaimer__Statement__Document__Number__CalculatedScore__-Input
          type: array
          title: Questions
          default: []
        isArchived:
          type: boolean
          title: Isarchived
          default: false
      type: object
      required:
        - id
        - formId
        - position
        - blockType
        - name
      title: BlockDetail
    FormDetail-Output:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        pathName:
          type: string
          title: Pathname
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        blocks:
          items:
            $ref: '#/components/schemas/BlockDetail-Output'
          type: array
          title: Blocks
          default: []
      type: object
      required:
        - id
        - name
        - pathName
      title: FormDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BlockType:
      type: string
      enum:
        - DYNAMIC
        - DEMOGRAPHICS
        - INSURANCE
        - PAYMENT_METHODS
        - MEDICAL_HISTORY
      title: BlockType
    QuestionDetail_Union_Address__Date__Text__SingleSelect__MultiSelect__Toggle__Signature__FileUpload__PaymentMethod__Tag__Disclaimer__Statement__Document__Number__CalculatedScore__-Input:
      properties:
        id:
          type: string
          title: Id
        blockId:
          type: string
          title: Blockid
        formId:
          type: string
          title: Formid
        position:
          type: integer
          title: Position
        questionType:
          $ref: '#/components/schemas/QuestionType'
        required:
          type: boolean
          title: Required
        isArchived:
          type: boolean
          title: Isarchived
          default: false
        mappingKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Mappingkey
        data:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - $ref: '#/components/schemas/Date-Input'
            - $ref: '#/components/schemas/Text'
            - $ref: '#/components/schemas/SingleSelect'
            - $ref: '#/components/schemas/MultiSelect'
            - $ref: '#/components/schemas/Toggle'
            - $ref: '#/components/schemas/Signature'
            - $ref: '#/components/schemas/FileUpload'
            - $ref: '#/components/schemas/PaymentMethod'
            - $ref: '#/components/schemas/Tag'
            - $ref: '#/components/schemas/Disclaimer'
            - $ref: '#/components/schemas/Statement'
            - $ref: '#/components/schemas/Document'
            - $ref: '#/components/schemas/Number'
            - $ref: '#/components/schemas/CalculatedScore'
          title: Data
        conditions:
          items:
            $ref: '#/components/schemas/QuestionConditionDetail'
          type: array
          title: Conditions
          default: []
      type: object
      required:
        - id
        - blockId
        - formId
        - position
        - questionType
        - required
        - data
      title: >-
        QuestionDetail[Union[Address, Date, Text, SingleSelect, MultiSelect,
        Toggle, Signature, FileUpload, PaymentMethod, Tag, Disclaimer,
        Statement, Document, Number, CalculatedScore]]
    BlockDetail-Output:
      properties:
        id:
          type: string
          title: Id
        formId:
          type: string
          title: Formid
        position:
          type: integer
          title: Position
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        blockType:
          $ref: '#/components/schemas/BlockType'
        name:
          type: string
          title: Name
        questions:
          items:
            $ref: >-
              #/components/schemas/QuestionDetail_Union_Address__Date__Text__SingleSelect__MultiSelect__Toggle__Signature__FileUpload__PaymentMethod__Tag__Disclaimer__Statement__Document__Number__CalculatedScore__-Output
          type: array
          title: Questions
          default: []
        isArchived:
          type: boolean
          title: Isarchived
          default: false
      type: object
      required:
        - id
        - formId
        - position
        - blockType
        - name
      title: BlockDetail
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    QuestionType:
      type: string
      enum:
        - ADDRESS
        - DATE
        - TEXT
        - NUMBER
        - TEXT_AREA
        - SINGLE_SELECT
        - RADIAL_SINGLE_SELECT
        - MULTI_SELECT
        - RADIAL_MULTI_SELECT
        - TOGGLE
        - SIGNATURE
        - FILE_UPLOAD
        - PHONE_NUMBER
        - EMAIL
        - PAYMENT_METHOD
        - TAG
        - DISCLAIMER
        - STATEMENT
        - DOCUMENT
        - FEET_INCHES_HEIGHT
        - POUNDS_WEIGHT
        - CALCULATED_SCORE
      title: QuestionType
    Address:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
      title: Address
    Date-Input:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        minDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Mindate
        maxDate:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Maxdate
        minTimeAgo:
          anyOf:
            - $ref: '#/components/schemas/RelativeDate'
            - type: 'null'
      type: object
      required:
        - name
      title: Date
    Text:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        placeholder:
          type: string
          title: Placeholder
      type: object
      required:
        - name
        - placeholder
      title: Text
    SingleSelect:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        options:
          items:
            type: string
          type: array
          title: Options
      type: object
      required:
        - name
        - options
      title: SingleSelect
    MultiSelect:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        options:
          items:
            type: string
          type: array
          title: Options
        maxSelections:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maxselections
        minSelections:
          anyOf:
            - type: integer
            - type: 'null'
          title: Minselections
      type: object
      required:
        - name
        - options
      title: MultiSelect
    Toggle:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
      title: Toggle
    Signature:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        text:
          anyOf:
            - type: string
            - type: 'null'
          title: Text
      type: object
      required:
        - name
      title: Signature
    FileUpload:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        allowedFileTypes:
          type: string
          title: Allowedfiletypes
        maxFileSize:
          type: integer
          title: Maxfilesize
        maxFileCount:
          type: integer
          title: Maxfilecount
      type: object
      required:
        - name
        - allowedFileTypes
        - maxFileSize
        - maxFileCount
      title: FileUpload
    PaymentMethod:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
      title: PaymentMethod
    Tag:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        placeholder:
          type: string
          title: Placeholder
        allowedTags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowedtags
      type: object
      required:
        - name
        - placeholder
      title: Tag
    Disclaimer:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        content:
          type: string
          title: Content
      type: object
      required:
        - name
        - content
      title: Disclaimer
    Statement:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        points:
          items:
            type: string
          type: array
          title: Points
      type: object
      required:
        - name
        - points
      title: Statement
    Document:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        docs:
          items:
            $ref: '#/components/schemas/DocumentDetails'
          type: array
          title: Docs
      type: object
      required:
        - name
        - docs
      title: Document
    Number:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        placeholder:
          type: string
          title: Placeholder
      type: object
      required:
        - name
        - placeholder
      title: Number
    CalculatedScore:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        displayFormat:
          type: string
          title: Displayformat
          default: 'Score: {value}'
        calculationType:
          type: string
          title: Calculationtype
          default: SUM
      type: object
      required:
        - name
      title: CalculatedScore
    QuestionConditionDetail:
      properties:
        id:
          type: string
          title: Id
        questionId:
          type: string
          title: Questionid
        dependentQuestionId:
          type: string
          title: Dependentquestionid
        operator:
          $ref: '#/components/schemas/ConditionOperator'
        value:
          type: string
          title: Value
        groupId:
          anyOf:
            - type: string
            - type: 'null'
          title: Groupid
      type: object
      required:
        - id
        - questionId
        - dependentQuestionId
        - operator
        - value
      title: QuestionConditionDetail
    QuestionDetail_Union_Address__Date__Text__SingleSelect__MultiSelect__Toggle__Signature__FileUpload__PaymentMethod__Tag__Disclaimer__Statement__Document__Number__CalculatedScore__-Output:
      properties:
        id:
          type: string
          title: Id
        blockId:
          type: string
          title: Blockid
        formId:
          type: string
          title: Formid
        position:
          type: integer
          title: Position
        questionType:
          $ref: '#/components/schemas/QuestionType'
        required:
          type: boolean
          title: Required
        isArchived:
          type: boolean
          title: Isarchived
          default: false
        mappingKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Mappingkey
        data:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - $ref: '#/components/schemas/Date-Output'
            - $ref: '#/components/schemas/Text'
            - $ref: '#/components/schemas/SingleSelect'
            - $ref: '#/components/schemas/MultiSelect'
            - $ref: '#/components/schemas/Toggle'
            - $ref: '#/components/schemas/Signature'
            - $ref: '#/components/schemas/FileUpload'
            - $ref: '#/components/schemas/PaymentMethod'
            - $ref: '#/components/schemas/Tag'
            - $ref: '#/components/schemas/Disclaimer'
            - $ref: '#/components/schemas/Statement'
            - $ref: '#/components/schemas/Document'
            - $ref: '#/components/schemas/Number'
            - $ref: '#/components/schemas/CalculatedScore'
          title: Data
        conditions:
          items:
            $ref: '#/components/schemas/QuestionConditionDetail'
          type: array
          title: Conditions
          default: []
      type: object
      required:
        - id
        - blockId
        - formId
        - position
        - questionType
        - required
        - data
      title: >-
        QuestionDetail[Union[Address, Date, Text, SingleSelect, MultiSelect,
        Toggle, Signature, FileUpload, PaymentMethod, Tag, Disclaimer,
        Statement, Document, Number, CalculatedScore]]
    RelativeDate:
      properties:
        years:
          anyOf:
            - type: integer
            - type: 'null'
          title: Years
        months:
          anyOf:
            - type: integer
            - type: 'null'
          title: Months
        days:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days
      type: object
      title: RelativeDate
    DocumentDetails:
      properties:
        name:
          type: string
          title: Name
        path:
          type: string
          title: Path
      type: object
      required:
        - name
        - path
      title: DocumentDetails
    ConditionOperator:
      type: string
      enum:
        - EQUALS
        - NOT_EQUALS
        - CONTAINS
        - YEARS_AGO_MINIMUM
        - YEARS_AGO_MAXIMUM
        - SUM
      title: ConditionOperator
    Date-Output:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        minDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Mindate
        maxDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Maxdate
        minTimeAgo:
          anyOf:
            - $ref: '#/components/schemas/RelativeDate'
            - type: 'null'
      type: object
      required:
        - name
      title: Date

````