Skip to main content
Templates are the only way to send outside the 24-hour customer service window. Create them in the WhatsApp Business Manager, wait for approval, then fill in the variables with the SDK’s builder.

The builder

The template helper returns an immutable builder — chain .body(), .header(), .button(), and .carousel() to add components:
Each chain call returns a new builder — the original is untouched, so you can build partial templates and reuse them.

Parameter helpers

Every variable in your template matches one of these factories. The type name is the type field on the parameter.

Header, body, buttons

button(index, ...) — quick-reply button, payload parameter. urlButton(index, ...) — URL button, text parameter appended to the approved base URL. Indexes correspond to the button positions defined when the template was approved. Carousels are body templates with per-card components:
Each card’s components list uses the same TemplateComponentInput shape the body builder produces — you can construct them with template(...) sub-builders or inline them.

Raw template input

The builder always satisfies , so if you prefer a declarative object you can skip the builder and pass one directly:
Use whichever reads better in context — the wire format is identical.