List messages in an inbox
list_messagesList messages for one number, newest first, received and sent.
Each item says who it is from and to, which number it belongs to, its
direction, content_type, origin, a short preview, at, status
and content_expired. Mentions, transcription and full media detail
are only on get_message, so fetch the one message you care about
rather than paging for detail.
To read a group, find its grp_ id with list_groups and pass it as
group_id. contact_id returns what that contact sent or received,
which in a group includes what they said there. direction keeps only
inbound or outbound. Filters combine: group_id with contact_id
answers what one person said in one group.
Ids belong to one number, so use the same number_alias you got them
from: an id from another number answers not found. For the next page,
pass back the cursor from the previous response together with the
same filters.
Content older than the plan's retention window comes back with
preview empty and content_expired true. The message, its sender and
its group stay listed for 12 months.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many items to return, 1-200. Defaults to 50. | |
| cursor | No | Opaque cursor for the next page. Pass back the `cursor` from the previous response, with the same filters; omit it for the first page. | |
| group_id | No | Only the messages of one group (`grp_…`, from `list_groups`). The group must be one of this number's: an id from another number answers not found. Can be combined with `contact_id`. | |
| direction | No | Only messages the number received (`inbound`) or sent (`outbound`). Absent means both. | |
| contact_id | No | Only the messages this contact sent or received (`ct_…`, from `list_contacts`). In a group that includes what the contact said there. The contact must be one of this number's: an id from another number answers not found. With `group_id` too, you get what that contact said in that group. | |
| number_alias | No | Which of the organization's WhatsApp numbers this acts on: `main`, the alias of an extra number, or the number's `id` (`num_…`), which stays the same when the alias is renamed. Call `list_numbers` to see them. Defaults to the main number. | main |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||