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

# Update Document Details

> Full replacement (PUT) of document details including metadata, sections, and rules. All existing sections and rules are deleted and replaced.



## OpenAPI

````yaml /api-reference/openapi-v1.json put /api/v1/document-mrt/{mrt_id}
openapi: 3.0.0
info:
  title: Artos API
  description: API for document generation, template management, and document organization
  version: 1.0.0
  contact:
    name: Artos Support
    email: internal@artosai.com
servers:
  - url: https://api.artosai.com
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security:
  - bearerAuth: []
paths:
  /api/v1/document-mrt/{mrt_id}:
    put:
      tags:
        - Document Details
      summary: Update Document Details
      description: >-
        Full replacement (PUT) of document details including metadata, sections,
        and rules. All existing sections and rules are deleted and replaced.
      operationId: updateDocumentDetails
      parameters:
        - name: mrt_id
          in: path
          required: true
          description: UUID of the document details record
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentDetailsRequest'
      responses:
        '200':
          description: Document details updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOneMRTOutlineResponse'
        '400':
          description: Invalid structure
        '401':
          description: Authentication failed
        '403':
          description: User not authorized
        '404':
          description: Document details record or parent document not found
        '422':
          description: Request validation error
        '500':
          description: Database error
components:
  schemas:
    UpdateDocumentDetailsRequest:
      type: object
      properties:
        docx_url:
          type: string
          nullable: true
          description: S3 object key of DOCX file
        endpoint_analysis:
          type: string
          nullable: true
        output_name:
          type: string
          nullable: true
        connector_data_id:
          type: string
          default: ''
          description: Data connector ID
        rule_type_to_table_like_status:
          type: object
          default: {}
          description: Rule type mappings
        sections:
          type: array
          items:
            $ref: '#/components/schemas/UpdateDocumentDetailsSectionRequest'
          description: Sections with nested rules
        auto_increment_regeneration:
          type: boolean
          default: false
          description: Auto-increment regeneration count
      required:
        - sections
    GetOneMRTOutlineResponse:
      type: object
      properties:
        outline:
          type: object
          description: Complete outline with sections
    UpdateDocumentDetailsSectionRequest:
      type: object
      properties:
        order_index:
          type: integer
          description: Position in document
        level:
          type: integer
          description: Nesting level
        section_id:
          type: string
          nullable: true
        section_type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        synopsis:
          type: string
          nullable: true
        template_instructions:
          type: string
          nullable: true
        template_text:
          type: string
          nullable: true
        additional_details:
          type: object
          default: {}
          description: JSONB metadata
        relevant_chunk_ids:
          type: array
          items:
            type: string
          default: []
          description: Referenced chunks
        relevant_chunk_names:
          type: array
          items:
            type: string
          default: []
        rules:
          type: array
          items:
            $ref: '#/components/schemas/UpdateDocumentDetailsSectionRuleRequest'
          default: []
      required:
        - order_index
        - level
    UpdateDocumentDetailsSectionRuleRequest:
      type: object
      properties:
        confidence_score:
          type: number
          nullable: true
        rule_type:
          type: string
          nullable: true
        rule_mode:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        explanation:
          type: string
          nullable: true
        generated_content:
          type: string
          nullable: true
        rule_parameters:
          type: object
          default: {}
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Token provides organization-scoped access.

````