Messages
Send SMS and MMS from your business number, and search every message body and call transcript.
Messages are activities inside a conversation. Sending through the API is exactly like a teammate typing in the app: the text goes out from your business number, appears in the thread, and the reply comes back to the same thread (and to your message.received webhook).
US carriers require a 10DLC registration before a local number can send texts. Until the campaign is approved, a live POST /messages returns 409 failed_precondition, and the message says exactly what's missing (not filed, in carrier review, waiting for a PIN, or rejected). Check canText with GET /messaging. Some newly filed numbers can text earlier because Ody temporarily attaches them to its own approved campaign while yours is reviewed. Test keys skip this gate, since nothing is sent.
#Send a message
/v1/api/messagesSends an SMS, or an MMS when you include mediaUrls. Address it in one of two ways:
conversationId: reply in an existing thread, from that thread's number.to: an E.164 number. Ody finds or creates the thread from your workspace number, or fromfromif you own that number.
Delivery is asynchronous. The response returns once the carrier has accepted the message; the final outcome arrives as message.delivered or message.failed.
With a test key (ody_test_…) the message is recorded with deliveryStatus: "simulated" and nothing is sent.
Scope: messages:send · supports Idempotency-Key
Body
bodystring required — The text. Longer messages are split into segments by the carrier.conversationIduuid — Reply in this thread. Use this orto.tostring — Recipient in E.164. Use this orconversationId.fromstring — One of your workspace numbers, used when starting a thread withto. Ignored forconversationId(a reply always goes out from the thread's number). Defaults to your workspace number.mediaUrlsarray of URLs — Up to 10 publicly fetchable images or files. Each must be anhttps://URL;http://returns400 invalid_argument. Ody fetches, sniffs and sanitises each file, then puts them on one hosted page when the workspace has Hosted files on (the default) — or sends them as MMS when it fits the limits below with Hosted files off. There is no per-send flag; asendAsLinkkey is ignored.
MMS limits (Hosted files off). MMS works for US and Canadian (+1) numbers only. The whole message must fit the carrier limit for the sending number: about 1 MB from a local number (AT&T and Verizon; T-Mobile allows 1.5 MB) and 600 KB from a toll-free number. With Hosted files off, Ody plans each attachment against that budget: photos are resized to the sharpest rendition that fits; what can't fit (or any file sent to a non-+1 number) goes out as a bare secure link. With Hosted files on (the default) the budget never comes into play — every attachment is on the page. Those attachments show media[].delivery: "link" with linkExpiresAt — and, for pages, hostedUrl / hostedMediaId — on the activity.
#Hosted pages
When the workspace has Hosted files on (Settings → Analytics → Hosted files in the Ody app, or PATCH /hosted-media; on by default since 2026-11-07):
- Every attachment of the send — one photo, one PDF, a gallery of twelve — goes on one page: one text, one
link.ody.co/m/<token>line, full-quality photos opened on the first one. Nothing rides as an MMS frame and there is no per-send choice. - The text that goes out is
body, a newline, then<title>: link.ody.co/m/<token>—3 photos,1 video,quote.pdf,3 files. - The response's
message.hostedMedia[]lists each page:id,title,layout(gallery·single·mixed),itemCount,openCount,uniqueOpenCount,viewedItems,saves,websiteClicks,firstOpenedAt,lastOpenedAt,expiresAt,revokedAt.urlisnullthere (the token is stored only as a hash) — readmedia[].hostedUrlon the same activity for the page URL. The same array appears on activities returned byGET /conversations/:id, where the thread also carries synthesizedtype: "system"entries withmediaOpenfor each page the recipient opened. - Each human open fires
media.opened; a Save firesmedia.downloaded.
With Hosted files off, the send is exactly the pre-hosted-files behaviour: MMS when it fits, https://api.ody.co/m/<token> raw secure links otherwise, and hostedMedia is absent.
Returns 201 with { message: Activity, conversationId, simulated? }.
Errors: 409 when the workspace has no active number or texting isn't registered yet; 404 for an unknown conversationId.
#Tracked links
When the workspace has link tracking on (Settings → Analytics in the Ody app, or PATCH /link-tracking from code; on by default since 2026-11-07), every http(s) URL in body is sent as a scheme-less link.ody.co/<code> short link (phones auto-link it; trackedLinks[].shortUrl carries the absolute https:// form) that 302-redirects to your URL, with the workspace's UTM template appended (defaults to utm_source=ody&utm_medium=sms&utm_campaign=ody_api&utm_content=c_<contactRef> for API sends). You keep sending the normal URL; the rewrite happens server-side:
message.bodyin the response is the text as sent (short links), so what you store matches what the recipient saw.message.trackedLinks[]lists each link'scode,shortUrl,originalUrl,clickCount,uniqueClickCount,firstClickedAt,lastClickedAt. It is only present on outbound messages that carry at least one link; the same array appears on activities returned byGET /conversations/:id.- Each human click fires a
link.clickedwebhook. Previews and scanners are filtered out.
Links to link.ody.co or api.ody.co are never rewritten, and inbound messages are never touched. With a test key the body is rewritten the same way and the short links resolve, so you can click through and watch trackedLinks and link.clicked behave end to end; nothing is texted.
curl https://api.ody.co/v1/api/messages \
-H "Authorization: Bearer $ODY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: appt-7731-reminder" \
-d '{
"to": "+15125550123",
"body": "Hi Ada, reminder: your appointment is tomorrow at 10am. Reply C to confirm."
}'const { message, conversationId } = await ody.messages.send({
to: "+15125550123",
body: "Hi Ada, reminder: your appointment is tomorrow at 10am. Reply C to confirm.",
idempotencyKey: "appt-7731-reminder",
});res = client.messages.send(
to="+15125550123",
body="Hi Ada, reminder: your appointment is tomorrow at 10am. Reply C to confirm.",
idempotency_key="appt-7731-reminder",
){
"message": {
"id": "5e7f…",
"type": "message",
"direction": "outbound",
"body": "Hi Ada, reminder: your appointment is tomorrow at 10am. Reply C to confirm.",
"media": [],
"deliveryStatus": "queued",
"createdAt": "2026-10-14T18:10:00.000Z"
},
"conversationId": "c4f1a2b3-5d6e-4f70-8a9b-0c1d2e3f4a5b"
}#Search messages
/v1/api/messages/searchCase-insensitive search across message bodies and stored call and voicemail transcripts, newest first. It's the same retrieval the MCP search_messages tool uses.
Scope: conversations:read
Query parameters
qstring required — Text to find.limitinteger — 1–100, default 25.
Returns { results: [{ activityId, conversationId, type, direction, body, participants, numberE164, createdAt }] }.
curl "https://api.ody.co/v1/api/messages/search?q=refund&limit=10" \
-H "Authorization: Bearer $ODY_API_KEY"const results = await ody.messages.search("refund", { limit: 10 });results = client.messages.search("refund", limit=10)