# Create template content

Add content to an existing template. You will need to specify the template ID and include either MJML, HTML or plain text. A locale is required in order to save and send your template. To obtain a valid id, first call GET /v1/REST/templates to list your templates.

Endpoint: POST /v1/REST/templates/{id}/contents
Version: 1.0.0
Security: basicAuth, bearerAuth

## Path parameters:

  - `id` (integer, required)
    The ID of the template.
    Example: 101

## Request fields (application/json):

  - `Author` (string)
    The name of the person or entity creating the template content.

  - `Name` (string)
    The name of the template content.

  - `Locale` (string, required)
    Required. Specifies the locale for the template content (e.g. en_US, fr_FR, de_DE, es_ES, it_IT, pt_BR, ja_JP, zh_CN, etc.).

  - `MJMLPart` (string)
    The MJML code for the template. Either MJMLPart, TextPart or HTMLPart must be provided.

  - `HTMLPart` (string)
    The HTML code for the template. Either MJMLPart, TextPart or HTMLPart must be provided.

  - `TextPart` (string)
    The plain text version of the template content. Either MJMLPart, TextPart or HTMLPart must be provided.

  - `Headers` (object)
    Additional headers for the template in JSON format (Subject, From, Reply-To, SenderName, SenderEmail).

  - `Headers.Subject` (string)
    The email subject line.

  - `Headers.From` (string)
    The sender identity (e.g. "MyCompany ").

  - `Headers.Reply-To` (string)
    The reply-to email address.

  - `Headers.SenderName` (string)
    The sender display name.

  - `Headers.SenderEmail` (string)
    The sender email address.

## Response 201 fields (application/json):

  - `ID` (integer)
    The ID of the content version.

  - `TemplateID` (integer)
    The ID of the template.

  - `ContentType` (string)
    Content status. Values: D (Draft), P (Published), A (Autosave). Always D when created.

  - `Author` (string,null)
    The name of the person or entity creating the template content.

  - `Name` (string)
    The name of the template content.

  - `IsLocked` (boolean)
    If true, the template content cannot be edited.

  - `Locale` (string)
    Specifies the locale (language and region) for the template content.

  - `MJMLPart` (string,null)
    The MJML code for the template.

  - `HTMLPart` (string,null)
    The HTML code for the template.

  - `TextPart` (string,null)
    The plain text version of the template content.

  - `Headers` (object)
    Additional headers for the template in JSON format (Subject, From, Reply-To, SenderName, SenderEmail).

  - `CreatedAt` (string)
    The date and time when the content was created (RFC3339).

  - `UpdatedAt` (string)
    The date and time when the content was last updated (RFC3339).


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 404 fields

## Response 429 fields

## Response 500 fields
