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

# Create Document

> Create a new document and configure metadata and properties.



## OpenAPI

````yaml POST /document
openapi: 3.0.1
info:
  title: Machina Sports SDK
  description: >-
    Machina Sports API for seamless AI integration in sports, offering real-time
    insights, personalized content, and fan sentiment analysis.
  version: '1.0'
  termsOfService: http://machina.gg/tos/
  contact:
    email: support@machina.gg
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://{api-address}.org.machina.gg
    description: Production server
    variables:
      api-address:
        default: https://api.machina.gg
        description: Your api-address
  - url: http://local.machina:5001
    description: Local development server
security:
  - ApiToken: []
paths:
  /document:
    post:
      tags:
        - documents
      summary: Create Document
      description: Create a new document and configure metadata and properties.
      operationId: createDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  description: Unique identifier for the document
                value:
                  type: object
                  description: >-
                    The main data of the document, can be any type (string,
                    object, array, etc.)
                metadata:
                  type: object
                  description: Additional metadata for the document
                status:
                  type: string
                  enum:
                    - active
                    - draft
                    - archived
                  default: active
                  description: Current status of the document
                embed-vector:
                  type: boolean
                  description: Whether to create a vector embedding for the document
              example:
                embed-vector: false
                metadata:
                  agent_id: '123'
                name: New test document
                value:
                  chat:
                    - What is Lorem Ipsum?
                    - >-
                      Lorem Ipsum is simply dummy text of the printing and
                      typesetting industry. Lorem Ipsum has been the industry's
                      standard dummy text ever since the 1500s, when an unknown
                      printer took a galley of type and scrambled it to make a
                      type specimen book.
                    - ' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
      responses:
        '200':
          description: Document created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      _id:
                        type: string
                        description: Unique identifier of the created document
                      id:
                        type: string
                        description: Unique identifier of the created document (duplicate)
                      name:
                        type: string
                        description: Unique name of the document
                      value:
                        type: object
                        description: The main data of the document
                      metadata:
                        type: object
                        description: Additional metadata for the document
                      status:
                        type: string
                        description: Current status of the document
                      created:
                        type: string
                        description: Creation timestamp
                      updated:
                        type: string
                        description: Update timestamp
                      embed-vector:
                        type: boolean
                        description: Whether a vector embedding was created
                  message:
                    type: string
                    description: Success message
                  status:
                    type: boolean
                    description: Operation status
                example:
                  data:
                    _id: 67e1fc8c2a5ade8c69c03fe7
                    created: Tue, 25 Mar 2025 00:45:00 GMT
                    embed-vector: false
                    id: 67e1fc8c2a5ade8c69c03fe7
                    metadata:
                      agent_id: '123'
                    name: New test document
                    status: null
                    updated: Tue, 25 Mar 2025 00:45:00 GMT
                    value:
                      chat:
                        - What is Lorem Ipsum?
                        - >-
                          Lorem Ipsum is simply dummy text of the printing and
                          typesetting industry. Lorem Ipsum has been the
                          industry's standard dummy text ever since the 1500s,
                          when an unknown printer took a galley of type and
                          scrambled it to make a type specimen book.
                        - ' It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'
                  message: document saved
                  status: true
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
components:
  securitySchemes:
    ApiToken:
      type: apiKey
      name: x-api-token
      in: header
      description: API key authentication

````