Skip to main content
POST
Create a template

Restrictions

Usage

  • Requires the Pro plan or higher; otherwise NoLicense.
  • template_name must be unique among the account’s non-deleted templates and must not equal the built-in preset template’s name in any supported language; otherwise InvalidParameter.
  • Every non-empty channel source is test-rendered against a mock incident; a template error in any channel fails the whole request with InvalidParameter. With wecom_markdown_v2_enabled = true, the rendered wecom content must be at most 4,096 bytes.
  • Channels left empty use the built-in preset content when notifications are sent.
  • A non-zero team_id must be an existing team; otherwise InvalidParameter.
  • Every call is recorded in the account audit log. Don’t put secrets in request fields.

Authorizations

app_key
string
query
required

APP Key created in the Flashduty console under My → APP Key. Send it as the app_key query parameter or in the Fd-App-Key request header. Its effective access is the intersection of the key's permission scope and the creator's current role permissions. Keep it secret.

Body

application/json

Create a new notification template.

template_name
string
required

Template name, 1–39 characters, unique among the account's non-deleted templates and different from the built-in preset template's name in every supported language.

Required string length: 1 - 39
Example:

"Prod incident default"

team_id
integer<int64>
default:0

Owning team ID from POST /team/list; 0 (default) means account-wide. A non-zero ID must be an existing team.

description
string

Free-form description. Up to 500 characters.

Maximum string length: 500
email
string

Email body template source (Go html/template syntax).

sms
string

SMS template source (Go text/template syntax).

voice
string

Voice call script template source.

dingtalk
string

DingTalk robot message template source.

wecom
string

WeCom robot message template source.

wecom_markdown_v2_enabled
boolean

Send WeCom robot notifications as markdown_v2 messages instead of plain markdown. While enabled, the rendered wecom content must be at most 4,096 bytes.

feishu
string

Feishu robot message template source.

feishu_app
string

Feishu app message template source.

feishu_app_card_v2_table_enabled
boolean
default:false

Render Markdown tables in the feishu_app content as native Feishu card tables.

feishu_app_card_v2_preserve_blank_lines
boolean

Keep blank lines in the body of Feishu app card v2 messages.

feishu_app_war_room_enabled
boolean

Show the Create War Room button on Feishu app cards.

dingtalk_app_war_room_enabled
boolean

Show the Create War Room button on DingTalk app cards.

slack_app_war_room_enabled
boolean

Show the Create War Room button on Slack app cards.

dingtalk_app
string

DingTalk app message template source.

wecom_app
string

WeCom app message template source.

slack_app
string

Slack app message template source.

teams_app
string

Microsoft Teams app message template source.

telegram
string

Telegram bot message template source.

slack
string

Slack robot message template source.

zoom
string

Zoom bot message template source.

incident_card_closed_action_apps
enum<string>[]

IM apps whose closed-incident cards keep the custom action buttons. Supported values: feishu_app, dingtalk_app, wecom_app, slack_app, teams_app. An empty list hides the buttons on every app.

Available options:
feishu_app,
dingtalk_app,
wecom_app,
slack_app,
teams_app
incident_card_hidden_fields
object

Incident card fields to hide per IM app type.

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.

request_id
string
required

Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.

Example:

"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"

data
object

Create template response.