Skip to main content
Lection Logolection
Blog/Integration Guide

Custom Webhook Endpoint

Lection Team5 min read

Point Lection at any HTTPS endpoint you own and handle the payload yourself.

Setup Steps

  1. Expose an HTTPS POST endpoint that responds quickly (aim <12s) and returns 2xx.
  2. Validate the header X-Lection-Secret against an environment variable.
  3. Read dataset.records (array of row objects) and store or forward as needed.
  4. Optionally enqueue heavy work and return 200 immediately; include download.url in downstream steps.
  5. Set the endpoint URL and secret in Lection and run a test scrape.

Mapping Tips

  • dataset.columns provides header order; dataset.records are keyed by those headers.
  • download.url is time-limited; fetch or relay it quickly if you need the file.
  • Do not rely on retries here—handle idempotency yourself if needed.

Payload Highlights

  • event: scheduled_scrape.completed, version: 1.
  • schedule., run., dataset., download. objects as described.
  • Headers: Content-Type: application/json and optional X-Lection-Secret.

Test Checklist

  • Set webhook URL and optional secret in Lection.
  • Run a scheduled scrape to capture sample data.
  • Confirm dataset.records and download.url arrive in your tool.
  • Publish/activate the workflow so production runs stay wired.

Ready to supercharge your research?

Join thousands of researchers using Lection to capture and organize the web. It's free to get started.

Learn More