RobotRock
Chats & agents

Chats API

Use client.chats when your agent or automation should open a chat for a human — for example a nightly cron that opens a review thread, or a parent agent spawning a child conversation.

Chats are separate from one-off sendToHuman tasks: a chat is a long-lived Eve session with a transcript, a single owner, and a deep link into the inbox.

Client setup

Use the same createClient module as tasks. Authenticate with your workspace API key (ll_* from Settings → API Keys).

// lib/robotrock.ts
import { createClient } from "robotrock";

export const robotrock = createClient({
  app: "my-agent",
});
ROBOTROCK_API_KEY=ll_your_api_key_here

Create a chat

import { robotrock } from "@/lib/robotrock";

const { tenantSlug, chats } = await robotrock.chats.create({
  agentIdentifier: "support-agent",
  title: "Review overnight escalations",
  ownerEmail: "alex@example.com",
  messages: [
    {
      role: "assistant",
      content: "Three tickets need your review from last night.",
    },
  ],
});

const chat = chats[0];
console.log(chat.deepLink); // open in RobotRock inbox
console.log(chat.chatId);
FieldRequiredDescription
agentIdentifierYes*Eve agent slug (agentIdentifier on the deployment)
parentChatIdYes*Spawn from an existing chat (inherits agent, connection, owner)
titleYesShown in the conversation list
ownerEmailYes**Email of the user who owns the chat in the inbox
appNoInbox app bucket (defaults to client app)
connectionIdNoSpecific Eve connection when a tenant has several
messagesNoSeed transcript (defaults to the agent welcome message)
sourceNoProvenance label for audit ("api", "cron", "agent", …)

* Provide either agentIdentifier or parentChatId.

** Required when parentChatId is not set. Child chats inherit the parent owner.

The response includes deepLink — a path under your tenant inbox with agent and session query params.

Close a chat

When the agent is done, archive the session:

await robotrock.chats.close(chat.chatId, {
  reason: "All items reviewed",
});

Eve HITL audit helpers

For custom Eve hooks that run outside the dashboard UI, the chats namespace also supports:

MethodPurpose
stageHitlRequestsPersist pending Eve HITL requests on the chat for durable audit
getStagedHitlRequestsRead staged requests by eveSessionId
logInputSubmissionRecord an Eve HITL choice on the audit trail
linkTaskAssociate an inbox task with the originating Eve session

These mirror the POST /v1/agent-chats/* routes on the RobotRock API. Most Eve agents use the built-in RobotRock integration instead of calling these directly.

HTTP endpoints

MethodPathDescription
POST/v1/agent-chatsCreate a chat owned by a user
POST/v1/agent-chats/:chatId/closeArchive a chat
POST/v1/agent-chats/stage-hitlStage Eve HITL requests
GET/v1/agent-chats/staged-hitlList staged HITL requests
POST/v1/agent-chats/audit-inputLog HITL input submission
POST/v1/agent-chats/link-taskLink inbox task to Eve session

All routes require the same API key auth as task creation. Rate limits and daily usage match the task API.

On this page