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

# Edit a qualification library question

> Updates a library question's wording, options, requiredness, or condition. Omitted fields are unchanged; the bound fact and control are fixed at creation (delete and recreate to change them).



## OpenAPI

````yaml /openapi/public-openapi.json patch /v1/account/question-library/questions/{question_id}
openapi: 3.1.0
info:
  title: Purple API
  version: 0.0.0
servers:
  - url: https://api.dev.purplelabelmd.com
security: []
tags:
  - description: Sign a patient in and out and manage the browser session.
    name: Sessions & authentication
  - description: Run the server-driven intake questionnaire question by question.
    name: Intake
  - description: Address autocomplete for the intake flow.
    name: Addresses
  - description: Read the public status of a patient's enrollment.
    name: Enrollment
  - description: Track a client's onboarding progress.
    name: Onboarding
  - description: Read back the platform configuration stored for your brand.
    name: Brand configuration
  - description: Enable offerings for your brand and set their display copy.
    name: Offering configuration
  - description: Start and track payments for an order.
    name: Payments
  - description: Subscribe to platform events and manage delivery endpoints.
    name: Webhooks
paths:
  /v1/account/question-library/questions/{question_id}:
    patch:
      tags:
        - Offering configuration
      summary: Edit a qualification library question
      description: >-
        Updates a library question's wording, options, requiredness, or
        condition. Omitted fields are unchanged; the bound fact and control are
        fixed at creation (delete and recreate to change them).
      operationId: updateQualificationLibraryQuestion
      parameters:
        - in: path
          name: question_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualificationQuestionUpdate'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualificationQuestionResult'
          description: the updated library question
        '400':
          $ref: '#/components/responses/OverlayBadRequest'
        '404':
          $ref: '#/components/responses/OverlayNotFound'
        '422':
          $ref: '#/components/responses/OverlayUnprocessable'
        '503':
          $ref: '#/components/responses/OverlayStoreUnavailable'
      security:
        - apiKey: []
components:
  schemas:
    QualificationQuestionUpdate:
      description: >-
        edit body for an existing qualification question — every field optional;
        omitted fields are unchanged. The bound fact and control are fixed at
        creation (delete and recreate to change them).
      properties:
        copy:
          additionalProperties:
            type: string
          description: >-
            replacement display copy (the question wording rides the `prompt`
            slot)
          type: object
        option_labels:
          additionalProperties:
            type: string
          type: object
        options:
          items:
            type: string
          type: array
        required:
          type: boolean
        when:
          allOf:
            - $ref: '#/components/schemas/QualificationCondition'
          description: replace the serve condition (omitted means unchanged)
      type: object
    QualificationQuestionResult:
      description: >-
        the saved question under `data`, plus non-blocking duplicate notices
        when another question already collects the same fact (the write still
        succeeds — warnings never block)
      properties:
        data:
          $ref: '#/components/schemas/QualificationOverlayQuestion'
        warnings:
          items:
            properties:
              code:
                enum:
                  - DUPLICATE_FACT
                type: string
              fact:
                type: string
              message:
                type: string
            required:
              - code
              - fact
              - message
            type: object
          type: array
      required:
        - data
      type: object
    QualificationCondition:
      additionalProperties: true
      description: >-
        A condition on a screening question, built from your own earlier
        screening answers. It compares an earlier answer to a value, or combines
        such comparisons, in the same rule language the platform uses to serve
        questions. The question is shown only when the condition holds.
      properties:
        kind:
          description: >-
            the kind of condition node (comparison, presence check, boolean
            combination, or if/else)
          enum:
            - compare
            - 'null'
            - bool
            - cond
          type: string
      required:
        - kind
      type: object
    QualificationOverlayQuestion:
      description: >-
        A client-authored screening question — a library definition or an
        offering-local copy. It binds a fact by its stable code (the code must
        resolve in your authoring fact catalog) and a display control, and
        carries your own wording. Copy and option labels are yours to author.
      properties:
        control:
          enum:
            - single_select_cards
            - multi_select_cards
            - scale
            - number
            - number_pair
            - date
            - text
            - long_text
            - file_capture
            - address
            - phone
            - email
            - search_select
          type: string
        copy:
          additionalProperties:
            type: string
          description: your display copy (the question prompt rides the `prompt` slot)
          type: object
        fact:
          description: >-
            the stable code of the catalog fact this question collects (must
            resolve)
          type: string
        id:
          type: string
        option_labels:
          additionalProperties:
            type: string
          description: >-
            your per-option labels, keyed by option code (labels never bind
            logic)
          type: object
        options:
          description: >-
            stable option codes offered as answers — a subset of the bound
            fact's own codes
          items:
            type: string
          type: array
        required:
          type: boolean
        when:
          allOf:
            - $ref: '#/components/schemas/QualificationCondition'
          description: >-
            an optional condition — show this question only when an earlier
            screening answer calls for it (for example, ask "how long have you
            used one?" only after "have you used one?" is yes). A condition may
            use only facts collected by questions shown EARLIER in this
            offering; never a medical-intake answer or another brand's fact.
            When the condition is not met the question is skipped; with no
            condition the question is always shown. Accepted and validated at
            authoring now; conditional serving activates in a coming release
            (see the changelog).
      required:
        - id
        - fact
        - control
      type: object
    CompileProblem:
      description: RFC 7807 problem, extended with the structured compile issue list
      properties:
        issues:
          items:
            properties:
              code:
                type: string
              message:
                type: string
              where:
                type: string
            required:
              - code
              - where
              - message
            type: object
          type: array
        status:
          type: integer
        title:
          type: string
      required:
        - title
        - status
      type: object
  responses:
    OverlayBadRequest:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CompileProblem'
      description: missing or invalid parameters
    OverlayNotFound:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CompileProblem'
      description: >-
        no shared clinical bundle for that (therapy|offering, mode), or no such
        resource
    OverlayUnprocessable:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CompileProblem'
      description: validation failed — the declare-a-fact wall or the compile bar (422)
    OverlayStoreUnavailable:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/CompileProblem'
      description: >-
        the durable question store did not answer — nothing was written or
        changed; safe to retry once the store recovers
  securitySchemes:
    apiKey:
      description: 'Per-client API key (M2M). Presented as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http

````