---
title: "Create Templates"
method: POST
path: "/client/template/create"
tags: ["Template"]
---

# Create Templates

`POST /client/template/create`

## Request

- Base URL: `https://netcoreapi-main-prod-us.netcorein.com/v5`
- URL: `https://netcoreapi-main-prod-us.netcorein.com/v5/client/template/create`
- Auth: API key in header `api-key`

Create Template API lets you create App Push Notification(APN) templates with support for personalized text, rich media(images), and custom key-value pairs.

## Headers

- `api-key` string, required
- `Content-Type` string, required

## Request body

- object
  - `data` object, required: Contains the data required to create one or more templates.
    - `templates` object[], required: Contains an array of templates to create.
      - `channel_name` 'apn', required: Specifies the communication channel for the template. The supported value is apn.
      - `template_name` string, required: This is the name of the template. `The name must contain between 1 and 200 characters.`
      - `category_name` string: Specifies the category(tags) to which the template belongs. If a category with the specified name does not exist, a new category is created. The name must contain between 1 and 50 characters.
      - `custom` object, required: Defines the APN template configuration, including the target **operating system (os)** and **template layout (template_type)**.
        - `os` 'all' | 'android' | 'ios', required: Specifies the operating system for which the template is configured. Supported values are **all**, **android**, and **ios**.
        - `template_type` 'regular' | 'overlay_on_image' | 'edge_to_edge' | 'small_image' | 'timer' | 'progress_bar' | 'quick_reply', required: This is the type of APN template layout or interaction type. Supported values are `regular`, `overlay_on_image`, `edge_to_edge`, `small_image`, `timer`, `progress_bar`, and `quick_reply`.
        - `Personalisation` object: Optional map of personalization variables. Attribute entries require attribute_name; event entries require category, event_name, and payload_param. Additional data validity is enforced at runtime. Example: "{\"name\":{\"attribute_name\":\"name\",\"default_value\":\"Customer\",\"entity\":\"attribute\"},\"product_price\":{\"category\":\"user_activity\",\"default_value\":\"0\",\"entity\":\"event\",\"event_name\":\"add_to_cart\",\"payload_param\":\"price\"}}"
      - `content` object, required: Contains the template content, landing page configuration, and platform-specific notification interactions.
        - `title` string: This contains the template content, landing page configuration, and platform-specific notification interactions.
        - `description` string: Specifies the main body text of the template. Supports a minimum of 1 character and a maximum of 1,000 characters..
        - `landing_page_type` 'app_homepage' | 'url' | 'deeplink', required: Specifies the destination type when the notification is opened. **Supported values** are `app_homepage`, `url`, and `deeplink`.
        - `landing_page_url` string: Required only when landing_page_type is `url` or `deeplink`.
        - `apn_interactions` object[]: Contains the platform-specific notification settings and interactions for **Android** or **iOS**.
          - `os_type` 'android' | 'ios': Specifies the operating system for which the interaction settings apply. Supported values are `Android` and `iOS`.
          - `subtitle` string: It specifies the subtitle displayed with the APN notification.
          - `rich_media` object: Contains the rich media configuration for the notification, including media type, media URL, layout, carousel details, and overlay color.
            - `media_type` 'image' | 'carousel' | 'gif' | 'audio' | 'video': Specifies the type of rich media to include. Supported values are `image`, `carousel`, `gif`, `audio`, and `video`. **video applicable only for ios**
            - `media_url` string: required when media_type is image, gif, audio or video. video applicable only for ios.
            - `layout` 'portrait' | 'landscape': required when media_type is **carousel**
            - `image_alignment` 'left' | 'right': Specifies the image alignment for the small_image template type. Supported values are `left` and `right.
            - `carousel_metadata` object[]
              - …
            - `overlay_color` BackgroundColor
              - …
          - `timer` object: applicable only for template types `timer` and `progress_bar`.
            - `text` string: Specifies the text displayed with the progress bar. Required when template_type is `progress_bar`.
            - `end_message` string: Specifies the message displayed when the timer or progress bar ends. Required for the timer and progress_bar template types.
            - `background_color` string
            - `text_color` string
            - `settings` object
              - …
          - `background_color` BackgroundColor
            - `type` 'solid' | 'gradient'
            - `color` string: required when type is solid
            - `color_start` string
            - `color_end` string
          - `action_button` object[]: maximum 5 button for ios and 3 for android. When template_type is small_image length is restricted to 1.
            - `action_title` string
            - `background_color` string
            - `text_color` string
            - `call_to_action` object
              - …
          - `quick_reply` object: applicable only for template types `quick_reply`. This replaces action_button
            - `button_text` string
            - `placeholder_text` string: applicable only for android
            - `submission_text` string: applicable only for android
          - `enable_sticky_notification` boolean: applicable only for android
          - `customize_collapsed_state` object: applicable only for template types `overlay_on_image` and `edge_to_edge`
            - `type` 'image_only' | 'image_and_text'
            - `image_url` string
          - `sound` object
            - `type` 'default' | 'custom'
            - `file_name` string: required when type is custom
            - `channel_id` string: applicable only for android
        - `custom_key_values` object[]
          - `ostype` 'all' | 'android' | 'ios': cannot be set to an os which is not declared in custom.os
          - `key` string
          - `value` string

## Response `200`

The Template have been created successfully.

- object
  - `request_id` string, required: Unique request id of request.
  - `code` 200 | 400 | 401 | 500, required: Response status Code.
  - `status` 'success' | 'failed', required: Status of API request.
  - `description` string, required: API response description.

## Other responses

- `400`: Bad Request: The request contains invalid data, possibly due to missing required fields, non-existent audience_id or audience_name, or attributes hat do not match the allowed patterns.
- `401`: Unauthorized: The API key is invalid, missing, or incorrect. Ensure you provide a valid API key in the request header.
- `500`: Internal Server Error: An unexpected issue occured on the server. Possibly, Internal service failure or unexpected request payload structure.

---

[API](https://skmtc.dev/netcorecloud/apis/templates-api.md) - [All operations](https://skmtc.dev/netcorecloud/apis/templates-api/llms.txt) - [OpenAPI document](https://skmtc.dev/netcorecloud/apis/templates-api/revisions/595bc4c948c1?raw)
