Skip to main content
Guest conversation claiming helps website chat flows merge anonymous visitor conversations into a real customer profile. Use it after a visitor signs in, submits their email, or otherwise becomes known.

Claim Guest Conversations

const result = await plato.v1.connect.claimGuestConversations.mutate({
  fingerprint: "browser_fingerprint_value",
  guestExternalId: "guest_123",
  customer: {
    externalId: "customer_123",
    name: "Jane Customer",
    email: "[email protected]",
  },
  targetParentId: "known_customer_conversation_id",
  claimMetadata: {
    source: "website-login",
  },
});

Input

{
  fingerprint: string;
  guestExternalId?: string | null;
  guestLocalConversationId?: string | null;
  targetParentId?: string | null;
  customerId?: string | null;
  customer?: {
    id?: string | null;
    externalId?: string | null;
    name?: string | null;
    email?: string | null;
    phone?: string | null;
    image?: string | null;
    metadata?: Record<string, unknown> | null;
  } | null;
  claimMetadata?: Record<string, unknown> | null;
}
Either customerId or customer is required.

Response

{
  claimed: 2,
  reparented: 1
}
claimed is the number of conversations matched and attached to the known customer. reparented is the number of child conversations moved under targetParentId.

When To Use It

Use this flow when:
  • A visitor starts chat before signing in.
  • A website creates a temporary conversation id in local storage.
  • A later login should connect old chat history to the real customer.

Notes

  • fingerprint must be at least 8 characters.
  • targetParentId must belong to the same workspace as the API key.
  • The API removes guest-only participants when it can safely replace them with the real customer.
  • Conversations with business records are preserved.