GET /api/templates/{id} Returns the full details of a single template, including its variable schema, linked channels, and current status.

Headers

appid
string
required
Your CometChat App ID.
apikey
string
required
Your CometChat API Key.

Path parameters

id
string
required
The template ID.

Example request

curl https://{appId}.api-{region}.cometchat.io/v3/business-messaging/api/templates/665b2c3d4e5f6a7b8c9d0e1f \
  -H "appid: YOUR_APP_ID" \
  -H "apikey: YOUR_API_KEY"

Example response

{
  "id": "665b2c3d4e5f6a7b8c9d0e1f",
  "appId": "YOUR_APP_ID",
  "name": "Order Confirmation",
  "templateId": "order-confirmation",
  "status": "approved",
  "category": "transactional",
  "channelIds": ["664a1b2c3d4e5f6a7b8c9d0e"],
  "variableSchema": {
    "customerName": { "type": "string" },
    "orderId": { "type": "string" }
  },
  "config": {},
  "createdAt": "2024-01-15T09:30:00.000Z",
  "updatedAt": "2024-01-15T09:30:00.000Z"
}

Response fields

id
string
Unique template identifier.
name
string
Template display name.
templateId
string
Custom or auto-generated template identifier.
status
string
Current status: draft, approved, or archived.
channelIds
string[]
Array of linked channel IDs.
variableSchema
object
Declared template variables with their types.
config
object
Template-level configuration.