Design LINE Flex Message
line_design_flexCompose validated LINE Flex Messages using pre-built Thai templates or custom JSON. Get preview link and size warnings before sending.
Instructions
Compose a validated Flex Message ready for line_send_message. Two input modes:
Template mode (recommended for Thai use cases): { template: "voucher", data: { title, code, discount, valid_until } } Available templates: receipt, voucher, shipping_update, order_confirm, appointment_reminder, promo_simple, course_cert, thank_you
Raw mode (advanced): { flex_json: {...bubble or carousel JSON...}, alt_text: "..." }
Discovery: { list_templates: true } returns the catalog with descriptions in Thai and required fields per template.
Returns: { template?: string, flex_json: { ...Flex contents... }, alt_text: string, preview_url: string, // LINE Flex Simulator deep link size_bytes: number, warnings: string[] // e.g., if approaching the 30KB bubble limit }
Composability:
Use line_design_flex first → grab flex_json → pass to line_send_message as { message: { flex_json, alt_text } }
Or pass { message: { template, data } } directly to line_send_message — the same templates are reused.
Examples:
"ออกแบบคูปอง 20% หมดวันที่ 31 ส.ค." → { template: "voucher", data: { title: "ส่วนลดวันแม่", code: "MOM20", discount: "ส่วนลด 20%", valid_until: "31 ส.ค. 2026" } }
"ดูว่ามี template อะไรบ้าง" → { list_templates: true }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | No | Name of a pre-built Thai-localized Flex template. See catalog below. Mutually exclusive with flex_json. | |
| data | No | Template-specific data fields. Required when template is set. | |
| flex_json | No | Raw Flex contents (bubble or carousel). Advanced users only. Mutually exclusive with template. | |
| alt_text | No | Optional override for altText. Defaults to a template-derived alt text. | |
| list_templates | No | Set true to return the available template catalog instead of rendering. |