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

# Post v1emailtemplates



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/email/templates
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/email/templates:
    post:
      tags:
        - EmailCampaignTemplates
      operationId: email.templates.store
      requestBody:
        description: '`EmailCampaignTemplateDataRequest`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailCampaignTemplateDataRequest'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailCampaignTemplateData'
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    EmailCampaignTemplateDataRequest:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          format: uuid
        created_at:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
        name:
          type: string
        subject:
          type: string
        body:
          type: string
        type:
          anyOf:
            - $ref: '#/components/schemas/EmailCampaignTemplateTypeEnum'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/EmailCampaignTemplateMetaDataRequest'
            - type: 'null'
        is_active:
          type: boolean
          default: true
      required:
        - name
        - subject
        - body
      title: EmailCampaignTemplateDataRequest
    EmailCampaignTemplateData:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          format: uuid
        created_at:
          type:
            - string
            - 'null'
        updated_at:
          type:
            - string
            - 'null'
        name:
          type: string
        subject:
          type: string
        body:
          type: string
        type:
          anyOf:
            - $ref: '#/components/schemas/EmailCampaignTemplateTypeEnum'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/EmailCampaignTemplateMetaData'
            - type: 'null'
        is_active:
          type: boolean
          default: true
      required:
        - id
        - created_at
        - updated_at
        - name
        - subject
        - body
        - type
        - meta
        - is_active
      title: EmailCampaignTemplateData
    EmailCampaignTemplateTypeEnum:
      type: string
      enum:
        - manual
        - generated
      title: EmailCampaignTemplateTypeEnum
    EmailCampaignTemplateMetaDataRequest:
      type: object
      properties:
        instruction:
          type:
            - string
            - 'null'
        max_times_used:
          type:
            - integer
            - 'null'
        texts_in_rotation:
          type:
            - integer
            - 'null'
      title: EmailCampaignTemplateMetaDataRequest
    EmailCampaignTemplateMetaData:
      type: object
      properties:
        instruction:
          type:
            - string
            - 'null'
        max_times_used:
          type:
            - integer
            - 'null'
        texts_in_rotation:
          type:
            - integer
            - 'null'
      required:
        - instruction
        - max_times_used
        - texts_in_rotation
      title: EmailCampaignTemplateMetaData
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````