Event-Driven Webhooks in the Gemini API
Reduce friction and latency for long-running jobs with Webhooks in Gemini API
· 1 min read
Copy link
We're making it easier and more efficient to build complex, long-running agentic applications with the Gemini API Webhooks.
L
Lucia Loher
Product Manager, Gemini API
H
Hussein Hassan Harrirou
Engineering, Gemini API
Copy link

Today, we're making it easier and more efficient to build complex, long-running agentic applications with the Gemini API. We are introducing event-driven Webhooks, a push-based notification system that eliminates the need for inefficient polling.
As Gemini shifts toward agentic workflows and high-volume processing — like Deep Research, long video generation, or processing thousands of prompts via the Batch API — operations can take minutes or even hours. Until now, developers had to rely on continuous polling (e.g., repeatedly calling`GET`operations) to check if a job was completed.
Now, the Gemini API can simply push a real-time HTTP POST payload to your server the instant a task finishes.
We’ve built this with reliability and security in mind. Our implementation strictly adheres to the Standard Webhooks specification. Every request is signed using `webhook-signature`, `webhook-id`, and `webhook-timestamp` headers, ensuring idempotency and preventing replay attacks. We also guarantee "at-least-once" delivery with automatic retries for up to 24 hours.
How it works
You can configure webhooks globally at the project level (secured via HMAC), or override them dynamically on a per-request basis to route specific jobs (secured via JWKS).
Here's a quick example of how you can dynamically configure a webhook for a batch task using the Python SDK:
```py from google import genai from google.genai import types
client = genai.Client()
file_batch_job = client.batches.create( model="gemini-3-flash-preview", src=inline_requests, config={ "display_name": "My Setup", "webhook_config": { "uris": ["https://my-api.com/gemini-webhook-dynamic"], "user_metadata": {"job_group": "nightly-eval", "priority": "high"}, }, }, )
print(f"Created batch job: {file_batch_job.name}") ```
Get started today
This feature is available now for all developers using the Gemini API:
- Read the guide:** Check out the Webhooks documentation to explore the full event catalog and learn how to secure your endpoints.
- Hands-on practice:** We've prepared a comprehensive Cookbook to help you build an end-to-end integration with webhooks.
POSTED IN:
Related stories
.
Jump to position 1 Jump to position 2 Jump to position 3 Jump to position 4 Jump to position 5 Jump to position 6
Help us improve The Keyword with a one-question survey
Yes No
This survey is anonymous. All responses will be aggregated and used only for analysis to improve our services.
Did this article provide the level of detail you were looking for?
Yes, I got what I needed No, I wanted more technical depth No, I wanted a simpler overview I was looking for something else entirely
✅ Thank you!