# Messenger and Instagram Conversations API: the 20-message limit

> The Conversations API lists Messenger and Instagram threads but returns only the 20 most recent messages of each. Hosts, permissions, calls and limits.

Published 2026-11-04. Z-API Omni team.

The Conversations API returns details for only the 20 most recent messages in each Messenger or Instagram conversation. "However, you can only get details about the 20 most recent messages in the conversation," Meta's guide says ([Conversations API, accessed 2026-11-04](https://developers.facebook.com/documentation/business-messaging/messenger-platform/conversations)). Older messages still show up as IDs, but a request for one returns an error saying the message was deleted. You can list threads, read recent messages and check who owns a thread. For a full history, store each message from your webhooks as it arrives.

## Two hosts and their permissions

Which host you call depends on how the account is connected. Messenger, and Instagram accounts linked to a Facebook Page, go through `graph.facebook.com` with a Page access token. For Instagram you pass the ID of the Page linked to the professional account, with `platform=instagram`. Instagram accounts connected with Instagram Login use `graph.instagram.com` and an Instagram User access token ([Instagram Login Conversations API, accessed 2026-11-04](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-instagram-login/conversations-api)).

| Setup | List call | Permissions | Task on the Page |
| --- | --- | --- | --- |
| Messenger | `graph.facebook.com/v26.0/<PAGE_ID>/conversations?platform=messenger` | `pages_manage_metadata`, `pages_read_engagement`, `pages_messaging` | `MESSAGING` or `MODERATE` |
| Instagram through the Page | `graph.facebook.com/v26.0/<PAGE_ID>/conversations?platform=instagram` | `instagram_basic`, `instagram_manage_messages`, `pages_manage_metadata` | `MESSAGING` |
| Instagram Login | `graph.instagram.com/v26.0/me/conversations?platform=instagram` | `instagram_business_basic`, `instagram_business_manage_messages` | No Page task |

For Instagram through the Page, Meta adds that "The app must be owned by a verified business." Advanced Access, and so App Review, is needed for conversations with people who have no role on your app. With Standard Access, Instagram Login covers only accounts you own or manage. If accounts are linked through private keys such as an email or phone number, Meta says you can't retrieve those conversations until Advanced Access is approved. Setting up the Instagram Login token is covered in [Instagram Messaging API setup](/academy/articles/instagram-messaging-api-setup-instagram-login/).

## List conversations

