What are Queued Requests?
In V2 of the Hypersender API, all requests are processed through a queued system. Instead of waiting for your message to be sent in real-time, the API immediately accepts your request, queues it for processing, and returns a unique identifier (UUID) that you can use to track the status of your request.Why We Migrated to Queued Requests
The Problem with V1
In V1, when you sent a message, the API would:- Receive your request
- Process it immediately
- Wait for WhatsApp to confirm the message was sent
- Return the response to you
- Timeouts: If WhatsApp was slow to respond, your request could time out
- Rate limiting issues: Bursts of messages could overwhelm the system
- Unreliable delivery confirmation: Network issues could cause you to miss successful delivery confirmations
- Poor scalability: Each request held a connection open until completion
The V2 Solution
The queued system solves these problems by:- Immediate acceptance: Your request is validated and accepted within milliseconds
- Reliable processing: Messages are processed in order with automatic retries
- Better rate limiting: Requests are smoothly distributed to avoid WhatsApp blocks
- Guaranteed delivery tracking: You can always check the status of any request
- Improved scalability: The system can handle many more concurrent requests
How It Works
Step 1: Send Your Request
When you make any API request (e.g., send a message), you’ll receive an immediate response with aqueued_request_uuid:
Step 2: Check the Status (Optional)
You can check the status of your request at any time using the UUID:Step 3: Get the Result
The response will show you the current status of your request: While Processing:Response Fields Explained
| Field | Type | Description |
|---|---|---|
uuid | string | The unique identifier for this queued request |
request | object | The original request payload you submitted |
response_status | integer | null | HTTP status code of the processed request. null while still processing |
response_body | object | null | The actual API response. Contains message details on success, error details on failure. null while processing |
response_header | object | null | Response headers from the processed request. null while processing |
Determining Request Status
You can determine the status of a request by checking theresponse_status field:
response_status | Meaning |
|---|---|
null | Request is still being processed |
200 | Request completed successfully |
4xx | Client error (e.g., invalid parameters) |
5xx | Server error (will typically be retried) |
Best Practices
1. Use Webhooks for Real-Time Updates
Instead of polling the queued request endpoint, configure webhooks to receive real-time notifications when messages are sent, delivered, or fail.2. Store the UUID
Always store thequeued_request_uuid returned from your requests. This allows you to:
- Track the status of any message
- Debug issues by looking up specific requests
- Build reliable retry logic
Migration from V1
If you’re migrating from V1, here’s what changes:| V1 Behavior | V2 Behavior |
|---|---|
| Synchronous response with message details | Immediate response with queued_request_uuid |
| Timeouts possible on slow requests | Always fast response |
| Direct error responses | Check status via UUID for errors |
FAQ
How long does it take for a request to be processed?
How long does it take for a request to be processed?
Most requests are processed within 1-5 seconds. However, during high load or if WhatsApp is slow, it may take longer. The queued system ensures your request will be processed reliably.
What happens if a request fails?
What happens if a request fails?
If a request fails due to a temporary error (e.g., network issue), the system will automatically retry. If it fails due to a permanent error (e.g., invalid phone number), the
response_body will contain the error details.How long are queued requests stored?
How long are queued requests stored?
Queued request data is stored for 30 days. After that, you won’t be able to look up the status by UUID.
Can I cancel a queued request?
Can I cancel a queued request?
Currently, queued requests cannot be cancelled once submitted. However, most requests are processed within seconds.
Do webhooks still work with V2?
Do webhooks still work with V2?
Yes! Webhooks work exactly the same way. You’ll still receive webhook notifications for message events (sent, delivered, read, etc.) regardless of the queued system.