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

# Apply draft changes

> Atomically apply an ordered batch of changes to the configuration draft.



## OpenAPI

````yaml /openapi.yaml post /v1/configuration/changes
openapi: 3.1.0
info:
  version: 1.0.0
  contact:
    name: Zelinqa
    url: https://docs.zelinqa.ai
  license:
    name: Proprietary — Zelinqa SAS
    identifier: LicenseRef-Zelinqa-Proprietary
  x-contract-status: frozen
  x-jira: NBQ-304
  x-supersedes: openapi/nbq-runtime-v2.openapi.yaml
  x-compatibility-note: docs/api-compat-0.9-to-v1.md
  title: NBQ Engine — API V1
  summary: Public runtime and question-bank configuration contract.
  description: >-
    NBQ Engine's public V1 contract, served from https://api.zelinqa.ai. The
    server resolves the tenant, NBQ instance, and scopes from the API key. Never
    send trusted identity headers from the client. Mutations use
    Idempotency-Key, and existing-session mutations also use state_version.
servers:
  - url: https://api.zelinqa.ai
security:
  - ApiKeyAuth: []
tags:
  - name: sessions
    description: Create, advance, inspect, and close server-side NBQ conversations.
  - name: configuration
    description: Read, edit, audit, compile, and publish a question-bank configuration.
paths:
  /v1/configuration/changes:
    post:
      tags:
        - configuration
      summary: Apply draft changes
      description: Atomically apply an ordered batch of changes to the configuration draft.
      operationId: applyConfigurationChanges
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigurationChangesRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigurationChangesResponse'
          description: Successful response.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '409':
          $ref: '#/components/responses/IdempotencyConflict'
        '422':
          $ref: '#/components/responses/ConfigurationValidationFailed'
        '503':
          $ref: '#/components/responses/IdempotencyContention'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 8
        maxLength: 128
  schemas:
    ConfigurationChangesRequest:
      type: object
      additionalProperties: false
      required:
        - changes
      properties:
        expected_draft_revision:
          type: integer
          minimum: 0
        changes:
          type: array
          minItems: 1
          maxItems: 500
          items:
            $ref: '#/components/schemas/ConfigurationChange'
    ConfigurationChangesResponse:
      type: object
      additionalProperties: false
      required:
        - request_id
        - draft_revision
        - applied
        - warnings
      properties:
        request_id:
          type: string
        draft_revision:
          type: integer
          minimum: 0
        applied:
          type: integer
          minimum: 0
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/ConfigurationIssue'
    ConfigurationChange:
      oneOf:
        - $ref: '#/components/schemas/ObjectiveChange'
        - $ref: '#/components/schemas/SubObjectiveChange'
        - $ref: '#/components/schemas/SuccessInformationChange'
        - $ref: '#/components/schemas/QuestionChange'
      discriminator:
        propertyName: entity
        mapping:
          objective:
            $ref: '#/components/schemas/ObjectiveChange'
          sub_objective:
            $ref: '#/components/schemas/SubObjectiveChange'
          success_information:
            $ref: '#/components/schemas/SuccessInformationChange'
          question:
            $ref: '#/components/schemas/QuestionChange'
    ConfigurationIssue:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 100
        message:
          type: string
          minLength: 1
        entity:
          type: string
          enum:
            - objective
            - sub_objective
            - success_information
            - question
        entity_id:
          type: string
          maxLength: 128
        change_index:
          type: integer
          minimum: 0
    ErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - request_id
        - details
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          minLength: 1
        request_id:
          type: string
          minLength: 1
        details:
          type: object
          additionalProperties: true
    ObjectiveChange:
      type: object
      additionalProperties: false
      required:
        - entity
        - operation
        - objective
      properties:
        entity:
          type: string
          const: objective
        operation:
          type: string
          const: update
        objective:
          type: object
          additionalProperties: false
          minProperties: 1
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 200
            qualification_level:
              $ref: '#/components/schemas/QualificationLevel'
            max_turns:
              type: integer
              minimum: 1
              maximum: 100
            candidates_per_call:
              type: integer
              minimum: 1
              maximum: 10
            order_strength:
              type: number
              minimum: 0
              maximum: 1
    SubObjectiveChange:
      type: object
      additionalProperties: false
      required:
        - entity
        - operation
        - sub_objective
      properties:
        entity:
          type: string
          const: sub_objective
        operation:
          type: string
          enum:
            - create
            - update
            - delete
        sub_objective:
          type: object
          additionalProperties: false
          required:
            - id
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 128
            name:
              type: string
              minLength: 1
              maxLength: 200
            order_position:
              type: integer
              minimum: 0
            completion_role:
              $ref: '#/components/schemas/CompletionRole'
    SuccessInformationChange:
      type: object
      additionalProperties: false
      required:
        - entity
        - operation
        - success_information
      properties:
        entity:
          type: string
          const: success_information
        operation:
          type: string
          enum:
            - create
            - update
            - delete
        success_information:
          type: object
          additionalProperties: false
          required:
            - id
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 128
            label:
              type: string
              minLength: 1
              maxLength: 200
            schema:
              type: object
              additionalProperties: true
            primary_question_id:
              type: string
              minLength: 1
              maxLength: 128
    QuestionChange:
      type: object
      additionalProperties: false
      required:
        - entity
        - operation
        - question
      properties:
        entity:
          type: string
          const: question
        operation:
          type: string
          enum:
            - create
            - update
            - delete
        question:
          type: object
          additionalProperties: false
          required:
            - id
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 128
            text:
              type: string
              minLength: 1
              maxLength: 4000
            type:
              $ref: '#/components/schemas/QuestionType'
            choices:
              type: array
              maxItems: 50
              items:
                $ref: '#/components/schemas/ConfiguredChoice'
            sub_objective_id:
              type: string
              minLength: 1
              maxLength: 128
            active:
              type: boolean
    ErrorCode:
      type: string
      enum:
        - unauthorized
        - insufficient_scope
        - idempotency_contention
        - state_version_conflict
        - idempotency_key_reused
        - unknown_session
        - invalid_previous_turn
        - constraint_no_match
        - invalid_choice
        - compiled_artifact_unavailable
        - configuration_validation_failed
        - compilation_in_progress
        - unknown_configuration
        - unknown_compilation
    QualificationLevel:
      type: string
      enum:
        - essential
        - balanced
        - deep
    CompletionRole:
      type: string
      enum:
        - blocking
        - contributing
        - optional
    QuestionType:
      type: string
      enum:
        - open
        - single_choice
        - multiple_choice
        - semi_open
    ConfiguredChoice:
      type: object
      additionalProperties: false
      required:
        - id
        - label
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 128
        label:
          type: string
          minLength: 1
          maxLength: 500
        maps_to_value: {}
  responses:
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
      description: Unauthorized.
    InsufficientScope:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
      description: InsufficientScope.
    IdempotencyConflict:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
      description: IdempotencyConflict.
    ConfigurationValidationFailed:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
      description: ConfigurationValidationFailed.
    IdempotencyContention:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
      description: IdempotencyContention.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: NBQ API key

````