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

# Create Template



## OpenAPI

````yaml https://api.truestate.io/openapi.json post /task-templates/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://docs.truestate.io/docs/api/client-api-keys) for internal an
    external authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://docs.truestate.io/docs/api/overview)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: http://docs.truestate.io/
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.11.78
servers: []
security: []
tags:
  - name: assistants
    description: Management of assistants
  - name: api-keys
    description: Management of each user personal Client API Keys, used to access this API.
  - name: models
    description: Management of models
  - name: secrets
    description: Management of client secrets for accessing external services
  - name: deployments
    description: Management of deployments.
  - name: pipelines
    description: Management of pipelines.
  - name: pipeline-runs
    description: Management of pipeline runs.
  - name: automations
    description: Management of Automations.
  - name: automation-sessions
    description: Management of Automation Sessions.
  - name: chatbots
    description: Chatbot endpoints.
  - name: check-auto-recharge
    description: ''
  - name: classification-classes
    description: >-
      Management of zero shot classifications (using ai to apply new categories
      to a dataset).
  - name: conversations
    description: Management of conversations
  - name: conventions
    description: Management of conventions - best practices for actuators and agents
  - name: credit-usage
    description: Management of Credits.
  - name: dashboards
    description: Management of Dashboards.
  - name: data
    description: Bigquery inference services
  - name: data-dictionary
    description: Data Dictionary endpoints.
  - name: datasets
    description: Dataset endpoints.
  - name: documents
    description: Document endpoints.
  - name: default
    description: Default health checks.
  - name: embedding-search
    description: ''
  - name: inference
    description: Model inference services
  - name: messages
    description: Management of messages
  - name: notebooks
    description: ''
  - name: notebook-services
    description: ''
  - name: organisations
    description: Management of Organisations.
  - name: payment-methods
    description: Management of Payment methods.
  - name: private-tasks
    description: ''
  - name: private-pipelines
    description: ''
  - name: private-data
    description: ''
  - name: renew-seats
    description: ''
  - name: tagging-lists
    description: Management of Tagging Lists.
  - name: tasks
    description: ''
  - name: task-templates
    description: Management of task templates (definitions and schedules).
  - name: agents
    description: ''
  - name: user
    description: Management of User.
  - name: user-context
    description: Management of User Context.
  - name: private-messages
    description: ''
  - name: private-llm-call
    description: ''
  - name: admin-organisations
    description: ''
  - name: private-warehouser
    description: ''
  - name: private-pipeline-tracking
    description: ''
  - name: private-pipeline-runs
    description: ''
  - name: private-reports
    description: ''
  - name: private-bootstrap
    description: ''
  - name: reports
    description: ''
  - name: private-conversations
    description: ''
  - name: private-datasets
    description: ''
  - name: private-dashboards
    description: ''
  - name: private-conventions
    description: ''
  - name: private-documents
    description: ''
paths:
  /task-templates/:
    post:
      tags:
        - task-templates
      summary: Create Template
      operationId: create_template_task_templates__post
      parameters:
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TemplateCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateRead'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    TemplateCreate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        instruction:
          type: string
          title: Instruction
        assignee:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee
        context:
          anyOf:
            - $ref: '#/components/schemas/ConversationContext-Input'
            - type: 'null'
        notification_settings:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/EmailNotification'
                  - $ref: '#/components/schemas/SlackNotification'
                discriminator:
                  propertyName: method
                  mapping:
                    EMAIL: '#/components/schemas/EmailNotification'
                    SLACK: '#/components/schemas/SlackNotification'
              type: array
            - type: 'null'
          title: Notification Settings
        cron_schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Schedule
        schedule_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Schedule Enabled
          default: false
        schedule_start_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule Start At
      type: object
      required:
        - instruction
      title: TemplateCreate
    TemplateRead:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        instruction:
          type: string
          title: Instruction
        assignee:
          anyOf:
            - type: string
            - type: 'null'
          title: Assignee
        context:
          anyOf:
            - $ref: '#/components/schemas/ConversationContext-Output'
            - type: 'null'
        notification_settings:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/EmailNotification'
                  - $ref: '#/components/schemas/SlackNotification'
                discriminator:
                  propertyName: method
                  mapping:
                    EMAIL: '#/components/schemas/EmailNotification'
                    SLACK: '#/components/schemas/SlackNotification'
              type: array
            - type: 'null'
          title: Notification Settings
        id:
          type: string
          format: uuid
          title: Id
        organisation_id:
          type: string
          title: Organisation Id
        cron_schedule:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Schedule
        schedule_enabled:
          type: boolean
          title: Schedule Enabled
        schedule_start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Schedule Start At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - instruction
        - id
        - organisation_id
        - schedule_enabled
        - created_at
        - updated_at
      title: TemplateRead
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ConversationContext-Input:
      properties:
        entities:
          items:
            $ref: '#/components/schemas/ContextEntity'
          type: array
          title: Entities
          default: []
      type: object
      title: ConversationContext
    EmailNotification:
      properties:
        method:
          type: string
          const: EMAIL
          title: Method
          default: EMAIL
        user_ids:
          items:
            type: string
          type: array
          title: User Ids
      type: object
      required:
        - user_ids
      title: EmailNotification
    SlackNotification:
      properties:
        method:
          type: string
          const: SLACK
          title: Method
          default: SLACK
        channel_id:
          type: string
          title: Channel Id
        bot_token_secret_name:
          type: string
          title: Bot Token Secret Name
      type: object
      required:
        - channel_id
        - bot_token_secret_name
      title: SlackNotification
    ConversationContext-Output:
      properties:
        entities:
          items:
            $ref: '#/components/schemas/ContextEntity'
          type: array
          title: Entities
          default: []
      type: object
      title: ConversationContext
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContextEntity:
      properties:
        type:
          $ref: '#/components/schemas/ContextEntityType'
        id:
          type: string
          format: uuid
          title: Id
      type: object
      required:
        - type
        - id
      title: ContextEntity
    ContextEntityType:
      type: string
      enum:
        - DASHBOARD
        - PIPELINE
        - DATASET
        - REPORT
        - DOCUMENT
      title: ContextEntityType
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````