---
title: "Page messages oldest or newest first"
description: "PubNio API inbox.messages.list: page messages oldest or newest first. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Page messages oldest or newest first

Page messages oldest or newest first with [`GET /api/v1/inbox/conversations/{conversationId}/messages`](https://pubnio.com/api/v1/docs#tag/inbox/GET/api/v1/inbox/conversations/{conversationId}/messages). Requires an API key with the `read` scope or a signed-in workspace member.

## Request

| Parameter        | In    | Type                   | Required |
| ---------------- | ----- | ---------------------- | -------- |
| `conversationId` | path  | UUID                   | Yes      |
| `workspaceId`    | query | UUID                   | Yes      |
| `order`          | query | `"oldest"`, `"newest"` | No       |
| `cursor`         | query | string                 | No       |
| `limit`          | query | string                 | No       |

## Response

- HTTP 200: `InboxMessageList` with `data`, `hasMore`, `nextCursor`.

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const messages = await workspace.inbox.messages(conversationId, {
  order: "newest",
});
```

### Python

```python
messages = workspace.inbox.list_messages(conversation_id)
```

### cURL

```sh
curl "https://pubnio.com/api/v1/inbox/conversations/$CONVERSATION_ID/messages?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY"
```

### CLI

```sh
pnio inbox messages list "$CONVERSATION_ID" --order newest
```

### MCP execute

```js
async () => {
  const conversationId = "<conversationId>";
  const response = await codemode.request({
    method: "GET",
    path: `/api/v1/inbox/conversations/${conversationId}/messages`,
    query: { workspaceId: codemode.workspaceId },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [every Inbox operation](https://pubnio.com/docs/reference/#inbox) and [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

None needed: a read is safe to retry.

## Limits

- Up to 100 items a page; pass `nextCursor` back as `cursor`. See [Pagination](https://pubnio.com/docs/concepts/pagination/).

## Related

- [Inbox operations](https://pubnio.com/docs/reference/#inbox)

Source: https://pubnio.com/docs/reference/inbox-messages-list/index.mdx
