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

# Create Templates

`POST /client/template/create`

Create Template API lets you create App Push Notification(APN) templates with support for personalized text, rich media(images), and custom key-value pairs. It allows you to define platform-specific content for Android or iOS, set landing actions, and use dynamic placeholders based on user attributes or event data. This API helps streamline the setup of resuable, targeted APN templates.

## Headers

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

## Request body

- object
  - `data` object, required — Container object for the template data payload.
    - `templates` object[], required
      - `template_name` string, required — The title or identifier for the template. This name is used to reference and manage the template. Maximum length is 200 characters. Maxlength for APN:200.
      - `channel_name` 'apn', required — Specifies the platform for APN template.For APN templates, this must always be set to `apn`. The channel same needs to be the same accross all the templates in a request.
      - `category_name` string, required — Define the category under which the template will be grouped. Helps in organizing templates. Category length for apn is 50 characters.
      - `custom` object, required — Contains layout configuration, target operating system, and optional personalization settings used for dynamic content in the notification.
        - `template_type` string, required — Defines the layout type. Use `createNewLayout` to create a new template.
        - `os` 'android' | 'ios' | 'all', required — Specifies the target operating system for the template. Valid values are: `android`(target only Android device), `ios`(Target only iOS devices), or `all`(Target both Android and iOS)
        - `Personalisation` object — Defines dynamic placeholders that can be used in the teplate content. Each placeholder key maps to user attributes or event data, allowing you to personalize messages. Includes a default value for fallback when actual data is unavailable.
          - `{{Key_Name}}` object — Define any key name for attibute or event .It is just a key/identifier chosen to group personalisation rules.
            - `entity` 'attribute' | 'event' — Entity should be attribute or event.
            - `attribute_name` string — Name of the attribute or event which is being used for personalisation. Allowed Regex Pattern (A-Za-z0-9_)
            - `category` 'user_activity' | 'business' — Type of the event can be user_activity or business based on which you want to personalise your notification.
            - `event_name` string — Name of the event.
            - `payload_param` string — Parameter for event name.
            - `default_value` string — Default value for attribute name and event name
      - `content` object, required — Contains the main notification detail like title, message, landing action, and optional rich media or custom data. Supports personalization placeholders.
        - `title` string, required — Main text shown as the notification's title Personalization is supported using placeholder.
        - `description` string — Body text of the notification. Supports dynamic content through personalization.
        - `landing_page_type` 'app_homepage' | 'deeplink' | 'url', required — Specifies the action triggered when a user clicks the notification. Supported values: `app_homepage`, `deeplink`, or `url`.
        - `landing_page_url` string — The destination URL or deeplink opened on notification click. Must be HTTPS/HTTP URL. Can also contain a placeholder object for personalization (use [] or {{}}).
        - `enable_apn_interactions` boolean — Flag to enable or disable APN interactions for the template. If set to `true`, the `apn_interactions` array must be provided with platform-specific interaction details. If set to `false`, no interactions will be included in the notification.
        - `apn_interactions` object[] — Includes array of metadata in apn interactions.
          - `os_type` 'ios' | 'android' — Operating system can of type android | ios only.
          - `subtitle` string — Subtitle text for the notification, customizable per platform(for android and ios).
          - `rich_media` object[] — Array of media elements(e.g., images) to enhance the notification
            - `media_type` string — Type of media. Currently supports `image` for simple layouts.
            - `media_url` string — Url for media file. Must be valid and supports. personalization placeholders.
        - `custom_key_values` object[] — Optional array used to send additional custom key-value pairs in the notification payload.
          - `key` string — Name of the Key must be unique.
          - `value` string — Value of the key.
          - `ostype` 'android' | 'ios' | 'all' — Os type can andriod,ios,all

## Response `200`

- object
  - `request_id` string, required — Unique request ID of request.
  - `description` string, required — API response description.
  - `code` integer, required — Response status code.
  - `status` string, required — Status of API request.
  - `data` object[] — Array of newly created templates.
    - `template_id` string — ID of the newly created template.
    - `template_name` string — Name of the newly created template.
    - `cat_id` integer — Category ID of the newly created template.

## Other responses

- `400`
- `401`
- `500`

---

[API](https://skmtc.dev/netcorecloud/apis/contacts-api.md) · [All operations](https://skmtc.dev/netcorecloud/apis/contacts-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/netcorecloud/contacts-api/revisions/2878cfd0ee01/schema)
