Skip to main content

getAgentInbox

client.mail.getAgentInbox(agentId: string): Promise<MailMessage[]>

Retrieves the inbox messages for a specific agent.

Returns all unread and pending messages directed to the specified agent. This is the primary way an agent checks for new incoming communications.

Parameters

ParameterTypeRequiredDescription
agentIdstringYesThe unique identifier of the agent whose inbox to fetch

Returns

Promise<MailMessage[]> — A promise that resolves to an array of inbox messages

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.mail.getAgentInbox('agentId');
console.log(result);