OdyDocs

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).

Before you can text

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

POST/v1/api/messages

Sends 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 from from if 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

  • body string required — The text. Longer messages are split into segments by the carrier.
  • conversationId uuid — Reply in this thread. Use this or to.
  • to string — Recipient in E.164. Use this or conversationId.
  • from string — One of your workspace numbers, used when starting a thread with to. Ignored for conversationId (a reply always goes out from the thread's number). Defaults to your workspace number.
  • mediaUrls array of URLs — Up to 10 publicly fetchable images or files. Each must be an https:// URL; http:// returns 400 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; a sendAsLink key 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. url is null there (the token is stored only as a hash) — read media[].hostedUrl on the same activity for the page URL. The same array appears on activities returned by GET /conversations/:id, where the thread also carries synthesized type: "system" entries with mediaOpen for each page the recipient opened.
  • Each human open fires media.opened; a Save fires media.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.

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.body in the response is the text as sent (short links), so what you store matches what the recipient saw.
  • message.trackedLinks[] lists each link's code, 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 by GET /conversations/:id.
  • Each human click fires a link.clicked webhook. 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."
  }'
Response
{
  "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

GET/v1/api/messages/search

Case-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

  • q string required — Text to find.
  • limit integer — 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"
Last updated Sat Nov 07 2026 00:00:00 GMT+0000 (Coordinated Universal Time)Something wrong on this page? Tell us