Skip to main content

Overview

Instead of polling GET /research/{task_id}, you can provide a callback_url when submitting research. We’ll POST the results to your URL when the research completes (or fails).

Setting up webhooks

Include callback_url (and optionally callback_secret) in your research request:

Callback payload

Success

When research completes successfully, we POST:

Failure

If research fails, we POST:
When a research request fails, credits are automatically refunded to your account.

Authentication

If you provide a callback_secret in your research request, we include it as a Bearer token in the callback:
Verify this token in your webhook handler to confirm the request came from RapportAPI.

Webhook handler example

Python

Best practices

  • Always verify the callback_secret to ensure requests come from RapportAPI
  • Respond quickly with a 200 status — do heavy processing asynchronously
  • Handle retries — your endpoint should be idempotent (we may retry on timeout)
  • Use HTTPS — callback URLs must use HTTPS in production