Skip to main content

Events, logs & expressions

Event definitions and custom events, request/live logs, and the expression catalog + evaluator. Available as mgr.events, mgr.logs, and mgr.expressions. Integration action dispatch and single-action variables live on mgr.integrations.

Events​

const events = await mgr.events.list();
const custom = await mgr.events.createCustom({ /* CustomEventRequest */ });
await mgr.events.deleteCustom(custom.item.id);

Logs​

for await (const entry of mgr.logs.audit()) console.log(entry); // request audit log, auto-paged
const live = await mgr.logs.live();

Live logging & custom log entries​

Toggle live logging on or off, or write a custom log entry.

await mgr.logs.enableLive();
await mgr.logs.disableLive();
await mgr.logs.write({ /* WriteLogRequest */ });

Expressions​

expressions.list() returns the expressions your account can use in automations and webhook payloads. Two of them name agents in a post-call automation: {agent.email} is the recording's agent (the first agent connected to the caller), and {session.agents.email} lists every agent who was on a leg of the call — transfer targets and conference members included — as a JSON array of email addresses: the event's agent first, then the others in the order they were connected ([] when there is none).

const available = await mgr.expressions.list();
const result = await mgr.expressions.evaluate({ /* EvaluateExpression */ });

Integration action dispatch​

await mgr.integrations.dispatchAction(integrationId, action, { /* IntegrationDispatchActionRequest */ });
const vars = await mgr.integrations.actionVariables("salesforce", actionName);

Reference​