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

# Update a stimulus and its content

> Update a Stimulus on the service provider.



## OpenAPI

````yaml /openapi/beyond-ai/qti-api.yaml put /stimuli/{identifier}
openapi: 3.1.0
info:
  title: QTI API
  version: 1.0.0
  description: >-
    A robust assessment engine implementing the QTI 3.0 specification, designed
    for creating, managing, and delivering educational assessments.
servers:
  - url: https://qti.alpha-1edtech.ai/api
    description: Main Server
security:
  - OAuth2: []
  - MCP: []
tags:
  - name: Validation
    description: >-
      Validate XML strings against QTI compliant XSD files. XSD version
      supported is 3.0.0 (3p0)
  - name: Feedback
    description: Feedback for questions and lessons
  - name: Assessment Test Management
    description: >-
      Enables the management of Assessment Tests. Assessment Tests are the main
      entities that contain Assessment Test Parts, Sections, and Assessment
      Items.
  - name: Test Part Management
    description: >-
      Enables the management of Test Parts. Assessment Test Parts are used to
      group sections inside of an Assessment Test.
  - name: Section Management
    description: >-
      Enables the management of Sections. Assessment Sections are used to group
      Assessment Items.
  - name: Assessment Item Management
    description: >-
      Enables the management of Assessment ITems. Assessment Items are made up
      of QTI Interactions (e.g. questions, multiple choice, etc.).
  - name: Stimulus Management
    description: >-
      Enables the management of Stimuli. Stimuli are shared content pieces
      (text, images, audio, video) that provide context for assessment items and
      can be referenced by multiple questions.
paths:
  /stimuli/{identifier}:
    put:
      tags:
        - Stimulus Management
      summary: Update a stimulus and its content
      description: Update a Stimulus on the service provider.
      operationId: updateStimulus
      parameters:
        - name: identifier
          description: Stimulus identifier
          in: path
          required: true
          schema:
            type: string
      requestBody:
        description: The stimulus content to update.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Stimulus'
      responses:
        '200':
          description: Stimulus updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  identifier:
                    type: string
                    description: Unique identifier for the entity on the service provider.
                  title:
                    type: string
                    description: >-
                      Human-readable title of the entity on the service
                      provider.
                  catalogInfo:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            Catalog entry identifier (must be valid XML NCName).
                            The unique identifier used to locate the catalog
                            from a data-catalog-idref.
                        support:
                          type: string
                          description: >-
                            This attribute names either pre-defined supports or
                            a custom-named support. The named support will
                            indicate for whom the dormant content is intended.
                            Use only one card for any particular named support
                            in a catalog
                        content:
                          type: string
                          description: >-
                            A data structure within a catalog which contains
                            dormant HTML content or a resource reference for a
                            specific support/feature. A card may also contain
                            multiple CardEntry containers. For example, you
                            might have multiple CardEntry nodes for different
                            language versions of a particular support.
                      required:
                        - id
                        - support
                        - content
                    description: Array of catalog cards.
                  label:
                    type: string
                    description: >-
                      A human readable label that can be used to describe the
                      Stimulus.
                  language:
                    type: string
                    description: The default language for the Stimulus.
                    default: en
                  stylesheet:
                    type: object
                    properties:
                      href:
                        type: string
                        description: The identifier or location of the external stylesheet.
                      type:
                        type: string
                        description: The type of the external stylesheet.
                    required:
                      - href
                      - type
                    description: >-
                      The set of external style sheets that are associated with
                      the Stimulus. The order of definition is significant.
                  toolName:
                    type: string
                    description: >-
                      The tool name characteristic allows the tool creating the
                      stimulus to identify itself. Other processing systems may
                      use this information to interpret the content of
                      application specific data, such as labels on the elements
                      of the stimulus's stimulus body.
                  toolVersion:
                    type: string
                    description: >-
                      The tool version characteristic allows the tool creating
                      the item to identify its version. This value must only be
                      interpreted in the context of the tool-name.
                  metadata:
                    type: object
                    additionalProperties: {}
                    description: >-
                      Additional custom metadata for extending entity properties
                      beyond standard specification for QTI entities.
                  rawXml:
                    type: string
                    description: >-
                      Raw XML representation of the entity, automatically
                      generated from the JSON or XML sent when creating entities
                      on the service provider. The rawxml field will contain all
                      content sent when creating the entity on the service
                      provider. This field is stable and should be used when
                      working within this QTI API.
                  content:
                    type: object
                    properties:
                      qti-assessment-stimulus:
                        type: object
                        properties:
                          _attributes:
                            type: object
                            properties:
                              xmlns:
                                type: string
                              xmlns:xsi:
                                type: string
                              xsi:schemaLocation:
                                type: string
                              identifier:
                                type: string
                              xml:lang:
                                type: string
                              title:
                                type: string
                            required:
                              - xmlns
                              - xmlns:xsi
                              - xsi:schemaLocation
                              - identifier
                              - xml:lang
                              - title
                          qti-stimulus-body:
                            type: object
                            additionalProperties: true
                          qti-stylesheet:
                            type: object
                            properties:
                              _attributes:
                                type: object
                                properties:
                                  href:
                                    type: string
                                  type:
                                    type: string
                                required:
                                  - href
                                  - type
                            required:
                              - _attributes
                          qti-catalog-info:
                            type: object
                            properties:
                              qti-catalog:
                                type: object
                                properties:
                                  _attributes:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                    required:
                                      - id
                                  qti-card:
                                    type: object
                                    properties:
                                      _attributes:
                                        type: object
                                        properties:
                                          support:
                                            type: string
                                        required:
                                          - support
                                      qti-html-content:
                                        type: object
                                        additionalProperties: true
                                    required:
                                      - _attributes
                                      - qti-html-content
                                required:
                                  - _attributes
                                  - qti-card
                            required:
                              - qti-catalog
                        required:
                          - _attributes
                          - qti-stimulus-body
                    required:
                      - qti-assessment-stimulus
                    description: >-
                      Parsed XML content generated by the service provider. For
                      production use, rawXml is recommended over this parsed
                      structure.
                  createdAt:
                    type: string
                    format: date-time
                    description: ISO 8601 timestamp when the entity was created
                  updatedAt:
                    type: string
                    format: date-time
                    description: ISO 8601 timestamp when the entity was last updated
                  __v:
                    type: number
                    description: MongoDB version key for optimistic concurrency control
                required:
                  - identifier
                  - title
                  - catalogInfo
                  - rawXml
                  - content
                  - createdAt
                  - updatedAt
                description: >-
                  Complete stimulus data structure returned from the database
                  including parsed content and metadata
        '400':
          description: Invalid stimulus data
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: string
                required:
                  - error
        '404':
          description: Stimulus not found or Failed to update Stimulus
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error type identifier
                  message:
                    type: string
                    description: Human-readable error message
                  eventId:
                    type: string
                    description: Sentry event ID for error tracking
                  details:
                    type: string
                    description: Stack trace or additional error details
                required:
                  - error
                  - message
                  - details
                description: Internal server error response
