Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.corti.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use createInteraction() to create a new interaction session before navigating into it or starting recording.
Applies to Web Component, Window API, and PostMessage. Examples on this page use the Web Component API shape.

Usage

const interaction = await api.createInteraction({
  assignedUserId: null,
  encounter: {
    identifier: `encounter-${Date.now()}`,
    status: "planned",
    type: "first_consultation",
    period: {
      startedAt: new Date().toISOString(),
    },
    title: "Initial Consultation",
  },
});

Prerequisites

  • User must be authenticated.

Input validation

  • encounter.identifier: Required, non-empty string.
  • encounter.status: Must be one of "planned", "in-progress", "completed", or "cancelled".
  • encounter.type: Must be one of the supported encounter types.
  • encounter.period.startedAt: Required ISO 8601 datetime string.
  • encounter.title: Optional string.
  • assignedUserId: Optional string or null.

Possible errors

  • UNAUTHORIZED: User not authenticated.
  • INVALID_PAYLOAD: Missing required fields, invalid encounter status or type, or invalid date format.
  • INTERNAL_ERROR: Failed to create interaction.

Returns

{
  id: string,
  createdAt: string,
  status?: string
}

Notes