JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.chat.retrieveHistory('chat_id');
console.log(response);curl https://api.morphik.ai/chat/$CHAT_ID \
-H "Authorization: Bearer $MORPHIK_API_KEY"[
{
"role": "user",
"content": "<string>",
"timestamp": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}API Reference
Get Chat History
Retrieve the message history for a chat conversation.
GET
/
chat
/
{chat_id}
JavaScript
import Morphik from 'morphik';
const client = new Morphik({
apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
});
const response = await client.chat.retrieveHistory('chat_id');
console.log(response);curl https://api.morphik.ai/chat/$CHAT_ID \
-H "Authorization: Bearer $MORPHIK_API_KEY"[
{
"role": "user",
"content": "<string>",
"timestamp": "<string>"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Was this page helpful?

