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

# Update component



## OpenAPI

````yaml /openapi-components.json patch /api/v1/components/{id}
openapi: 3.0.0
info:
  title: StudyFetch API
  description: API documentation for StudyFetch
  version: '1.0'
  contact: {}
servers:
  - url: https://studyfetchapi.com
    description: Production API Server
security: []
tags: []
paths:
  /api/v1/components/{id}:
    patch:
      tags:
        - Components
      summary: Update component
      operationId: update
      parameters:
        - name: id
          required: true
          in: path
          description: Component ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateComponentDto'
      responses:
        '200':
          description: Component updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComponentResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    UpdateComponentDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - draft
            - active
            - inactive
            - processing
            - error
          description: Component status
    ComponentResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Component ID (MongoDB ObjectId)
        componentId:
          type: string
          description: Unique component identifier
        type:
          type: string
          description: Component type
          enum:
            - chat
            - data_analyst
            - flashcards
            - scenarios
            - practice_test
            - audio_recap
            - tutor_me
            - explainers
            - uploads
            - chat_analytics
        name:
          type: string
          description: Component name
        description:
          type: string
          description: Component description
        organization:
          type: string
          description: Organization ID
        config:
          type: object
          description: Component configuration
        status:
          type: string
          description: Component status
          enum:
            - active
            - inactive
            - draft
        usage:
          type: object
          description: Usage statistics
        createdAt:
          format: date-time
          type: string
          description: Creation timestamp
        updatedAt:
          format: date-time
          type: string
          description: Last update timestamp
      required:
        - _id
        - componentId
        - type
        - name
        - organization
        - config
        - status
        - usage
        - createdAt
        - updatedAt
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API Key for server-to-server authentication. Resolves to the owning
        organization.

````