# Create an account-level template

Store a new account-level template that is available across all domains for the account. Include the template name, description and (optionally) the template content. If the template content is provided, a new version is automatically created and becomes the active version.

Endpoint: POST /v4/templates
Version: 3.0.0
Security: basicAuth

## Security:

  - `basicAuth` (unknown)
    http basic

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

  - `name` (string, required)
    Name of the template being stored. Supports utf-8 characters and name will be down cased.

  - `description` (string)
    Description of the template being stored

  - `createdBy` (string)
    Optional metadata field api user can indicate who created the template.

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

  - `tag` (string)
    Initial tag of the created version. If the template parameter is provided and the tag is missing, the default value `initial` is used.

  - `comment` (string)
    Version comment. This is valid only if a new version is being created. (template parameter is provided.)

  - `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.

## Response 200:

  - `200` (unknown)
    A 200 response

## 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.version.headers` (object)
    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`

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

## Response 400:

  - `400` (unknown)
    A 400 response

## Response 400 fields (application/json):

  - `message` (string, required)
    Response message

## Response 401:

  - `401` (unknown)
    A 401 response

## Response 401 fields (application/json):

  - `message` (string, required)
    Response message

## Response 409:

  - `409` (unknown)
    A 409 response

## Response 409 fields (application/json):

  - `message` (string, required)
    Response message

## Response 500:

  - `500` (unknown)
    A 500 response

## Response 500 fields (application/json):

  - `message` (string, required)
    Response message

## Response 200 examples:

  - `Example` (unknown)

