> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS Conversations

> Monitor real-time SMS threads, review PHI risk before sending, compose and schedule messages, and retry failed sends.

The SMS Conversations page at `/ce/sms/conversations` is an operator queue for viewing real-time SMS threads filtered by phone number or contact context, composing outbound messages with PHI guardrails, and managing scheduled and failed sends.

## Overview

Navigating to `/ce/sms/conversations` loads `SmsConversationsPage`, gated by `ce.sms.admin`. The page accepts optional `phone`, `contactId`, `leadId`, and `partnerId` URL search params. When a phone number is loaded, the page renders a two-column view: the left shows a live `SmsConversation` thread via `useRealtimeSmsMessages`; the right shows a compose card with PHI warning, scheduled message list, and a retry prompt for the latest failed outbound message. An inbound message toast (`SmsNotificationToast`) fires for new inbound messages.

## Who it's for

Permission required: `ce.sms.admin`

## Before you start

* A phone number or contact context must be supplied; without it, the page shows an empty state prompting for a phone number.
* RingCentral (or equivalent telephony) must be configured for outbound sends to succeed.

## Steps

<Steps>
  <Step title="Open SMS Conversations">
    Navigate to `/ce/sms/conversations`. Alternatively, open from a contact or lead context — the relevant `contactId` or `leadId` is appended to the URL automatically.
  </Step>

  <Step title="Load a conversation">
    Enter a phone number in the **Conversation Filter** card and click **Load Conversation**, or navigate with a `?phone=` query param.
  </Step>

  <Step title="Review the thread">
    The left column shows the chronological SMS thread. A connection status indicator shows whether the realtime channel is live.
  </Step>

  <Step title="Compose and send a message">
    In the right compose card, type a message. The PHI warning (`SmsPhiWarning`) will block send if the draft contains flagged content. Click **Send Message** to deliver immediately.
  </Step>

  <Step title="Schedule a message (optional)">
    Use `SmsSchedulePicker` to queue a message for a future time. Scheduled messages appear in the list below the compose area.
  </Step>

  <Step title="Retry a failed send">
    If the latest outbound message failed, a retry prompt appears at the bottom of the compose card. Click **Retry Failed Send** to re-queue it.
  </Step>
</Steps>

## Key concepts

* **PHI guardrail** — `usePhiBlockCheck` analyzes the draft message and blocks send if PHI patterns are detected. The send button is disabled while a block is active.
* **Realtime updates** — `useRealtimeSmsMessages` subscribes to live message updates; a connection indicator shows channel status.
* **Scheduled messages** — Up to 5 pending scheduled messages are shown per conversation. Queued messages can be cancelled; failed ones show a status badge.
* **Inbound toast** — When a new inbound message arrives after the initial load, `SmsNotificationToast` fires with a link to the contact.

## Related

<Columns cols={2}>
  <Card title="Community Engagement" icon="bullhorn" href="/ce/overview">
    Community Engagement core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index" />
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/ce.tsx
  * src/cores/ce/pages/SmsConversationsPage.tsx
  * src/cores/ce/hooks/useRealtimeSmsMessages.ts
  * src/cores/ce/hooks/useSmsSend.ts
  * src/cores/ce/hooks/usePhiBlockCheck.ts
  * src/cores/ce/components/sms/SmsConversation.tsx
</Accordion>
