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

# Update a condition

> Update a condition. Send only the keys you want to change. When you send `conditions` or `actions`, it replaces the whole current value.

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace’s subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetoform.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/conditions.yaml PATCH /forms/{form_id}/conditions/{id}
openapi: 3.0.3
info:
  title: NeetoForm APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
paths:
  /forms/{form_id}/conditions/{id}:
    patch:
      tags:
        - Conditional logic
      summary: Update a condition
      description: >-
        Update a condition. Send only the keys you want to change. When you send
        `conditions` or `actions`, it replaces the whole current value.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/form_id_param'
        - $ref: '#/components/parameters/condition_id_param'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - condition
              properties:
                condition:
                  $ref: '#/components/schemas/condition_body'
      responses:
        '200':
          description: OK - The condition was updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/condition_response'
        '400':
          description: Bad Request - The `condition` key is missing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: 'param is missing or the value is empty: condition'
        '404':
          description: Not Found - The form or the condition does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: Condition does not exist.
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
    form_id_param:
      in: path
      name: form_id
      description: >-
        Unique ID of the form. Refer to [Getting the Form
        ID](/api/getting-form-id) for detailed instructions.
      required: true
      schema:
        type: string
    condition_id_param:
      in: path
      name: id
      description: Unique ID of the condition.
      required: true
      schema:
        type: string
  schemas:
    condition_body:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether the condition is on. Defaults to true.
        conditions:
          $ref: '#/components/schemas/condition_rules'
        actions:
          $ref: '#/components/schemas/condition_actions'
    condition_response:
      type: object
      properties:
        condition:
          $ref: '#/components/schemas/condition'
    error_response:
      type: object
      properties:
        error:
          type: string
    condition_rules:
      type: object
      description: The rules that must match for the actions to run.
      properties:
        join_type:
          type: string
          enum:
            - and
            - or
          description: Whether all items (`and`) or any item (`or`) must match.
          example: and
        items:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                description: ID of the question to check.
              verb:
                type: string
                description: >-
                  How to compare the answer. For example `is_answered`,
                  `is_not_answered`, `is_equal`, `is_not_equal`, `contains`,
                  `does_not_contain`, `is_less_than`, `is_greater_than`,
                  `is_less_than_or_equal_to`, `is_greater_than_or_equal_to`,
                  `is_before`, `is_after`, `is_agreed` or `is_not_agreed`.
                example: is_equal
              record:
                type: string
                description: >-
                  Use `custom_value` to compare with `value`, or give the ID of
                  another question to compare with its answer.
                example: custom_value
              value:
                type: string
                description: >-
                  The value to compare with. For choice questions, use the ID of
                  the option.
                example: 'Yes'
    condition_actions:
      type: object
      description: What happens when the rules match.
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              action_type:
                type: string
                description: >-
                  One of `show`, `hide`, `show_multiple`, `hide_multiple`,
                  `add`, `subtract`, `multiply`, `divide`, `assign`, `concat`,
                  `prepend` or `changeThankYouPage`.
                example: show_multiple
              fields:
                type: array
                description: IDs of the questions to show or hide.
                items:
                  type: string
              field:
                type: string
                description: ID of the question that gets the calculated value.
              value:
                type: string
                description: >-
                  ID of the question to use as the operand, `custom_value`, or
                  the ID of a thank you page.
              custom_value:
                type: string
                description: The value to use when `value` is `custom_value`.
    condition:
      type: object
      properties:
        id:
          type: string
          example: 7c1d2b0e-3f7a-4c55-9d2e-0b8e1f6a9c11
        enabled:
          type: boolean
        priority:
          type: integer
          description: >-
            Position in the order in which conditions are checked, starting from
            1.
        conditions:
          $ref: '#/components/schemas/condition_rules'
        actions:
          $ref: '#/components/schemas/condition_actions'
        created_at:
          $ref: '#/components/schemas/date_time_field'
        updated_at:
          $ref: '#/components/schemas/date_time_field'
    date_time_field:
      type: string
      format: date-time

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.