Messages
Messages are how your agent texts people: SMS and MMS over the cellular network, and iMessage to Apple devices. The same POST /v1/messages endpoint covers every channel — the platform delivers over iMessage when it can and falls back to SMS/MMS otherwise. Messages thread automatically into conversations, and the channel field on each message tells you how it was delivered.
In this guide
- Channels: what SMS/MMS vs iMessage support
- Sending messages: send text and media, and choose which number to send from
- SMS & MMS: cellular texting, images, and 10DLC for outbound
- iMessage: threaded replies, send effects, reactions, group chats, typing indicators, and backgrounds
- Conversations & history: list/get/update conversations and read message history
- Webhooks: inbound messages arrive via webhook — see Webhooks
Channels
AgentPhone sends over three channels through one endpoint. The platform picks the best one automatically and reports it back in the channel field (sms, mms, or imessage). Your code works the same across channels — the differences are in what features are available.
SMS & MMS
Standard text messaging over the cellular network. Works with any phone number.
- Outbound requires 10DLC registration (carrier requirement for US numbers)
- Inbound works immediately — no registration needed
- Images arrive as MMS (
channel: "mms")
iMessage
Apple’s messaging protocol. Delivered over the internet to Apple devices, with automatic SMS fallback for non-Apple recipients.
- No 10DLC registration required
- Supports reactions (tapbacks), threaded replies, send effects, rich media, image carousels, and group chats
channelis"imessage"for messages delivered via iMessage
Capabilities
The iMessage-only rows above degrade gracefully: if you set send_style or reply_to_message_id on a message that ends up delivered over SMS, the text still sends and the iMessage-only behavior is simply dropped.
Sending messages
Send an outbound SMS, MMS, or iMessage with a single endpoint. The platform automatically delivers over iMessage when the recipient and your sending number both support it, and falls back to SMS/MMS otherwise. The channel in the response tells you how it was actually delivered.
Request body
Choosing the sending number
Specify the sender one of three ways, in order of precedence:
from_number— the exact E.164 number you want to send from.number_id— the ID of one of your numbers.agent_id— sends from the agent’s first attached number.
Pass at least one. from_number and number_id win over agent_id if both are present.
Example
Sending media
Attach a single file with media_url, or several with media_urls. The body can be empty if you’re only sending media.
On iMessage, multiple URLs arrive as a single image carousel. Over SMS the message is delivered as MMS. See Media for how inbound attachments are represented.
SMS & MMS
SMS and MMS are the cellular channels — they reach any phone number, Apple or not, and are the automatic fallback when iMessage isn’t available.
- Text goes out as
channel: "sms"and works with any recipient. - Images are sent as MMS: pass
media_urlormedia_urls; to a non-iMessage recipient they arrive aschannel: "mms". - Outbound to US numbers requires 10DLC registration (a carrier requirement); inbound needs no registration. See Messaging Rate Limits for throughput.
- The iMessage-only options (
send_style,reply_to_message_id) are silently ignored when a message is delivered over SMS — the text still sends.
iMessage
When the recipient and your sending number both support iMessage, messages deliver over iMessage (channel: "imessage") and unlock the rich features below. Each one degrades gracefully on SMS: the text still sends, and the iMessage-only behavior is simply dropped.
Threaded replies
On iMessage you can send a message as an inline reply to an earlier message, so it renders threaded under the original in the recipient’s chat. Pass the AgentPhone message ID of the parent as reply_to_message_id.
The parent ID is any Message.id from the conversation, such as the id on an inbound webhook message or a message from Get conversation messages. The response echoes back reply_to_message_id, plus a reply_parent_unresolved flag:
Threaded replies are an iMessage feature. On SMS the message is delivered normally without threading, and reply_parent_unresolved will be true.
Send effects
iMessage supports expressive send effects — the screen and bubble animations you get from the iMessage compose screen (Slam, Confetti, Fireworks, etc.). Set send_style to apply one.
Send effects are iMessage-only. On SMS the text is delivered without any effect. Use them sparingly — they’re great for confirmations and celebratory moments, not every message.
Reactions
iMessage supports tapback reactions — the emoji responses users can add to individual messages (heart, thumbs up, etc.). Reactions are only available on iMessage channels.
Send a reaction
Reacting to an image in a carousel works the same way — use the message ID of the specific image.
Reactions are an iMessage feature. Attempting to react to a message on an SMS number will return a 400 error.
Receive reactions
When someone reacts to a message your agent sent, an agent.reaction webhook event is fired. See Webhooks for the payload format.
Group chats
Group chats are an iMessage feature. When your number is added to a group thread, all members’ messages flow into a single conversation marked isGroup: true, keyed on the group identifier rather than a single participant. SMS numbers cannot participate in group threads.
Group conversations and messages carry extra fields:
Replying to a group
To post into the group thread, call POST /v1/messages with to_number set to the groupId (grp_...), not an individual member’s number. Sending to a member’s number would start a separate one-to-one conversation with that person.
Group replies support the same threaded replies and send effects as one-to-one iMessage. To reply directly to a specific member’s message in the thread, pass that message’s ID as reply_to_message_id.
Inbound group messages are delivered to your webhook with the full group roster and the sending member inline, so you can attribute and route without a follow-up fetch. See Webhooks for the event payload and a routing example.
Typing indicator
Show a typing bubble in an iMessage conversation. This signals to the recipient that your agent is composing a response.
The request body is empty. The indicator auto-expires after a few seconds, so there’s no “stop typing” call needed. Send it right before your agent starts generating a response.
Typing indicators are best-effort on iMessage only. The provider may silently drop the indicator if the chat hasn’t had recent activity, the recipient isn’t on iMessage, or it’s a group chat.
Chat backgrounds
Set a custom background image for an iMessage conversation. The background is visible to the recipient inside the chat, and is a nice touch for branded or themed experiences.
Set a background
The changed flag is false when the requested image was already set, so re-sending the same background is a safe no-op. backgroundVersion increments each time the image actually changes.
Remove a background
Chat backgrounds are an iMessage feature and apply per conversation. Setting one on an SMS conversation has no effect.
Conversations & history
A conversation is the thread between one of your numbers and an external participant (a single contact, or a group on iMessage). Each tracks full message history and supports custom metadata for storing session state. These endpoints are channel-agnostic.
List conversations
List all conversations for this project, sorted by most recent activity.
Query parameters
Example
Get conversation
Get a conversation with its recent messages.
Query parameters
Example
Update conversation
Update conversation metadata (state). Use this to store custom context for AI agents, such as customer information, business context, or session state.
The metadata is included in webhook payloads as conversationState, enabling your AI backend to maintain context across messages.
Request body
Example
Get conversation messages
Get paginated messages for a conversation. Use before/after for cursor-based pagination through large message histories.
Query parameters
Example
Message fields
Media
When someone sends an image, video, or file, the message includes a mediaUrl pointing to the hosted media. The body may be empty if only media was sent.
Image carousels (multiple images sent at once) arrive as separate messages, each with its own mediaUrl.
Media works on both iMessage and MMS (SMS with images). When an image arrives via SMS, the channel is "mms".

