> ## 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.

# Get Sections for Document

> Retrieve a flat list of all section identifiers and their associated metadata within a given document. Used to enumerate the full section structure, enabling the Sources panel selection dropdown to be pre-populated with all available sections upon document load.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /get-sections-for-document
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:
  /get-sections-for-document:
    post:
      tags:
        - Documents
      summary: Get Sections for Document
      description: >-
        Retrieve a flat list of all section identifiers and their associated
        metadata within a given document. Used to enumerate the full section
        structure, enabling the Sources panel selection dropdown to be
        pre-populated with all available sections upon document load.
      operationId: getSectionsForDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetSectionsForDocumentRequest'
      responses:
        '200':
          description: Sections retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSectionsForDocumentResponse'
              example:
                sections:
                  - section_id: '1.1 Title of Study:'
                    section_title: '1.1 Title of Study:'
                    section_order: 0
                  - section_id: '1.2 Study Objectives:'
                    section_title: '1.2 Study Objectives:'
                    section_order: 1
                  - section_id: '1.3 Study Design:'
                    section_title: '1.3 Study Design:'
                    section_order: 2
        '400':
          description: Authentication failed or invalid Bearer token
        '404':
          description: Document MRT not found for the given document ID
components:
  schemas:
    GetSectionsForDocumentRequest:
      type: object
      required:
        - document_id
      properties:
        document_id:
          type: string
          description: >-
            Unique identifier of the document whose section list is being
            retrieved
    GetSectionsForDocumentResponse:
      type: object
      properties:
        sections:
          type: array
          items:
            $ref: '#/components/schemas/SectionItem'
          description: Array of section objects sorted by document order
    SectionItem:
      type: object
      properties:
        section_id:
          type: string
          description: >-
            Unique identifier of the section (the section title), used as
            section_id in the sources endpoints
        section_title:
          type: string
          description: Human-readable display name of the section
        section_order:
          type: integer
          description: >-
            Zero-based index representing the section's position within the
            document
      required:
        - section_id
        - section_title
        - section_order
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Token provides organization-scoped access.

````