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

# Create index



## OpenAPI

````yaml /api/openapi.json post /api/indexes
openapi: 3.1.0
info:
  description: HTTP API for the Rootprint log management platform.
  title: Rootprint API
  version: 0.4.0
servers:
  - description: Rootprint API
    url: https://example.com
security:
  - cookieAuth: []
paths:
  /api/indexes:
    post:
      tags:
        - Index management
      summary: Create index
      operationId: postApiIndexes
      requestBody:
        content:
          application/json:
            schema:
              properties:
                commitTimeoutSecs:
                  minimum: 1
                  type: integer
                defaultSearchFields:
                  items:
                    minLength: 1
                    type: string
                  type: array
                dynamicMapping:
                  properties:
                    expandDots:
                      type: boolean
                    fast:
                      type: boolean
                    indexed:
                      type: boolean
                    record:
                      enum:
                        - basic
                        - freq
                        - position
                      type: string
                    stored:
                      type: boolean
                    tokenizer:
                      enum:
                        - raw
                        - raw_lowercase
                        - default
                        - en_stem
                        - whitespace
                        - chinese_compatible
                        - lowercase
                      type: string
                  required:
                    - indexed
                    - stored
                    - fast
                    - tokenizer
                    - record
                    - expandDots
                  type: object
                fieldMappings:
                  items:
                    oneOf:
                      - properties:
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          fieldnorms:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          record:
                            enum:
                              - basic
                              - freq
                              - position
                            type: string
                          stored:
                            type: boolean
                          tokenizer:
                            enum:
                              - raw
                              - raw_lowercase
                              - default
                              - en_stem
                              - whitespace
                              - chinese_compatible
                              - lowercase
                            type: string
                          type:
                            const: text
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          coerce:
                            type: boolean
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: i64
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          coerce:
                            type: boolean
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: u64
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          coerce:
                            type: boolean
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: f64
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: bool
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          fastPrecision:
                            enum:
                              - seconds
                              - milliseconds
                              - microseconds
                              - nanoseconds
                            type: string
                          indexed:
                            type: boolean
                          inputFormats:
                            items:
                              minLength: 1
                              type: string
                            minItems: 1
                            type: array
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          outputFormat:
                            enum:
                              - rfc3339
                              - unix_timestamp_secs
                              - unix_timestamp_millis
                              - unix_timestamp_micros
                              - unix_timestamp_nanos
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: datetime
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          stored:
                            type: boolean
                          type:
                            const: ip
                        required:
                          - name
                          - type
                        type: object
                      - properties:
                          description:
                            maxLength: 1024
                            minLength: 1
                            type: string
                          expandDots:
                            type: boolean
                          fast:
                            type: boolean
                          indexed:
                            type: boolean
                          name:
                            pattern: ^[@$_\-a-zA-Z][@$_/.\-a-zA-Z0-9]{0,254}$
                            type: string
                          record:
                            enum:
                              - basic
                              - freq
                              - position
                            type: string
                          stored:
                            type: boolean
                          tokenizer:
                            enum:
                              - raw
                              - raw_lowercase
                              - default
                              - en_stem
                              - whitespace
                              - chinese_compatible
                              - lowercase
                            type: string
                          type:
                            const: json
                        required:
                          - name
                          - type
                        type: object
                  minItems: 1
                  type: array
                indexFieldPresence:
                  type: boolean
                indexId:
                  pattern: ^[a-zA-Z][a-zA-Z0-9_-]{2,254}$
                  type: string
                indexUri:
                  minLength: 1
                  type: string
                maxNumPartitions:
                  minimum: 1
                  type: integer
                mode:
                  enum:
                    - dynamic
                    - lenient
                    - strict
                  type: string
                partitionKey:
                  minLength: 1
                  type: string
                retention:
                  properties:
                    period:
                      minLength: 1
                      type: string
                    schedule:
                      minLength: 1
                      type: string
                  required:
                    - period
                  type: object
                storeSource:
                  type: boolean
                tagFields:
                  items:
                    minLength: 1
                    type: string
                  type: array
                timestampField:
                  minLength: 1
                  type: string
              required:
                - indexId
                - timestampField
                - fieldMappings
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexSummarySchema'
          description: Successful response
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    IndexSummarySchema:
      properties:
        displayName:
          anyOf:
            - type: string
            - type: 'null'
        indexId:
          type: string
        isTraceIndex:
          type: boolean
      required:
        - indexId
        - displayName
        - isTraceIndex
      type: object
    ApiErrorBody:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              items:
                properties:
                  message:
                    type: string
                  path:
                    type: string
                required:
                  - path
                  - message
                type: object
              type: array
            message:
              type: string
            requestId:
              type: string
            statusCode:
              type: number
          required:
            - code
            - message
            - statusCode
            - requestId
          type: object
      required:
        - error
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Request validation failed
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Authentication required
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Permission denied
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Resource not found
    Conflict:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Conflict with current resource state
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Internal server error
    ServiceUnavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Upstream service unavailable
  securitySchemes:
    cookieAuth:
      in: cookie
      name: better-auth.session_token
      type: apiKey

````