POST /api/templates
Create a new notification template. Link it to channels, define a variable schema for personalization, and optionally assign a custom template ID.
Headers
Your CometChat App ID.
Your CometChat API Key.
Request body
Display name for the template.
Array of channel IDs to link this template to.
Optional custom template identifier. Auto-generated if omitted.
Optional category for organizing templates.
Optional template-level configuration.
Variable declarations. Each key is a variable name with a
type of string, image, or action.Example request
Example response
New templates are created in
draft status. Update the status to approved via the update template endpoint before using it for notifications.