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

# Update a part

> Updates the script file associated with a specific part



## OpenAPI

````yaml put /api/models/{modelId}/parts/{partId}
openapi: 3.0.0
info:
  title: Dalus Public API Documentation
  version: 1.0.0
  description: Public API documentation for Dalus application
servers:
  - url: http://localhost:3000
    description: Dalus API Server
security:
  - bearerAuth: []
tags:
  - name: models
    description: AI model management endpoints
  - name: models/requirements
    description: Requirements management for models
  - name: models/actions
    description: Action management for models
  - name: models/parts
    description: Part management for models
  - name: models/states
    description: State management for models
  - name: models/transitions
    description: Transition relationship management for models
  - name: models/signals
    description: Signal relationship management for models
  - name: models/interfaces
    description: Interface relationship management for models
  - name: models/ports
    description: Port management for models
paths:
  /api/models/{modelId}/parts/{partId}:
    put:
      tags:
        - models/parts
      summary: Update a part
      description: Updates the script file associated with a specific part
      parameters:
        - name: modelId
          in: path
          required: true
          description: ID of the model
          schema:
            type: string
            format: uuid
        - name: partId
          in: path
          required: true
          description: ID of the part
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: string
                  description: The contents of the script file
                fileName:
                  type: string
                  description: The name of the script file (optional)
                fileExtension:
                  type: string
                  description: extension of the script file (optional)
      responses:
        '200':
          description: Script updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  fileName:
                    type: string
        '400':
          description: Invalid modelId or request body
        '401':
          description: Unauthorized - user not authenticated
        '500':
          description: Server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````