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

# Create a document



## OpenAPI

````yaml post /documents
openapi: 3.1.0
info:
  title: joyfill
  version: '1.1'
servers:
  - url: https://api-joy.joyfill.io/v1
security:
  - sec0: []
paths:
  /documents:
    post:
      summary: Create a document
      operationId: create-a-document
      parameters:
        - name: Authorization
          in: header
          description: >-
            Supports both API Key and User Access Token authorization. See
            https://joyfill.mintlify.app/api/authentication
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifier:
                  type: string
                  description: >-
                    Specifies a document's unique ID. Maximum length is 80
                    characters. Identifier cannot be changed after creation.
                    Leave the identifier param empty to have Joyfill auto
                    generate an identifier.
                name:
                  type: string
                  description: >-
                    Specifies the visual display name. When the template param
                    is used in this creation event and this name is left blank
                    the document will automatically be given the same name as
                    the original template.
                files:
                  type: array
                  description: >-
                    Array of JoyDoc file objects. See the JoyDoc data structure
                    under the guides section to learn more.
                fields:
                  type: array
                  description: >-
                    Array of JoyDoc field objects. See the JoyDoc data structure
                    under the guides section to learn more.
                template:
                  type: string
                  description: >-
                    The template identifier to use as the source of the
                    document.
                group:
                  type: string
                  description: >-
                    The group identifier of the group that you would like to
                    create the document for.
                stage:
                  type: string
                  default: published
                  enum:
                    - draft
                    - published
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: |-
                    {
                      "type": "String",
                      "identifer": "String",
                      "name": "String",
                      "group": "String",
                      "stage": "String",
                      "files": "Array",
                      "fields": "Array"
                       
                    }
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: String
                  identifer:
                    type: string
                    example: String
                  name:
                    type: string
                    example: String
                  group:
                    type: string
                    example: String
                  stage:
                    type: string
                    example: String
                  files:
                    type: string
                    example: Array
                  fields:
                    type: string
                    example: Array
      deprecated: false
      security: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````