# Create a template version

Adds a new template version. If the template doesn’t contain any other versions, the first version becomes active. A template can store up to 40 versions.

Endpoint: POST /v3/{domain_name}/templates/{template_name}/versions
Version: 3.0.0
Security: basicAuth

## Path parameters:

  - `domain_name` (string, required)
    Domain name the template is associated with.

  - `template_name` (string, required)
    Template name to create the new version for.

## Request fields (multipart/form-data):

  - `template` (string, required)
    Content of the template.

  - `tag` (string, required)
    Tag of the version that is being created. Must be unique to the template.

  - `comment` (string)
    Comment related to the version that is being created.

  - `active` (string)
    If this flag is set to yes, this version becomes active

  - `headers` (string)
    Key value JSON object of headers to be stored with the template. Where key is the header name and value is the header value. The header names `From`, `Subject`, and `Reply-To` are the only ones currently supported.  These headers will be inserted into the MIME at the time we attempt delivery.
Headers set at the message level will override headers set on the template. e.g. Setting the From header at the time of sending will override the From header saved on the template. Additionally, headers generated by templates are not reflected on the accepted event as they are not prepended to the message until the message is prepped for delivery. if a From header is not provided either in the message or template, we will default to `postmaster@your-sending-domain.tld`

## Response 200 fields (application/json):

  - `message` (string, required)
    Response message

  - `template` (any, required)
    Template details

  - `template.name` (string, required)
    Name of the template

  - `template.description` (string)
    Description of the template

  - `template.createdAt` (string)
    Creation date in RFC822 format

  - `template.createdBy` (string)
    Indicate who created the template

  - `template.id` (string)
    Template ID

  - `template.domain` (string)
    Domain of the template

  - `template.version` (any)
    Active version information

  - `template.version.tag` (string, required)
    Tag of the version. Must be unique to the template

  - `template.version.template` (string)
    Template content

  - `template.version.engine` (string, required)
    Rendering engine

  - `template.version.mjml` (string, required)
    Template source

  - `template.version.createdAt` (string, required)
    Creation date in RFC822 format

  - `template.version.comment` (string, required)
    Comment related to the version

  - `template.version.active` (boolean, required)
    If this flag is true

  - `template.version.id` (string, required)
    Template ID

  - `template.versions` (array | null)
    List of template's versions

## Response 400 fields (application/json):

  - `message` (string, required)
    Response message

## Response 401 fields (application/json):

  - `message` (string, required)
    Response message

## Response 404 fields (application/json):

  - `message` (string, required)
    Response message

## Response 409 fields (application/json):

  - `message` (string, required)
    Response message

## Response 500 fields (application/json):

  - `message` (string, required)
    Response message

