Skip to main content
Webhooks enable real-time data integration by allowing external systems to push data directly to Nekt. Instead of periodically polling an API, webhooks deliver data the moment an event occurs - such as a new order, a form submission, or a status change.

How Webhooks Work in Nekt

Unlike traditional API connectors that pull data from external systems, the Webhook connector receives data that is pushed to an API gateway on your AWS environment. This gateway is responsible for receiving the webhook data and forwarding it to Amazon SQS via lambda. The connector then processes the messages stored on Amazon SQS and loads the data into your catalog. When you configure a Webhook source, Nekt generates a unique URL endpoint. You then configure your external system to send HTTP POST requests to this endpoint whenever relevant events occur.

Configuring Webhook as a Source

In the Sources tab, click on the “Add source” button located on the top right of your screen. Then, select the Webhook option from the list of connectors. Click Next and you’ll be prompted to configure your webhook.

1. Configure webhook security (optional)

You can protect your webhook endpoint with an API key to ensure only authorized systems can send data:
  • Webhook API Key: Enable this option if you want to require an API key for incoming requests.
    • API Key Header: The HTTP header name where the API key will be sent (e.g., x-api-key, Authorization).
    • API Key Value: The expected value of the API key. Requests without this key (or with an incorrect key) will be rejected.
While API key authentication is optional, it’s strongly recommended for production use to prevent unauthorized data from being sent to your webhook endpoint.
Once you’re done, click Next.

2. Get your Webhook URL

After creating the source, Nekt will generate a unique webhook URL for you. This URL is where external systems should send their data.
Please ask Nekt support for your webhook URL after the source is created.
Keep your webhook URL secure. Anyone with access to this URL (and the API key, if configured) can send data to your Nekt account.

3. Configure your external system

Configure your external system, application, or service to send HTTP POST requests to the Nekt webhook URL. The request should:
  1. Use the POST method
  2. Send data as JSON in the request body
  3. Include the API key header (if you configured authentication)
  4. Set Content-Type: application/json
Example request:
curl -X POST "https://your-webhook-url.nekt.ai/webhook/abc123" \
  -H "Content-Type: application/json" \
  -H "x-api-key: your-api-key" \
  -d '{
    "event_type": "order_created",
    "order_id": "12345",
    "customer_email": "customer@example.com",
    "total": 99.99,
    "items": [
      {"sku": "PROD-001", "quantity": 2}
    ]
  }'

4. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, and a name for the table.
  • Layer: Choose the layer in your catalog where the webhook data will be stored.
  • Folder: Optionally create a folder to organize your webhook data.
  • Table name: Name for the table that will contain the webhook events.
The sync type for webhooks is always INCREMENTAL since webhooks are event-driven and each event is a new record.
Once you are done configuring, click Next.

5. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters. To define your Trigger, consider how often you want the queued webhook data to be processed and loaded into your catalog. Common configurations:
  • Every 15 minutes: Near real-time processing for time-sensitive data
  • Every hour: Balanced approach for most use cases
  • Daily: Cost-effective for non-urgent data
Once you are ready, click Next to finalize the setup.

6. Check your new source

You can view your new source on the Sources page. Once your external system starts sending webhooks and the extraction trigger runs, your data will appear in your Catalog.
For you to be able to see it on your Catalog, you need at least one successful source run with data.

Stream and Fields

The Webhook connector provides a single stream that captures all incoming webhook events:
FieldTypeDescription
message_idStringUnique identifier for the webhook message.
payloadStringThe complete JSON payload sent by the external system, stored as a JSON string.
webhook_received_atDateTimeTimestamp when Nekt received the webhook.
The payload field contains the raw JSON data sent to your webhook. You can parse this field in your SQL queries to extract specific values. See the Use Cases section for examples.

Use Cases for Data Analysis

The webhook connector stores your data as a JSON string in the payload field. Here’s how to extract and analyze your data using SQL.

1. Parse JSON Payload

Extract specific fields from your webhook payload for analysis.
SELECT
  message_id,
  webhook_received_at,
  JSON_EXTRACT_SCALAR(payload, '$.event_type') AS event_type,
  JSON_EXTRACT_SCALAR(payload, '$.order_id') AS order_id,
  JSON_EXTRACT_SCALAR(payload, '$.customer_email') AS customer_email,
  CAST(JSON_EXTRACT_SCALAR(payload, '$.total') AS DOUBLE) AS total_amount
FROM
  nekt_raw.webhooks
WHERE
  webhook_received_at >= CURRENT_DATE - INTERVAL '7' DAY
ORDER BY
  webhook_received_at DESC

2. Event Type Distribution

Analyze the distribution of different event types received via webhooks.
SELECT
  JSON_EXTRACT_SCALAR(payload, '$.event_type') AS event_type,
  COUNT(*) AS event_count,
  MIN(webhook_received_at) AS first_received,
  MAX(webhook_received_at) AS last_received
FROM
  nekt_raw.webhooks
WHERE
  webhook_received_at >= CURRENT_DATE - INTERVAL '30' DAY
GROUP BY
  JSON_EXTRACT_SCALAR(payload, '$.event_type')
ORDER BY
  event_count DESC

3. Create a Materialized View

For frequently accessed webhook data, consider creating a transformation to parse the payload into structured columns.
-- Create a structured view of your webhook data
SELECT
  message_id,
  webhook_received_at,
  JSON_EXTRACT_SCALAR(payload, '$.event_type') AS event_type,
  JSON_EXTRACT_SCALAR(payload, '$.order_id') AS order_id,
  JSON_EXTRACT_SCALAR(payload, '$.customer_email') AS customer_email,
  JSON_EXTRACT_SCALAR(payload, '$.customer_name') AS customer_name,
  CAST(JSON_EXTRACT_SCALAR(payload, '$.total') AS DOUBLE) AS total_amount,
  JSON_EXTRACT_SCALAR(payload, '$.currency') AS currency,
  JSON_EXTRACT_SCALAR(payload, '$.status') AS status,
  JSON_EXTRACT(payload, '$.items') AS items_json
FROM
  nekt_raw.webhooks

Implementation Notes

Data Format

  • All webhook data is stored as a JSON string in the payload field
  • Use your data warehouse’s JSON functions to extract specific fields
  • Consider creating transformations to parse frequently accessed data into structured tables

Message Handling

  • Each webhook request creates one record in the stream
  • Messages are processed incrementally on each extraction run
  • The message_id field uniquely identifies each webhook event
  • The webhook_received_at timestamp reflects when Nekt received the webhook (not when the event occurred in the source system)

Best Practices

  1. Include timestamps in your payload: Add an event_timestamp or similar field in your webhook payload to track when the event actually occurred in the source system
  2. Use consistent payload structures: Maintain a consistent JSON structure across all webhook events to simplify data parsing
  3. Include event types: Add an event_type field to categorize different types of events
  4. Add idempotency keys: Include a unique identifier in your payload to detect and handle duplicate webhook deliveries
  5. Test with sample data: Send test webhooks to verify your integration before enabling production webhooks

Troubleshooting

IssuePossible CauseSolution
No data appearingWebhook not configured correctly in source systemVerify the webhook URL and test with a sample request
401/403 errorsAPI key mismatchCheck that the API key header name and value match your configuration
Data not updatingExtraction trigger hasn’t runCheck your trigger schedule or manually trigger an extraction
Malformed dataInvalid JSON in request bodyEnsure your source system sends valid JSON with Content-Type: application/json