components:
  schemas:
    Stimulus:
      type: object
      properties:
        identifier:
          type: string
          description: Unique identifier for the entity on the service provider.
        title:
          type: string
          description: Human-readable title of the entity on the service provider.
        label:
          type: string
          description: A human readable label that can be used to describe the Stimulus.
        language:
          type: string
          description: The default language for the Stimulus.
          default: en
        stylesheet:
          type: object
          properties:
            href:
              type: string
              description: The identifier or location of the external stylesheet.
            type:
              type: string
              description: The type of the external stylesheet.
          required:
            - href
            - type
          description: >-
            The set of external style sheets that are associated with the
            Stimulus. The order of definition is significant.
        content:
          type: string
          description: >-
            HTML content of the stimulus provided as a string when creating or
            updating a stimulus. When the rawXml is generated, this content is
            used to create teh qti-stimulus-body that lives on the xml.
        catalogInfo:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: >-
                  Catalog entry identifier (must be valid XML NCName). The
                  unique identifier used to locate the catalog from a
                  data-catalog-idref.
              support:
                type: string
                description: >-
                  This attribute names either pre-defined supports or a
                  custom-named support. The named support will indicate for whom
                  the dormant content is intended. Use only one card for any
                  particular named support in a catalog
              content:
                type: string
                description: >-
                  A data structure within a catalog which contains dormant HTML
                  content or a resource reference for a specific
                  support/feature. A card may also contain multiple CardEntry
                  containers. For example, you might have multiple CardEntry
                  nodes for different language versions of a particular support.
            required:
              - id
              - support
              - content
          description: Array of catalog cards.
        toolName:
          type: string
          description: >-
            The tool name characteristic allows the tool creating the stimulus
            to identify itself. Other processing systems may use this
            information to interpret the content of application specific data,
            such as labels on the elements of the stimulus's stimulus body.
        toolVersion:
          type: string
          description: >-
            The tool version characteristic allows the tool creating the item to
            identify its version. This value must only be interpreted in the
            context of the tool-name.
        metadata:
          type: object
          additionalProperties: {}
          description: >-
            Additional custom metadata for extending entity properties beyond
            standard specification for QTI entities.
      required:
        - identifier
        - title
        - content
      description: >-
        Create or update a stimulus on the service provider with HTML content
        and optional configuration
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        clientCredentials:
          scopes:
            https://purl.imsglobal.org/spec/qti/v3/scope/readonly: Read access to QTI
            https://purl.imsglobal.org/spec/qti/v3/scope/createput: Create and update access to QTI
            https://purl.imsglobal.org/spec/qti/v3/scope/delete: Delete access to QTI
          tokenUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token
    MCP:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/authorize
          tokenUrl: >-
            https://prod-beyond-timeback-api-2-idp.auth.us-east-1.amazoncognito.com/oauth2/token
          scopes:
            https://purl.imsglobal.org/spec/qti/v3/scope/readonly: Read access to QTI

````