# How the API processes requests

> LocalPipe queues every enrichment request and returns 202 at once. How the queue, webhook delivery and request logging work.
>
> Part of the LocalPipe API reference: https://www.localpipe.io/docs/infrastructure (full reference in one file: https://www.localpipe.io/localpipe-api-docs.md, categories CSV: https://www.localpipe.io/localpipe-business-categories.csv)

## Queue-Based Processing

All enrichment requests are **asynchronously queued** for processing. When you submit a request:

1. **Immediate acceptance** — Every valid request returns 202 Accepted instantly
2. **Queue processing** — Records are processed from the queue in batches
3. **Webhook delivery** — Results POST to your callback_url when complete

This architecture allows you to send thousands of requests simultaneously without waiting, **as long as your client throttles to ≤ 1000/min** and retries any 429s.

## Database Optimization

Recent infrastructure improvements have reduced database operations per request by 50%:
- Consolidated credit checking and subscription validation
- Asynchronous API logging (fire-and-forget pattern)
- Optimized batch processing via cron-based scheduling

These changes ensure consistent performance even during peak usage periods.
