Skip to main content
These examples show complete workflows you can copy and adapt. Each links to the detailed guides for configuration.

Prerequisites

Recipe 1: Approval flow with button webhook

Goal: Send a message with Approve/Reject buttons; when the user clicks, POST to your API and optionally update the message. Steps:
  1. Create a webhook destination — Integrations → Webhooks → Create. Set URL (e.g. https://api.yourcompany.com/approvals), Method POST, and auth headers if needed. See Webhook destinations.
  2. Build the template — Add Header (e.g. “Expense approval”), Section with placeholders (e.g. Amount: {{expense.amount}}, Submitted by {{user.name}}), then an Actions block with two buttons: ”✓ Approve” (Primary, action_id approve_expense) and ”✗ Reject” (Danger, action_id reject_expense). Set each button’s Value to {{expense.id}} or similar.
  3. Add webhook to each button — In button settings, Add Action → Webhook; select your destination; set payload, e.g. { "action": "approve", "expense_id": "{{expense.id}}", "approved_by": "{{interaction.user_email}}" } (and "action": "reject" for the Reject button). See Button webhooks.
  4. Optional: message update — Add a Message Update action (e.g. Replace self) so the button becomes ”✓ Approved” or ”✗ Rejected” after click. See Button message updates.
  5. Sample data — Add sample data with expense and user so the preview and send work. See Sample data.
  6. Test — Send to a channel, click a button, then check Usage → Interactions for webhook delivery.

Recipe 2: Modal submission to webhook and Slack update

Goal: User opens a modal from a button, fills a form, submits; you POST the form data to your API and append a confirmation line to the original message. Steps:
  1. Webhook destination — Create a destination for your API (e.g. feedback or approval-with-comment endpoint). See Webhook destinations.
  2. Modal — Create a modal with title and inputs (e.g. Comment text area, Submit/Cancel). Bind inputs to your data model if needed. See Modal basics and Modal data binding.
  3. On submit — In the modal, under On submit: add Webhook (select destination; payload can include form fields and {'{'}interaction.user_email{'}'} etc.) and Message update (e.g. Add response block with ”✓ Submitted by {'{'}interaction.user_email{'}'} at {'{'}timestamp{'}'}”). See Modal submissions.
  4. Open modal from a button — In your template, add a button with action “Open modal” and select this modal. When the user clicks, the modal opens; on submit, the webhook fires and the message updates.
  5. Test — Send the template, click the button, submit the modal; check Usage → Interactions and the updated message.

Recipe 3: Table from API data

Goal: Display a list of items (e.g. order line items, tasks) in a table in Slack using a template and sample data that mirrors your API response. Steps:
  1. Sample data — Create sample data with an array of objects, e.g. items or tasks, each with fields like name, quantity, price, status. Match the structure your API will send. See Sample data.
  2. Table block — Add a Table block to your template. Set the array path (e.g. items). Add columns: Header and data path for each field (e.g. Product → name, Qty → quantity, Price → price). Use format strings like ${{value}} for currency. See Table blocks (experimental).
  3. Optional: Header and context — Add a Header above the table (e.g. “Order summary”) and a Section or Context below with totals if you compute them in your data.
  4. Send — When you send the template (from the UI or API), pass the same shape of data (e.g. from your API); the table will render one row per array item.

Next steps