Docs
  • LogicLoop Documentation
  • LogicLoop Quickstart
  • Data Sources
    • Connect your data source
      • Deployment options
    • Supported data sources
      • API data (JSON)
      • AWS CloudWatch
      • BigQuery
      • Databricks
      • Google Analytics
      • Google Sheets
      • MongoDB
      • Microsoft SQL Server
      • MySQL
      • Oracle
      • PostgreSQL
      • Snowflake
      • Combine Results
      • LogicLoop Data Source
  • Queries
    • Write a rule
      • More rule options
      • A/B testing rules
      • Version history
      • Query Snippets
    • Visualizations & dashboards
      • Visualizations
      • Dashboards
  • Actions
    • Set up an action
    • Action destinations
      • Email
      • Slack
      • Webhooks & APIs
      • Microsoft Teams
      • Salesforce
      • Zapier
      • PagerDuty
      • Write to Database
      • Chain Rules
      • Google Sheets
      • Bento
    • Templating
  • Case Management
    • Case Management
      • Ticket Generation
      • Case Triage
      • Custom Fields and Attachments
  • AI
    • AI Query Helper
    • Ask AI
  • Teams & Settings
    • Integrations
      • Slack
      • Google Sheets
    • Invite your teammate
    • Groups & Permissions
  • Changelog
  • FAQs
  • Troubleshooting
  • Templates
    • Templates Home
    • Risk & Fraud Rules
    • AML Transaction Monitoring Rules
    • Logistics & Marketplace Ops
    • Customer Success & Growth
    • Systems Observability
    • Data Quality Monitoring
    • Healthcare
    • HTML Email Templates
      • Annual Review
      • Weekly Performance Table
      • Invoice Recap
  • BETA
    • AI SQL API
    • Approving rules
    • Render Data as JSON
    • Case Analytics
    • Python
  • Security & Legal
    • Security
    • AI Security
    • Terms of use
    • Privacy policy
    • Services description
Powered by GitBook
On this page
  • Webhook Builder
  • Configuration
  • Test Webhook Connection
  • Twilio Example
  • Post to Slack
  • Webhook (Basic)

Was this helpful?

  1. Actions
  2. Action destinations

Webhooks & APIs

PreviousSlackNextMicrosoft Teams

Last updated 11 months ago

Was this helpful?

The Webhook Builder destination allows you to configure LogicLoop to send data to external services via HTTP requests. This can be useful for integrating your data with third-party services, automating workflows, and more.

Webhook Builder

Configuration

To set up a webhook destination, you need to fill in the following fields:

Input Fields

  • Name (required): A descriptive name for your webhook destination.

  • Method (required): The HTTP method to use for the request. Options are: POST, GET, PUT, PATCH, DELETE.

  • URL (required): The endpoint URL where the request will be sent.

  • Authorization (optional): Any authorization token required by the endpoint.

  • Username (optional): The username for basic authentication.

  • Password (optional): The password for basic authentication.

  • Headers (optional): Additional headers to include in the request. This is a key-value field.

  • Body (optional): The body of the request. This is a key-value field.

  • Logo (optional): Upload an SVG image to represent this webhook destination.

Templating

Test Webhook Connection

Under 'Additional Settings,' you have the option to test your webhook connection before finalizing your setup. The fields available for testing are:

  • Test URL: The URL to send the test request to.

  • Test Headers: Headers to include in the test request. This is a key-value field.

  • Test Body: The body of the test request. This is a key-value field.

Testing your webhook connection ensures that the configuration is correct and the external service is reachable.

Twilio Example

What's powerful about the webhook builder is that a technical team member can configure it once with the correct header and body structure, and they can insert whatever parameters they want for a non-technical user to later plug and play. In this example, we've decided to create two variables called PHONE_NUMBER and TEXT_MESSAGE_COPY available for replacement.

Next, to use this Twilio webhook integration, a non-technical member can go to their Action and add the Twilio integration to be triggered every time their rule runs. The will see the two parameter fields that were made available in the destination configuration that they can fill in. The non-technical member can change the copy of the text message or the phone number it goes out to at any time without involving an engineer to rebuild the webhook integration.

Here's what this Twilio text message would look like when received by the user:

Post to Slack

Start by giving your webhook a name, and setting the method to POST.

Give it a url. Above, we set the base url, and used a template, {{API_METHOD}} , for the specific endpoint. This allows you to choose the endpoint when creating an alert with this Destination.

Add Body fields for API Call.

Again, we use templates so you can specify the Channel ID, Title, and Message Content (along with Rule Url and Action Url. You can copy and paste our example blocks section here:

[{"type": "header", "text": {"type": "plain_text", "text": "{{Title}}"}},{"type": "section", "text": {"type": "mrkdwn", "text": "{{Message Content}}"}},{"type": "section", "fields": [{"type": "mrkdwn", "text": "<{{Rule Url}}|*Go to Rule*>"}, {"type": "mrkdwn", "text": "<{{Action Url}}|*Go to Action*>"}]}]

Lastly, you want to create the actual alert.

To get the channel id, open slack and navigate to the specific channel. Click the channel name at the top, and a pop-up should open. The About tab of the pop-up will have the Channel ID at the bottom.

You can also create an alert that sends messages to a dynamically specified channel.

First, the rule would need a Channel ID column (you can name it channel_id).

Then you would have to set your Action to run For each row returned.

Lastly, you would set Channel ID in the form above to {{ channel_id }}.

Webhook (Basic)

Alternatively, you can also use our raw Webhook destination instead of the Webhook Builder if you want to be able to directly construct the body and headers to be sent as raw JSON. First, go to your Action Destinations and create a new destination of type Webhook. Enter a name, URL, and Authorization headers (if any) of your endpoint.

Next, go to your Action and add the webhook action subscription. Enter additional information for your webhook which will include the method, URL, headers and body.

You may leave the URL field blank, in which case the URL will be the one you configured when you created the action destination. If you do specify a URL, it will override the URL you configured in the action destination.

The headers and body fields must be valid JSON. The header fields that you enter in the header section will be appended to default headers that are automatically sent, such as the Authorization. The default content-type is application/json, but you may override this by entering "content-type": "application/x-www-form-urlencoded" in the headers if you wish to use URL encoded format instead.

Header keys and values must be strings in double quotes -- as you can see in the example, you need to specify "{{ ROW_EMAIL }}" not just {{ ROW_EMAIL }}. The body can take nested JSON values as well. Note that in the example we write "Data": {{ ROW }}, instead of "Data": "{{ ROW }}" because {{ ROW }} is a valid JSON structure. For URL encoded content type nested structures are not currently supported.

Here's what this webhook request payload looks like when sent:

You can use LogicLoop templating in these fields using the {{parameter}} notation. For more details on how to use templating, please refer to our .

To set up your rule to trigger a webhook, first go to Action Destination and create a new Webhook Builder destination. The webhook builder will allow you to construct your webhook request by entering the required method type, URL, Authorization headers, and body. The following example shows you how you can use the Webhook Builder to set up a webhook integration with , but it can be used for any service that exposes an API including Zapier, Stripe, Asana, Sendgird, Whatsapp, and even your company's own internal API endpoints.

If the phone number and text message changes depending on which user you are sending the text to, you can even inject variables from the result of your queries into your notification as you can with any of our .

If you run into any issues, you can go into your alert's to see what the error was.

For posting to Slack, you'll likely use chat.postMessage as your endpoint, though you can see all other options .

Templating Guide
Twilio
action subscription templating variables
Action Logs
here
Sample setup of a webhook that triggers a text message to be sent via Twilio