Skip to main content
Chert includes native text formatting for iMessage. Send plain text in value and describe styles with text_decorations; Markdown asterisks remain literal.
Formatting is an existing line-enabled preview. Confirm access with Chert before using it. The initial scope is one text part in an existing phone-addressed iMessage direct chat. Group messages, replies, attachments, SMS/RCS, and animated text effects are outside this preview. Other lines can reject decorated requests with code 4099; do not assume every Chert API host or SDK accepts them.

Send formatted text

Use POST /api/v1/chats/{chat_id}/messages on the enabled line. Save this body as formatted-message.json and use a stable idempotency key for this operation:

Range rules

  • range is [start, end): zero-based UTF-16 code units, with an exclusive end.
  • Supported styles are bold, italic, underline, and strikethrough.
  • Ranges must be nonempty, inside value, and must not split a surrogate pair. JavaScript string offsets use UTF-16; Python character offsets need conversion when the text contains characters outside the Basic Multilingual Plane.
  • Different styles can overlap. Equivalent adjacent/overlapping ranges of the same style are combined. At most 256 input decorations are accepted.
  • Preserve the exact text used to calculate offsets. This path does not trim or normalize the text before applying styles.

Acceptance, status, and inbound formatting

A new accepted request returns HTTP 202 with a message object containing id, chat_id, the decorated parts, and status: "queued". Save message.id and use GET /api/v1/messages/{id} to inspect recorded status. Neither a queued receipt nor a delivery status proves the recipient rendered each style. Reuse the same key and identical text/styles when reconciling the original operation. Changing the request under that key conflicts. An unconfirmed result with retryable: false must not trigger another send or a new key. On enabled lines, message.received.data.message.parts[] and recorded chat history can contain the same text_decorations shape. Keep value as readable plain text when your client cannot render styles. Missing decorations do not establish that the sender used no formatting. See Send a message and Receiving replies.