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

# Create an email template, layout or saved reply.

> Name and Body are required. Send Tag template for a template that shows in Email >
Email templates and can be sent with the send endpoint.
            
Subject and Body must be valid Liquid; otherwise the template is rejected with a
validation error.
            
To change a system email, update it with the update endpoint instead.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/templates
openapi: 3.0.0
info:
  title: Outseta API
  description: >-
    Outseta REST API. See the [API
    overview](https://docs.outseta.com/api-reference/overview) for
    authentication, field selection, pagination, filtering, errors, rate limits
    and webhooks.
  version: v1
servers:
  - url: https://{subdomain}.outseta.com
    description: Your Outseta account
    variables:
      subdomain:
        default: your-subdomain
        description: >-
          Your Outseta account subdomain — the part before ".outseta.com" in
          your admin URL.
security: []
paths:
  /api/v1/templates:
    post:
      tags:
        - Template
      summary: Create an email template, layout or saved reply.
      description: >-
        Name and Body are required. Send Tag template for a template that shows
        in Email >

        Email templates and can be sent with the send endpoint.
                    
        Subject and Body must be valid Liquid; otherwise the template is
        rejected with a

        validation error.
                    
        To change a system email, update it with the update endpoint instead.
      operationId: Template_AddTemplate
      requestBody:
        x-name: template
        description: The template to create.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddTemplateRequest'
            example:
              Name: Welcome
              Subject: Welcome to {{ CompanyName }}
              Body: <p>Hi {{ Person.FirstName }}</p>
              Tag: template
        x-position: 1
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                example:
                  Uid: string
                  _objectType: string
                  Created: string
                  Updated: string
                  ActivityEventData: {}
                  Name: string
                  Subject: string
                  Body: string
                  Design: string
                  Description: string
                  SystemName: string
                  IsInternal: false
                  AvailableTokens: string
                  RequiredTokens: string
                  Tag: string
                  Tags:
                    - Uid: string
                      _objectType: string
                      Created: string
                      Updated: string
                      ActivityEventData: {}
                      Name: string
                      SystemName: string
                      SystemDescription: string
                      TagColor: 1
                      EntityType: 0
                title: Template
                type: object
                properties:
                  Uid:
                    type: string
                    maxLength: 10
                    nullable: true
                  _objectType:
                    type: string
                    nullable: true
                  Created:
                    type: string
                    readOnly: true
                    format: date-time
                    minLength: 1
                  Updated:
                    type: string
                    readOnly: true
                    format: date-time
                    minLength: 1
                  ActivityEventData:
                    nullable: true
                  Name:
                    type: string
                    maxLength: 250
                    minLength: 1
                  Subject:
                    type: string
                    maxLength: 1000
                    nullable: true
                  Body:
                    type: string
                    minLength: 1
                  Design:
                    type: string
                    nullable: true
                  Description:
                    type: string
                    maxLength: 1000
                    nullable: true
                  SystemName:
                    type: string
                    maxLength: 50
                    nullable: true
                  IsInternal:
                    type: boolean
                  AvailableTokens:
                    type: string
                    nullable: true
                  RequiredTokens:
                    type: string
                    nullable: true
                  Tag:
                    type: string
                    nullable: true
                  Tags:
                    type: array
                    nullable: true
                    items:
                      $ref: '#/components/schemas/Tag'
                required:
                  - Id
                  - Created
                  - CreatedByUser_Id
                  - Updated
                  - UpdatedByUser_Id
                  - Qcount_Id
                  - Name
                  - Body
        '401':
          description: Unauthorized
      security:
        - Bearer: []
        - ApiKey: []
components:
  schemas:
    AddTemplateRequest:
      type: object
      description: The fields of a new email template. Name and Body are required.
      additionalProperties: false
      properties:
        AvailableTokens:
          type: string
          description: >-
            The tokens that the editor in the Outseta app offers for the
            template, comma-separated.
          nullable: true
        Body:
          type: string
          description: >-
            The HTML of the template. May use Liquid tokens, for example {{
            Person.FirstName }}.

            Required.
        Description:
          type: string
          description: What the template is for.
          nullable: true
        Design:
          type: string
          description: >-
            The design of the template in the drag-and-drop editor, as JSON.
            Leave it out for a

            template that is plain HTML.
          nullable: true
        Name:
          type: string
          description: The name of the template, shown in the Outseta app. Required.
        RequiredTokens:
          type: string
          description: >-
            The tokens the Body must keep, comma-separated, for example
            Body,SenderInfo for an

            email layout. The template is rejected if its Body does not have
            them, and so is a

            later update that removes one.
          nullable: true
        Subject:
          type: string
          description: >-
            The subject line of the email. May use Liquid tokens, for example {{
            CompanyName }}.
          nullable: true
        Tag:
          type: string
          description: >-
            The kind of template: template (Email > Email templates), layout
            (email layout) or

            savedReply (saved support reply). Send template for a template that
            shows in Email >

            Email templates and can be sent with the send endpoint.
          nullable: true
    Tag:
      example:
        Uid: string
        _objectType: string
        Created: string
        Updated: string
        ActivityEventData: {}
        Name: string
        SystemName: string
        SystemDescription: string
        TagColor: 1
        EntityType: 0
      allOf:
        - $ref: '#/components/schemas/AbstractQcountBean'
        - type: object
          additionalProperties: false
          required:
            - Name
          properties:
            Name:
              type: string
              maxLength: 50
              minLength: 1
            SystemName:
              type: string
              maxLength: 50
              nullable: true
            SystemDescription:
              type: string
              maxLength: 500
              nullable: true
            TagColor:
              $ref: '#/components/schemas/TagColor'
            EntityType:
              $ref: '#/components/schemas/EntityType'
    AbstractQcountBean:
      allOf:
        - $ref: '#/components/schemas/AbstractBean'
        - type: object
          additionalProperties: false
          required:
            - Qcount_Id
          properties:
            ActivityEventData:
              nullable: true
    TagColor:
      type: integer
      description: >-
        `1` - Red, `2` - Orange, `3` - Amber, `4` - Green, `5` - Teal, `6` -
        Blue, `7` - Indigo, `8` - Purple, `9` - Pink, `10` - Gray
      x-enumNames:
        - Red
        - Orange
        - Amber
        - Green
        - Teal
        - Blue
        - Indigo
        - Purple
        - Pink
        - Gray
      x-enum-descriptions:
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
    EntityType:
      type: integer
      description: >-
        `0` - None, `1` - Account, `2` - Person, `3` - Deal, `4` - Case, `5` -
        Invoice, `6` - EmailLog, `7` - Plan, `8` - DiscountCoupon, `9` - AddOn,
        `10` - Task, `11` - Segment, `12` - Broadcast, `13` - Article, `14` -
        Template
      x-enumNames:
        - None
        - Account
        - Person
        - Deal
        - Case
        - Invoice
        - EmailLog
        - Plan
        - DiscountCoupon
        - AddOn
        - Task
        - Segment
        - Broadcast
        - Article
        - Template
      x-enum-descriptions:
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
        - ''
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
    AbstractBean:
      type: object
      x-abstract: true
      additionalProperties: false
      required:
        - Id
        - Created
        - CreatedByUser_Id
        - Updated
        - UpdatedByUser_Id
      properties:
        Uid:
          type: string
          maxLength: 10
          nullable: true
        _objectType:
          type: string
          nullable: true
        Created:
          type: string
          readOnly: true
          format: date-time
          minLength: 1
        Updated:
          type: string
          readOnly: true
          format: date-time
          minLength: 1
  securitySchemes:
    Bearer:
      type: http
      description: Enter your access token (OAuth / JWT).
      scheme: bearer
      bearerFormat: JWT
    ApiKey:
      type: apiKey
      description: 'Enter: Outseta {api_key}:{api_secret}'
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.