Retrieving messages

Learn how to retrieve messages of your connected accounts.

Feature available for: LinkedIn, WhatsApp, Instagram, Messenger, Telegram.

Get message history of a chat

To get existing messages in a chat, use the GET /chats/{chat_id}/messages method or the matching SDK method with a valid chat_id.

Most recent messages will be returned first, ordered by date.

By default, the limit of returned messages is set to 100.

curl --request GET \
     --url https://api.postpress.ai/v1/chats/${CHAT_ID}/messages \
     --header 'X-API-KEY: ${POSTPRESS_API_KEY}' \
     --header 'accept: application/json'

This method uses pagination.

Get new messages

The postpress API gives you two options to receive messages in your application.

In real time with Webhooks

The recommended approach to listen for new messages in your application is to use a Webhook, because they trigger in real time. Whenever the user account receives or sends a new message, the Webhook will call your specified URL with the given message that you can store and display.

With a cron job

If your system cannot handle Webhooks, or if you don't need real time, you can create a cron job calling the GET /messages method at an interval.

We advise fetching a larger period than your cron delay to account for any potential disconnects or errors that may result in losing outdated messages. In this case, implementing a unique id check on your history entries based on the message id can help prevent duplicate entries.

Updated May 2026