> ## Documentation Index
> Fetch the complete documentation index at: https://developers-staging.fmgsuite.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a Text Message

> Send an SMS from the advisor's MyRepChat number to any phone number — one call in the common case.

Sending a text is one `POST`. The message goes out **from the advisor's own
MyRepChat number**, lands in their MyRepChat conversation history, and is
archived like any other message they send.

## Request

```bash theme={null}
curl -X POST "$MRC_API_BASE/v1/mrc/messaging/messages" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "x-api-key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+12185551234",
    "text": "Hi Sam — your quarterly review is confirmed for Tuesday at 2pm."
  }'
```

| Field              | Required      | Notes                                          |
| ------------------ | ------------- | ---------------------------------------------- |
| `text`             | yes           | 1–1599 characters                              |
| `phone`            | yes\*         | The recipient's phone number. E.164 preferred. |
| `scheduleDelivery` | no            | `true` to schedule instead of sending now      |
| `deliveryDate`     | with schedule | Epoch milliseconds                             |
| `frequency`        | with schedule | `0` = once                                     |

\* `phone` is the partner-facing way to address a recipient. The schema also
accepts `members[]` (MRC contact ids) if you've stored `memberId` values from
earlier responses — never required.

<Note>
  **Unknown numbers create a contact.** If the advisor has no contact with
  this number, MRC creates one on their account (and may import details from
  the advisor's CRM). Existing contacts are never modified by an API send.
</Note>

## Response — per-recipient outcomes

`200` means the request was processed; look inside for each recipient's
outcome:

```json theme={null}
{
  "successes": [{ "messageId": 535, "memberId": 24 }],
  "failures": []
}
```

* **`successes[]`** — accepted for delivery. Store `messageId` if you want to
  correlate with delivery status later (endpoint upcoming), and `memberId` if
  you want to skip phone resolution on future calls (optional).
* **`failures[]`** — this recipient did not get the message, with a
  human-readable reason. The one you must handle programmatically is
  consent:

```json theme={null}
{
  "successes": [],
  "failures": ["Message for [Sam Client] not sent. Member has not consented"]
}
```

That's your signal to run the [consent flow](/mrc/guides/consent) and resend.

```mermaid theme={null}
flowchart LR
    A["POST /messages<br/>{ phone, text }"] --> B{Response}
    B -->|"successes: [ … ]"| C[Delivered from the<br/>advisor's number ✓]
    B -->|"failures: [ 'has not consented' ]"| D["Consent flow →<br/>request · poll · resend"]
    B -->|"4xx / 5xx problem+json"| E["Fix request / retry<br/>per the error table"]
    D --> A
```

## Scheduled sends

```json theme={null}
{
  "phone": "+12185551234",
  "text": "Reminder: paperwork due Friday.",
  "scheduleDelivery": true,
  "deliveryDate": 1790000000000,
  "frequency": 0
}
```

Scheduled messages appear in the advisor's MyRepChat scheduled queue — the
advisor can see and cancel them in-app, exactly as if they scheduled it
themselves.

## Limits and notes

* **SMS only at launch** — `mediaId` (MMS) is not yet available to partner
  applications.
* Messages longer than one SMS segment are segmented by the carrier as usual;
  the 1599-character cap is the platform limit.
* Whole-request errors (bad token, malformed body, rate limit) come back as
  `application/problem+json` — see the
  [error table](/mrc/guides/integration-guide#error-handling).
