POST
/
v2
/
workspaces
/
{workspace_id}
/
peers
/
{peer_id}
/
messages
/
list
import Honcho from '@honcho-ai/core';

const client = new Honcho({
  apiKey: process.env['HONCHO_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const message of client.workspaces.peers.messages.list('workspace_id', 'peer_id')) {
  console.log(message.id);
}
{
  "items": [
    {
      "id": "<string>",
      "content": "<string>",
      "peer_id": "<string>",
      "session_id": "<string>",
      "metadata": {},
      "created_at": "2023-11-07T05:31:56Z",
      "workspace_id": "<string>",
      "token_count": 123
    }
  ],
  "total": 1,
  "page": 2,
  "size": 2,
  "pages": 1
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspace_id
string
required

ID of the workspace

peer_id
string
required

ID of the peer

Query Parameters

reverse
boolean | null
default:false

Whether to reverse the order of results

page
integer
default:1

Page number

Required range: x >= 1
size
integer
default:50

Page size

Required range: 1 <= x <= 100

Body

application/json

Filtering options for the messages list

Response

200
application/json

Successful Response

The response is of type object.