Recipients
Recipients are the humans who receive and respond to requests from your AI agents. For method details, see the TypeScript SDK reference.
Creating Recipients
Recipients can be created explicitly or auto-created when referenced in session creation:
// Explicitconst recipient = await client.recipients.create({ name: "John Doe", email: "john@example.com",});
// Auto-created via session — just pass an emailconst session = await client.sessions.create({ name: "Review", recipients: [{ email: "john@example.com" }],});At least one of email or externalId is required.
Inbox Experience
Recipients access their inbox via a magic link (passwordless):
- You send an invite (
notify: trueon session creation, orclient.recipients.sendInvite()) - Recipient receives an email with a magic link
- Clicking the link authenticates them in the browser
- They see all their active sessions, messages, and input fields in real-time
For recipients without email (e.g., Slack users), get the magic link URL directly with client.recipients.getInviteUrl() and deliver it yourself.
Multi-Recipient Sessions
Sessions can have multiple recipients. The first to respond wins:
const session = await client.sessions.create({ name: "Approval", recipients: [ "approver1@example.com", "approver2@example.com", ], notify: true,});
const { approved } = await session.ask("Approve?", { inputs: [{ type: "confirm", name: "approved" }] as const,});// First recipient to respond provides the answerFirst-Write-Wins
- All recipients see the question in their inbox
- The first one to respond provides the answer
- Other recipients see that it was already answered
Useful for on-call rotations, approval workflows with backup approvers, and team-based task assignment.
Next Steps
- Sessions Guide — Session concepts and patterns
- Callbacks Guide — Async notifications
- TypeScript SDK — Full method reference