Overview
Instead of pollingGET /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
Includecallback_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 acallback_secret in your research request, we include it as a Bearer token in the callback:
Webhook handler example
Python
Best practices
- Always verify the
callback_secretto 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