POST
/
v2
/
workspaces
/
{workspace_id}
/
sessions
/
{session_id}
/
messages
/
upload
JavaScript
import Honcho from '@honcho-ai/core';

const client = new Honcho({
  apiKey: 'My API Key',
});

const messages = await client.workspaces.sessions.messages.upload('workspace_id', 'session_id', {
  file: fs.createReadStream('path/to/file'),
  peer_id: 'peer_id',
});

console.log(messages);
[
  {
    "id": "<string>",
    "content": "<string>",
    "peer_id": "<string>",
    "session_id": "<string>",
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "workspace_id": "<string>",
    "token_count": 123
  }
]

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
session_id
string
required

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type Message · object[].