Skip to main content
POST
Preview template

Restrictions

Usage

  • Renders against incident_id when given (it must exist in the account, otherwise InvalidParameter), or against a mock incident. Empty content previews the channel’s built-in preset.
  • A template error is not an HTTP error: the response has success: false and message explains why.
  • card describes the message frame around the rendered template (email subject, IM app card elements and buttons) for email, feishu_app, dingtalk_app, wecom_app, slack_app and teams_app; it is omitted for other types. Buttons that need an integration (AI analysis, war room) are not shown.
  • incident_card_hidden_fields applies to IM app cards; unsupported app types or field names return InvalidParameter.
  • Nothing is sent or saved.

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

Template preview request.

type
enum<string>
required

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; content is 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
content
string

Template source to render for the channel type. Empty or omitted previews the channel's built-in preset content. Ignored for push.

incident_id
string

Incident whose data is rendered (24-character hex ID from /incident/list); must exist in the account, otherwise InvalidParameter. When omitted a mock incident is used.

Pattern: ^[0-9a-fA-F]{24}$
incident_card_hidden_fields
object

Incident card fields to hide per IM app when previewing.

feishu_app_card_v2_table_enabled
boolean
default:false

Render Markdown tables in feishu_app content as native Feishu card tables, as the template setting of the same name does.

feishu_app_card_v2_preserve_blank_lines
boolean

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

wecom_markdown_v2_enabled
boolean
default:false

Preview wecom content as a markdown_v2 message, as the template setting of the same name does (size limit 4,096 bytes).

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

Template preview result.