Preview template
curl --request POST \
--url 'https://api.flashcat.cloud/template/preview?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"content": "**{{.Title}}** is {{.IncidentSeverity}}",
"type": "feishu_app",
"incident_id": "664a1b2c3d4e5f6a7b8c9d0e",
"incident_card_hidden_fields": {
"feishu_app": [
"responders"
]
}
}
'import requests
url = "https://api.flashcat.cloud/template/preview?app_key="
payload = {
"content": "**{{.Title}}** is {{.IncidentSeverity}}",
"type": "feishu_app",
"incident_id": "664a1b2c3d4e5f6a7b8c9d0e",
"incident_card_hidden_fields": { "feishu_app": ["responders"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content: '**{{.Title}}** is {{.IncidentSeverity}}',
type: 'feishu_app',
incident_id: '664a1b2c3d4e5f6a7b8c9d0e',
incident_card_hidden_fields: {feishu_app: ['responders']}
})
};
fetch('https://api.flashcat.cloud/template/preview?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/template/preview?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '**{{.Title}}** is {{.IncidentSeverity}}',
'type' => 'feishu_app',
'incident_id' => '664a1b2c3d4e5f6a7b8c9d0e',
'incident_card_hidden_fields' => [
'feishu_app' => [
'responders'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/template/preview?app_key="
payload := strings.NewReader("{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/template/preview?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/template/preview?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"success": true,
"content": "**Database latency spike** is Critical",
"message": "",
"card": {
"title": "Database latency spike",
"elements": [
{
"type": "template"
},
{
"type": "divider"
},
{
"type": "actions",
"actions": [
{
"text": "Acknowledge",
"style": "primary"
},
{
"text": "Resolve",
"style": "danger"
},
{
"text": "Snooze",
"style": "select"
}
]
}
]
},
"blocks": [
{
"type": "markdown",
"content": "**Database latency spike** is Critical"
}
],
"size_bytes": 38,
"size_limit_bytes": 30720
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "AccessDenied",
"message": "Access Denied."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}Notification templates
Preview template
Render a template source against an incident or mock data and return what the channel would send.
POST
/
template
/
preview
Preview template
curl --request POST \
--url 'https://api.flashcat.cloud/template/preview?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"content": "**{{.Title}}** is {{.IncidentSeverity}}",
"type": "feishu_app",
"incident_id": "664a1b2c3d4e5f6a7b8c9d0e",
"incident_card_hidden_fields": {
"feishu_app": [
"responders"
]
}
}
'import requests
url = "https://api.flashcat.cloud/template/preview?app_key="
payload = {
"content": "**{{.Title}}** is {{.IncidentSeverity}}",
"type": "feishu_app",
"incident_id": "664a1b2c3d4e5f6a7b8c9d0e",
"incident_card_hidden_fields": { "feishu_app": ["responders"] }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content: '**{{.Title}}** is {{.IncidentSeverity}}',
type: 'feishu_app',
incident_id: '664a1b2c3d4e5f6a7b8c9d0e',
incident_card_hidden_fields: {feishu_app: ['responders']}
})
};
fetch('https://api.flashcat.cloud/template/preview?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/template/preview?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '**{{.Title}}** is {{.IncidentSeverity}}',
'type' => 'feishu_app',
'incident_id' => '664a1b2c3d4e5f6a7b8c9d0e',
'incident_card_hidden_fields' => [
'feishu_app' => [
'responders'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/template/preview?app_key="
payload := strings.NewReader("{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/template/preview?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/template/preview?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"**{{.Title}}** is {{.IncidentSeverity}}\",\n \"type\": \"feishu_app\",\n \"incident_id\": \"664a1b2c3d4e5f6a7b8c9d0e\",\n \"incident_card_hidden_fields\": {\n \"feishu_app\": [\n \"responders\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"success": true,
"content": "**Database latency spike** is Critical",
"message": "",
"card": {
"title": "Database latency spike",
"elements": [
{
"type": "template"
},
{
"type": "divider"
},
{
"type": "actions",
"actions": [
{
"text": "Acknowledge",
"style": "primary"
},
{
"text": "Resolve",
"style": "danger"
},
{
"text": "Snooze",
"style": "select"
}
]
}
]
},
"blocks": [
{
"type": "markdown",
"content": "**Database latency spike** is Critical"
}
],
"size_bytes": 38,
"size_limit_bytes": 30720
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "AccessDenied",
"message": "Access Denied."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}Restrictions
| Aspect | Value |
|---|---|
| Rate limits | 100 requests/minute; 5 requests/second per account |
| Permissions | Templates Read (on-call) or Templates Manage (on-call) |
Usage
- Renders against
incident_idwhen given (it must exist in the account, otherwiseInvalidParameter), or against a mock incident. Emptycontentpreviews the channel’s built-in preset. - A template error is not an HTTP error: the response has
success: falseandmessageexplains why. carddescribes the message frame around the rendered template (email subject, IM app card elements and buttons) foremail,feishu_app,dingtalk_app,wecom_app,slack_appandteams_app; it is omitted for other types. Buttons that need an integration (AI analysis, war room) are not shown.incident_card_hidden_fieldsapplies to IM app cards; unsupported app types or field names returnInvalidParameter.- Nothing is sent or saved.
Authorizations
Body
application/json
Template preview request.
Channel to preview; other values return InvalidParameter.
email: email body (HTML template).sms,voice: SMS text and voice call script.push: mobile app push (fixed content;contentis ignored).dingtalk,wecom,feishu,zoom,telegram,slack: robot (webhook) messages.feishu_app,dingtalk_app,wecom_app,slack_app,teams_app: IM app cards.
Available options:
email, sms, voice, push, dingtalk, wecom, feishu, zoom, telegram, slack, feishu_app, dingtalk_app, wecom_app, slack_app, teams_app Response
Success
Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.
Was this page helpful?