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

# Reorder conditional fields

> Replace the ordering of conditional fields within a section. The `order` array must list every field id currently in scope; the new index is the position in the array.



## OpenAPI

````yaml /api-reference/openapi.yaml post /api/organizations/{organizationId}/conditional-fields/reorder
openapi: 3.0.3
info:
  title: Tether Relay and Tether API
  version: 1.0.0
  description: >-
    Route-derived OpenAPI contract generated from tether-relay backend sources.
    Regenerate with scripts/sync-openapi-from-backend.mjs.
servers:
  - url: https://your-instance.example.com
    description: Production
  - url: http://localhost:2212
    description: Local API service
security: []
tags:
  - name: AI
  - name: Applications
  - name: Approval
  - name: Auth
  - name: Automations
  - name: Calls
  - name: Campaigns
  - name: Contact Analytics
  - name: Contact Metrics
  - name: Contact Notes
  - name: Contacts
  - name: Conversation Monitor
  - name: Conversations
  - name: Departments
  - name: Email
  - name: Escalation Dashboard
  - name: Event Logs
  - name: Google Sheets
  - name: Marketplace
  - name: Messages
  - name: Notification Sounds
  - name: Notifications
  - name: Org Snapshots
  - name: Organizations
  - name: Outreach
  - name: Outreach Metrics
  - name: Outreach Sources
  - name: Pipelines
  - name: Processes
  - name: Prompts
  - name: Reminders
  - name: Sms
  - name: Templates
  - name: Traces
  - name: Training
  - name: Upload
  - name: User Snapshots
  - name: Users
  - name: Vertical
  - name: Webchats
  - name: Webhook
paths:
  /api/organizations/{organizationId}/conditional-fields/reorder:
    post:
      tags:
        - ConditionalFields
      summary: Reorder conditional fields
      description: >-
        Replace the ordering of conditional fields within a section. The `order`
        array must list every field id currently in scope; the new index is the
        position in the array.
      operationId: post_reorder_conditional_fields
      parameters:
        - in: path
          name: organizationId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReorderConditionalFieldsRequest'
      responses:
        '200':
          description: Fields reordered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionalFieldListResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionalFieldErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConditionalFieldErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ReorderConditionalFieldsRequest:
      type: object
      properties:
        order:
          type: array
          items:
            type: string
          description: Field `_id`s in their target display order.
        type:
          type: string
          description: Top-level scope being reordered (e.g. `contact`, `application`).
        sectionType:
          type: string
          description: Section where the reorder applies (`contact`, `application`, etc.).
      required:
        - order
      additionalProperties: true
      example:
        order:
          - 66d0a0b0c0d0e0f0a0b0c0d0
          - 66d0a0b0c0d0e0f0a0b0c0d1
        type: contact
        sectionType: identity
    ConditionalFieldListResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
      example:
        data:
          - _id: 66d0a0b0c0d0e0f0a0b0c0d0
            name: Eligibility flag
            sectionId: contact.identity
            expression: contact.age >= 18 && contact.country == "US"
            status: active
            outputType: boolean
    ConditionalFieldErrorResponse:
      type: object
      description: >-
        Error envelope returned by conditional-field endpoints. Mirrors
        `handleError` in the controller: `error` carries the human-readable
        message and `diagnostics` is set on validation failures.
      properties:
        error:
          type: string
        diagnostics:
          type: object
          additionalProperties: true
      required:
        - error
      additionalProperties: true
      example:
        error: Expression validation failed
        diagnostics:
          issues:
            - message: Unknown field `contact.country2`
              line: 1
              column: 22
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````