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

# Create a Template



## OpenAPI

````yaml POST /templates/create
openapi: 3.0.0
info:
  title: alto.dialme.at API
  description: API for building voice assistants
  version: '1.0'
  contact: {}
servers:
  - url: https://alto.dialme.at/api/altov2/public
security: []
tags: []
paths:
  /templates/create:
    post:
      tags:
        - template_create
      operationId: template_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplatePayload'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: success
                  result:
                    $ref: '#/components/schemas/TemplateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Unauthorized
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Not Found
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Method Not Allowed
      security:
        - bearer: []
components:
  schemas:
    TemplatePayload:
      type: object
      properties:
        title:
          type: string
          minLength: 3
          maxLength: 180
        description:
          type: string
          minLength: 3
          maxLength: 360
        instruction:
          type: object
          enum:
            - basic
            - advanced
          oneOf:
            - required:
                - basic
              properties:
                basic:
                  type: object
                  properties:
                    role:
                      type: string
                      minLength: 3
                      maxLength: 360
                    target_audience:
                      type: string
                      minLength: 3
                      maxLength: 360
                    goal:
                      type: string
                      minLength: 3
                      maxLength: 360
                  required:
                    - role
                    - target_audience
                    - goal
            - required:
                - advanced
              properties:
                advanced:
                  type: string
                  minLength: 3
                  maxLength: 360
        conversational_states:
          type: object
          description: >-
            You can use our [generator](https://alto.dialme.at/generator) to
            create a conversational_states and export it as JSON. The JSON
            should be in the format of the `generator` JSON export.
          additionalProperties:
            type: object
            properties:
              objective:
                type: string
              branch_logic:
                type: array
                items:
                  type: array
                  items:
                    oneOf:
                      - type: number
                      - type: string
                  minItems: 2
                  maxItems: 2
              starter_message:
                type: string
            required:
              - objective
              - branch_logic
      required:
        - title
        - description
        - instruction
        - conversational_states
    TemplateResponse:
      type: object
      properties:
        _id:
          type: string
          example: tp_***
        title:
          type: string
        description:
          type: string
        instruction:
          type: object
        conversational_states:
          type: object
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: Bearer
      type: http
      description: >-
        Retrieve your key from
        [Dashboard](https://alto.dialme.at/settings/apis).

````