The list call returns `data`, an array of conversations with `id` and `updated_time`, and a `paging` object with cursors. The [Page conversations reference](https://developers.facebook.com/docs/graph-api/reference/page/conversations/) (accessed 2026-11-04) accepts `platform` (`instagram` or `messenger`) and `user_id`, a PSID or Instagram-scoped ID that finds one person's thread. It also lists a `folder` parameter without documenting its values. "Time-based pagination is not available for the conversations endpoint," so you can't ask for threads since a date. Follow `paging.next` instead. Meta states no default or maximum page size.

The conversation object has `id`, `participants`, `messages` and `updated_time`, described as the time the last message was added ([Conversation reference](https://developers.facebook.com/docs/graph-api/reference/conversation)). Participants carry `id`, plus `name` and `email` on Pages or `username` on Instagram. Meta's sample response shows `updated_time` as a Unix timestamp, while the reference types it as a datetime. Parse both.

Conversations in the Requests folder that have been inactive for 30 days are not returned at all. Beyond that and the 20-message rule, Meta documents no date limit on how far back the list goes.

## Read the messages in a thread

`GET /<CONVERSATION_ID>?fields=messages` returns the thread's message IDs. Each ID then needs its own call, `GET /<MESSAGE_ID>?fields=id,created_time,from,to,message`. The [Message reference](https://developers.facebook.com/docs/graph-api/reference/message) lists `attachments`, `reactions`, `shares`, `story` (for story mentions and replies), `tags` and `is_unsupported` as well. The guide adds `reply_to`, with `mid` and `is_self_reply`. `message` is empty when the message has no text. `created_time` comes back as ISO 8601, such as `2022-07-12T19:11:07+0000`.

For shares, the guide returns only the image or video URL. Since March 26, 2026, post and reel shares sent in Messenger also carry their type (`post`, `ig_post`, `reel`, `ig_reel`) "with url, title and id" ([Messenger changelog, accessed 2026-11-24](https://developers.facebook.com/documentation/business-messaging/messenger-platform/changelog)).

Messages sent through the paid Messenger marketing API carry `marketing_message_id`, equal to the `message_id` used to send them. Meta added the field on October 29, 2026. That API is covered in [Messenger marketing messages](/academy/articles/messenger-marketing-messages-opt-in/).

Meta's samples on both guides don't run as pasted. The URLs break across lines inside quotes, the Instagram Login samples use `&` where `?` belongs, and the list response is invalid JSON. The script below writes its own requests with the Python 3.9 standard library. It lists every conversation, reads each message it can, and reports the ones Meta no longer returns.

```python
# history.py. Python 3.9+, standard library only.
# Messenger:     HOST=graph.facebook.com OBJECT=PAGE_ID PLATFORM=messenger TOKEN=PAGE_ACCESS_TOKEN python3 history.py
# IG via Page:   HOST=graph.facebook.com OBJECT=PAGE_ID PLATFORM=instagram TOKEN=PAGE_ACCESS_TOKEN python3 history.py
# IG Login:      HOST=graph.instagram.com OBJECT=me PLATFORM=instagram TOKEN=INSTAGRAM_USER_ACCESS_TOKEN python3 history.py
import json, os, sys, time, urllib.error, urllib.parse, urllib.request
from datetime import datetime, timezone

HOST = os.environ.get("HOST", "graph.facebook.com")
OBJECT = os.environ["OBJECT"]
PLATFORM = os.environ.get("PLATFORM", "messenger")
TOKEN = os.environ["TOKEN"]
PAUSE = 0.5  # Instagram: 2 Conversations API calls per second per professional account

def get(path_or_url, params=None):
    if path_or_url.startswith("https://"):
        url = path_or_url  # paging.next already carries the query string
    else:
        query = dict(params or {}, access_token=TOKEN)
        url = f"https://{HOST}/v26.0/{path_or_url}?{urllib.parse.urlencode(query)}"
    time.sleep(PAUSE)
    try:
        with urllib.request.urlopen(url) as res:
            return json.load(res), None
    except urllib.error.HTTPError as e:
        return None, json.load(e).get("error", {})

def parse_time(value):
    """Meta shows updated_time as Unix time in samples and types it as datetime in the reference."""
    if value in (None, ""):
        return None
    text = str(value)
    if text.isdigit():
        seconds = int(text) / 1000 if len(text) >= 13 else int(text)  # tolerate milliseconds
        return datetime.fromtimestamp(seconds, tz=timezone.utc)
    return datetime.strptime(text, "%Y-%m-%dT%H:%M:%S%z")  # e.g. 2022-07-12T19:11:07+0000

def main():
    page, err = get(f"{OBJECT}/conversations", {"platform": PLATFORM})
    if err:
        sys.exit(f"list failed, code {err.get('code')}: {err.get('message')}")
    while page:
        for conv in page.get("data", []):
            print(f"{conv['id']} last message {parse_time(conv.get('updated_time'))}")
            thread, err = get(conv["id"], {"fields": "messages"})
            if err:
                print(f"  thread error {err.get('code')}: {err.get('message')}")
                continue
            for item in thread.get("messages", {}).get("data", []):
                msg, err = get(item["id"], {"fields": "id,created_time,from,to,message"})
                if err:
                    if err.get("code") in (613, 80006):  # rate limited: stop instead of mislabelling
                        sys.exit(f"rate limited, code {err.get('code')}: {err.get('message')}")
                    # older than the 20 most recent: Meta reports it as deleted
                    print(f"  {item['id']} not returned: {err.get('message')}")
                    continue
                sender = msg.get("from", {})
                print(f"  {msg.get('created_time')} {sender.get('username') or sender.get('id')}: {msg.get('message', '')!r}")
        next_url = page.get("paging", {}).get("next")
        page = get(next_url)[0] if next_url else None

if __name__ == "__main__":
    main()
```

Meta doesn't say in what order the message IDs come back, so the script asks for each one and lets the API refuse. On a Page with long threads, those refusals are wasted calls against your rate limit. Cap the number of IDs per thread once you have seen the order in your own data.

## Use webhooks for the archive

The 20-message rule makes this API a sync tool. Meta's guide suggests it for loading past conversations when an Instagram business account is newly connected, and the cap keeps it from working as an export. The guide states the limit generally, while the Conversation reference places it under Instagram messages, and Meta doesn't settle whether Messenger threads differ. Plan for 20 on both.

Write each inbound message from the messaging webhook to your own table, keyed by message ID. Add each of your sends too, with the `message_id` from the Send API response ([Messenger Send API setup](/academy/articles/messenger-platform-send-api-setup-page-token/)). Run the Conversations API once at onboarding to fill the gap before the webhook subscription started. A table layout that works across channels is in [the conversation storage schema](/academy/articles/whatsapp-conversation-storage-database-schema/).

## Ownership with Conversation Routing

When several apps share a Page, request `fields=messages,is_owner` and reply only where `is_owner` is `true`. The field is returned only when Conversation Routing is enabled. Meta's sample for this call has no Page ID in its path. The request below adds one and is untested.

```bash
curl -s "https://graph.facebook.com/v26.0/<PAGE_ID>/conversations?platform=messenger&fields=messages,is_owner&access_token=<PAGE_ACCESS_TOKEN>"
```

If `is_owner` never appears, Conversation Routing isn't enabled for the Page. Passing one thread between a bot and a person is a separate mechanism, covered in [the Messenger handover protocol](/academy/articles/messenger-handover-protocol-bot-to-human/).

## Rate limits and errors

On Instagram, "Your app can make 2 calls per second per Instagram professional account" on the Conversations API ([Graph API rate limiting, accessed 2026-11-04](https://developers.facebook.com/docs/graph-api/overview/rate-limiting)). The script's half-second pause follows that. Messenger has no per-second figure for this API. Its budget is 200 calls per engaged user in 24 hours, where engaged users are the people the business can message. More detail is in [Instagram Messaging API rate limits](/academy/articles/instagram-messaging-api-rate-limits/).

The Page conversations reference lists these errors.

| Code | Meaning | What to do |
| --- | --- | --- |
| 80006 | Too many Messenger API calls to this Page | Back off, then resume from the last `paging.next` |
| 613 | Call rate limit exceeded | Back off |
| 200, 230 | Permissions error; permissions disallow messaging this user | Check the scopes and the Page task |
| 190 | Invalid OAuth 2.0 access token | Get a new token |
| 100, 2500 | Invalid parameter; error parsing the query | Check `platform` and the `fields` string |
| 368 | Action deemed abusive or disallowed | Stop and review the account |
| 104 | Incorrect signature | Check how the request is signed |

*Z-API Omni team*
