> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lithoblocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Zapier

> Use LithoBlocks with Zapier to send Slack messages and trigger Zaps from templates and webhooks.

<Note>
  The LithoBlocks Zapier app is currently in development. The steps below will be updated when the app is available. Until then, you can use the LithoBlocks API from Zapier's Webhooks by Zapier or API Request actions.
</Note>

This guide explains how to use LithoBlocks with [Zapier](https://zapier.com/) to send Slack messages from Zaps and to receive webhooks from LithoBlocks in Zapier.

## Prerequisites

* LithoBlocks account and organization
* Zapier account
* LithoBlocks Zapier app (when available; until then, Webhooks / API Request)
* [Connecting Slack](/connecting-slack) for your LithoBlocks workspace

## Coming Soon: LithoBlocks Zapier App

When the LithoBlocks Zapier app is released, you will be able to:

1. **Trigger a Zap and send a message to Slack** — Use a LithoBlocks action in a Zap to compile a template with your trigger data and send the message to a Slack channel or user. No custom HTTP needed.
2. **Receive a webhook from LithoBlocks in a Zap** — When a button or modal triggers a webhook in LithoBlocks, use it as a Zap trigger (e.g. Catch Hook) and process the payload in your Zap.

Steps for these flows will be added here when the app is available.

## Current workaround: Use the LithoBlocks API from Zapier

Until the Zapier app is available, use **Webhooks by Zapier** or **API Request** (in Code by Zapier or a custom integration) to call the LithoBlocks API.

### Get an API key

1. Log into your [LithoBlocks dashboard](https://app.lithoblocks.com)
2. Go to **API Keys** in your account or organization settings
3. Create an API key with the scopes you need (e.g. `templates:read`, `messages:create`)
4. Copy the key (it is shown only once)

### Send a message from a Zap

1. In your Zap, add an action step. Use **Webhooks by Zapier** → **POST** (or **API Request** if available in your plan).
2. **URL:** `https://api.lithoblocks.com/v1/templates/compile` or `https://api.lithoblocks.com/v1/templates/send` (use send when LithoBlocks should post to Slack). Check the [API reference](/api-reference/introduction) for parameters.
3. **Method:** POST
4. **Headers:** `Authorization: Bearer YOUR_LITHOBLOCKS_API_KEY`, `Content-Type: application/json`
5. **Body:** JSON with `template_id`, `data` (object matching your template placeholders, same shape as sample data), and for send a destination field such as `channel_id` as documented in the API reference. Map fields from your trigger into `data`.
6. The response contains the compiled Slack blocks (compile) or send result (send). Use a subsequent Slack step if you compiled and need to post the blocks yourself, or use the send endpoint so LithoBlocks posts to Slack.

See the [API reference](/api-reference/introduction) for authentication, base URL, and endpoint details. See [Quickstart](/quickstart) and [Placeholders](/guides/templates-placeholders) for template and data structure.

### Receive LithoBlocks webhooks in a Zap

When a button or modal in LithoBlocks triggers a webhook:

1. In Zapier, create a Zap with a **Webhooks by Zapier** → **Catch Hook** trigger (or **Custom Webhooks** trigger).
2. Copy the webhook URL Zapier provides.
3. In LithoBlocks, create a [Webhook destination](/guides/webhook-destinations) with that URL and connect it to your button or modal submission.
4. When a user clicks the button or submits the modal, LithoBlocks POSTs the payload to your Zap. Map the payload fields in subsequent steps (e.g. add to Google Sheet, create CRM record, send email).

Payload structure depends on your [payload template](/guides/button-webhooks); use the same placeholders (e.g. `{{interaction.user_email}}`, `{{expense.id}}`) so Zapier receives the data you need.

## Next steps

<CardGroup cols={2}>
  <Card title="Connecting Slack" icon="slack" href="/connecting-slack">
    Connect your Slack workspace to LithoBlocks.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Build a template and send a message.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/introduction">
    Authentication, endpoints, and parameters.
  </Card>

  <Card title="Webhook destinations" icon="link" href="/guides/webhook-destinations">
    Configure webhooks for buttons and modals.
  </Card>
</CardGroup>
