Slack Collection Webhooks

This guide provides an example webhook configuration using Slack. Slack is used for this example, but the logic applies to other applications that accept webhook payloads. In this example, you learn how to send real-time alerts from a Censys collection to a Slack channel or direct message using Slack's Workflow Builder.

Configure Slack

Follow the steps below to configure Slack for webhooks.

  1. In your Slack application, go to More > Automations.

  2. Click on Workflows > New Workflow > select Build Workflow from the dropdown menu.

  3. Under Start the workflow, click Choose an Event.

  4. Select From a webhook in the Events in Slack menu.

  5. Click Set Up Variablesin the From a webhook modal.

  6. Add the variables below and set the data type to text. This is a manual process that requires you to enter each variable one at a time in the Slack workflow builder.


    Variable NameData Type
    event_typeText
    timestampText
    collection_idText
    collection_nameText
    org_idText
    queryText
    asset_idText
    asset_typeText
    urlText
    evidenceText
    event_verb (optional)Text

In the screenshot below, you can see the list of variables in the Example HTTP body.

  1. Click Continue.

  2. Click Add Steps under Then Do These Things.

  3. Click Send a message to a person in the Discover Workflow Steps modal.

  4. Select your account in the Select a member dropdown.

  5. In the Add a message field, you will configure a Slack message that uses the variables set in Step 6. This is the message that will be sent when the webhook is triggered.

  6. Click Insert a variable to add a variable to the message. You can also add free text to the message.

See the example message below, which combines event_verb and event_type to support both readability and system integration.

New Webhook Event
{}asset_type - {}asset_id was {}event_verb {}event_type to the collection {}collection_name at {}timestamp.
  1. Click the pencil icon ✏️ next to Starts with a webhook.

  2. Scroll down and copy your Web request URL. Store this as it's required to configure a webhook in Censys.

  3. Cancel the modal and click Finish Up in the top right.

  4. In the Finish Up modal, provide a Name and Description for your workflow.

  5. In the Permissions section, use the dropdown to define who can use and find the workflow. Click Publish.

Configure Censys

Now that you successfully configured Slack, you will now configure Censys for your webhook.

  1. In the Censys Platform, go to Settings in the side navigation menu.

  2. Click Alerts and Notifications.

  3. On the Alerts and Notifications page, click Create New Webhook.

  4. Name your webhook.

  5. Enter the target URL you saved from Slack. This URL is where Censys sends HTTPS requests for event delivery.

  6. Select one or more collections to source trigger events.

  7. (Optional) Add custom headers to the webhook configuration as part of the request. Custom headers are used for authentication or to route requests.

  8. In the Event Types section, select the checkbox for each collection event you want to trigger the webhook.

  9. In the Advanced Settings section, Select an optional payload template. The payload template defines the structure and content of the data sent to your webhook URL when a collection event occurs. For this example, select Slack.

  10. Click Test Webhook.

  11. After you click Test Webhook, a message is sent to the target URL. You should receive a message in the destination application, Slack for instance.
    You also see a response in the UI. We received a 200 OK response, indicating success. The request headers and body are also displayed.

  12. Click Create Webhook at the top of the page.

After you complete the configuration, Censys sends Slack messages when a matching event occurs in your collection. When an asset is added or removed from your query, the webhook triggers and pushes a message to the channel or user you defined in the configuration. Each message highlights the event type, asset details, and timestamp—keeping your team informed in real time as your collection changes.