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



## OpenAPI

````yaml post /templates
openapi: 3.1.0
info:
  title: joyfill
  version: '1.1'
servers:
  - url: https://api-joy.joyfill.io/v1
security:
  - sec0: []
paths:
  /templates:
    post:
      summary: Create a template
      operationId: create-a-template
      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
              required:
                - files
                - fields
              properties:
                identifier:
                  type: string
                  description: >-
                    Specifies a template'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
                files:
                  type: array
                  description: >-
                    Array of JoyDoc file objects. See the JoyDoc data structure
                    under the guides section.
                fields:
                  type: array
                  description: >-
                    Array of JoyDoc field objects. See the JoyDoc data structure
                    under the guides section to learn more.
                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": ["JoyDocFile","etc."],
                       
                    }
      deprecated: false
      security: []
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic

````