Skip to main content

Queue

Z-API provides its users with a queue system that works exclusively for messages sent through our API. This queue plays an important role in our architecture by organizing and ordering messages until they are delivered to WhatsApp. This feature is also very useful for situations where the phone connected to Z-API experiences some instabilities or goes offline. If this happens, once you reconnect, the messages will be sent to the recipient normally.

Send time

Our queue works with alternating send times between one message and another to simulate human behavior. This interval is in a default random range between 1 to 3 seconds per message. If you want to increase the message delay, you can pass the delayMessage attribute in the request body.

Recommendation

We recommend that before connecting you always check if there are pending messages in the queue. If there are, notify your user and ask them to decide whether or not to send these queued messages. Consider that the messages in the queue may no longer make sense to be sent, so it’s important to notify the user and give them this decision. Whenever you connect to Z-API it will automatically execute the queue and dispatch the messages if any exist. So be very careful!

Queue limit

Z-API allows up to 1,000 messages for disconnected phones in its queue before starting to reject new messages.