Skip to main content
Conversations provide a way to group related messages and interactions within your application. Each conversation acts as a container that maintains context and history for a specific chat session.

Use Cases

  • Customer support chats: Track individual support sessions
  • Multi-turn agent interactions: Maintain context across agent executions
  • User chat history: Organize conversations by user or session

Quick Start

import { Orq } from '@orq-ai/node';

const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });

// Create a conversation
const conversation = await orq.conversations.create({
  displayName: 'Support Chat #1234',
});

// List all conversations
const { data } = await orq.conversations.list({ limit: 10 });

// Retrieve a specific conversation
const retrieved = await orq.conversations.retrieve(conversation._id);

// Update the display name
await orq.conversations.update(conversation._id, {
  displayName: 'Resolved: Support Chat #1234',
});

// Delete when no longer needed
await orq.conversations.delete(conversation._id);

Conversation Object

FieldTypeDescription
_idstringUnique identifier (prefixed with conv_)
kindstringAlways "conversation"
displayNamestringHuman-readable name (1-100 chars)
createdAtnumberUnix timestamp (ms)
updatedAtnumberUnix timestamp (ms)
createdByIdstringCreator identifier (optional)
updatedByIdstringLast updater identifier (optional)

Pagination

List endpoints support cursor-based pagination:
ParameterDescription
limitNumber of results (1-100, default: 10)
starting_afterCursor for forward pagination
ending_beforeCursor for backward pagination
// Get next page
const page1 = await orq.conversations.list({ limit: 10 });
const page2 = await orq.conversations.list({
  limit: 10,
  starting_after: page1.data[page1.data.length - 1]._id,
});

API Reference