Guides

Read and organize messages from code

Updated

Check what's unread, search everything, archive what's done, and snooze what can wait, from a script or your own app.

These requests take an API token, not a send key. Read only can list, read, search, and watch; marking read, changing alerts, archiving, snoozing, and moving take Read and send; moving to Trash, restoring, and deleting take Everything. A token limited to some sources sees only their messages.

List your messages

Ask for what's unread:

Terminal
curl "https://api.ripple.do/v1/messages?unread=true" \
  -H "Authorization: Bearer $RIPPLE_KEY"

Ripple returns a page of messages, newest activity first, with a total and a nextCursor for the next page:

200 OK
{
  "items": [
    {
      "messageId": "msg_06gjr5cq1n7wffhd",
      "source": { "kind": "system", "id": "src_06gh98f70z1yfa5k", "name": "Inbox" },
      "sender": { "kind": "api_token", "name": "Deploy server" },
      "title": "Deployment complete",
      "preview": "Version 1.2 is ready.",
      "alert": "standard",
      "readAt": null,
      "archivedAt": null,
      "snooze": null,
      "sourceState": "active"
    }
  ],
  "total": 1,
  "nextCursor": null
}

A message has more fields than this; the API reference lists them all. Three filters narrow the list:

FilterShows
inall, the default: everything not archived or snoozed. archive: archived messages. snoozed: snoozed messages, soonest to return first.
sourceIdOne source's messages. Inbox is a source too; its ID is in the list of sources, with kind system.
unreadtrue for unread messages, false for read ones

A message's source says where it belongs, and sourceState whether that source is active, in Trash (trash), or deleted. Its sender names the API token (kind api_token) or connected app (app), such as an AI agent, that sent it, by its current name, so renaming one renames its messages too, and a removed one's messages keep its last name. A message sent with a send key or a terminal's sign-in (ripple login), or before Ripple recorded senders, has sender: null. Its sound is the one its sender chose, or null when it plays its source's or the account's.

How threads appear

A thread appears once in a list, as its newest message. That message's title is its own, null if it was sent without one, and thread.title is the thread's. previousMessage is the message before it, if there is one:

200 OK
{
  "items": [
    {
      "messageId": "msg_06gq3k5m9vb2wt8e",
      "title": "Tests passed",
      "preview": "312 tests in 48s",
      "readAt": null,
      "thread": { "id": "thr_06gq3h1x8rkm5zd2", "title": "Deploy #42", "messageCount": 2, "unreadCount": 1 },
      "previousMessage": { "messageId": "msg_06gq3j7w2xh9k4rd", "messageNumber": 1, "title": "Build started", "preview": "Building 1.2 from main" }
    }
  ]
}

A thread is unread while any of its messages is: its readAt stays null until every message is read, and thread.unreadCount says how many aren't. It counts once in its source's unreadCount.

Read a message or a thread

To open one message in full, with its body:

Terminal
curl https://api.ripple.do/v1/messages/msg_06gjr5cq1n7wffhd \
  -H "Authorization: Bearer $RIPPLE_KEY"

Its format says how to show body: text exactly as sent, or markdown formatted, as Send messages describes. A message in a thread carries the thread in thread, and its readAt and archivedAt are the thread's. To read the thread's messages, newest first:

Terminal
curl https://api.ripple.do/v1/threads/thr_06gq3h1x8rkm5zd2 \
  -H "Authorization: Bearer $RIPPLE_KEY"
200 OK
{
  "thread": { "id": "thr_06gq3h1x8rkm5zd2", "title": "Deploy #42", "messageCount": 2, "unreadCount": 1 },
  "messages": [
    { "messageId": "msg_06gq3k5m9vb2wt8e", "messageNumber": 2, "title": "Tests passed", "body": "312 tests in 48s", "readAt": null },
    { "messageId": "msg_06gq3j7w2xh9k4rd", "messageNumber": 1, "title": "Build started", "body": "Building 1.2 from main", "readAt": "2026-10-02T12:03:00.000Z" }
  ],
  "nextCursor": null
}

Each message has its own title, readAt, and messageNumber, counting from 1 in the order Ripple received them. latestMessage holds the newest message as lists show it. A threadId from a send whose message isn't in a thread yet gets 404 not_found here.

Get a message's images

A message sent with images lists them in its images, in the order they were sent. Each has an id, a width and height, and an average color to show while it loads. Every message also carries imagePreview, the first image's ID and how many there are, which is all that lists and action results include.

A Markdown body's pictures are in bodyImages: Ripple's copies, made when the message arrived. The body keeps the sender's addresses, and each copy's position says which one it is: its place among the body's different https:// picture addresses, in the order they appear, counting from 0. A picture without a copy couldn't be fetched or read, went past the limits, or arrived while the account's images were busy. Its width and height are the size to show it at; an SVG's copy has twice the pixels, so it stays sharp.

Ask for an image's display copy, a WebP at most 2,048 pixels on a side, or its thumbnail, a 256-pixel square:

Terminal
curl -L https://api.ripple.do/v1/message-images/img_06gh9kxn7m5q0ynq/display \
  -H "Authorization: Bearer $RIPPLE_KEY" -o porch.webp

Ripple answers with a redirect to the image. The link works for at least 15 minutes, so ask again each time you need it rather than storing it.

Search looks through titles, bodies, thread titles, and source names, as Search does in the app. Send the query as JSON:

Terminal
curl https://api.ripple.do/v1/messages/search \
  -H "Authorization: Bearer $RIPPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "release notes"}'

Unlike a list, search covers everything but Trash, archived and snoozed messages included. The best matches come first. These fields narrow the results:

FieldNarrows to
inall, archive, or snoozed
sourceIdsAny of these sources, up to 100
after, beforeA date range
alertquiet, standard, or important
unreadtrue for unread, false for read

Send "sort": "newest" to order by date. Filters also work without a query, which makes search a flexible list, newest first:

JSON
{ "in": "archive", "sourceIds": ["src_06gh81f7x0xmzj8z", "src_06gpfd9wfahvh0aj"], "after": "2026-10-01T00:00:00Z" }

A message you just sent can take a moment to show up in search.

Get the next page

Lists, searches, and threads page the same way. While a response's nextCursor isn't null, send it back as cursor, with the same filters, for the next page.

  • A list or a thread takes it in the address: ?cursor=…
  • A search takes it in the body: "cursor": "…"

limit sets the page size, up to 100. Pass cursors back exactly as you got them; one from a different list or search gets 400 invalid_cursor.

Note

A search returns at most about 1,000 results. Past that, the response says "truncated": true and stops giving a nextCursor. Narrow the query or filters to reach the rest.

Watch for new messages

To act on messages as they arrive, without asking over and over, keep a stream open. Ripple sends each new message the moment it accepts it, as Server-Sent Events:

Terminal
curl -N https://api.ripple.do/v1/messages/stream \
  -H "Authorization: Bearer $RIPPLE_KEY"
200 OK
id: AQ2zvT3fX0Rk8yq1c8h0b2NtJ4kT3PnRj6UeB-wJ2pYc1nq9Vd0aXg2nN4lD7c0F
event: message
data: {"messageId":"msg_06gnrpwxytp0e5w6","title":"Deploy failed","alert":"important",...}

: keep-alive

Add sourceId for one source's new messages. Each message event's data is one line of JSON: the message as reading it shows it, without sourceState or sourceDeletedAt. A new message in a thread comes with the thread's title in thread.title and the message before it in previousMessage. Only arrivals send events, not reading, archiving, snoozing, moving, or Trash, and a message already in Trash when its event would go out is skipped. Ignore events with other names.

A stream starts at the present, and the connection can close at any time, such as after 15 minutes. Every event has an id; one without data only moves your place forward. To pick up where you left off, reconnect with the last id in a Last-Event-ID header, and every new message since then arrives, for up to 30 days. Many SSE clients do this for you.

ErrorWhat to do
410 last_event_id_expiredThe Last-Event-ID is too old or unusable. Reconnect without it, and list messages to catch up.
429 message_stream_limitToo many streams are open. Wait the Retry-After seconds and try again.
Tip

ripple messages watch does all of this for you.

Organize messages

To mark messages read or unread, change their alert, archive or unarchive them, or move them to Trash, post their IDs to the matching address, up to 100 at a time:

Terminal
curl https://api.ripple.do/v1/messages/archive \
  -H "Authorization: Bearer $RIPPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messageIds": ["msg_06gnk2wgfm55j6wj", "msg_06ghxs73htk54j6b"]}'
AddressDoes
/v1/messages/readMarks read
/v1/messages/unreadMarks unread
/v1/messages/alertChanges the alert to the alert you send beside messageIds (quiet, standard, or important), as if it had been sent that way, without notifying
/v1/messages/archiveArchives
/v1/messages/unarchiveBrings back from the archive
/v1/messages/trashMoves to Trash, where messages stay 30 days before they're deleted for good

Each response's changedCount counts what the request acted on, leaving out messages already as asked when you change their alert or move them to Trash. A message in a thread acts on its whole thread: marking it read marks every message in the thread read, marking it unread makes the thread's newest message unread, changing its alert changes the thread's newest message, which the thread is shown by, and archiving, unarchiving, and Trash take the whole thread. Every message keeps its source. Trashed messages can be restored until they're deleted.

A message whose sourceState is trash keeps its read and archive state until its source is restored. You can still move or snooze it, but these addresses answer 409 message_deleted if a request includes it.

Move a message to another source

To give a message another source, post this to /v1/messages/move:

JSON
{ "moves": [{ "messageId": "msg_06gnk2wgfm55j6wj", "sourceId": "src_06gh81f7x0xmzj8z" }] }

A message in a thread moves its whole thread, which keeps its ID. Sending one thread's messages to two different sources in one request gets 400 invalid_message_moves. A key belongs to its source, so a later send under the thread's key to its old source starts a new thread there. In its new source the moved thread keeps its key, unless a thread there already uses it.

Snooze a message

Snoozing hides a message until a time you choose, then brings it back with an alert, as Snooze shows. Send the return time, with its offset from UTC, to the message's snooze address:

Terminal
curl -X PUT https://api.ripple.do/v1/messages/msg_06gnk2wgfm55j6wj/snooze \
  -H "Authorization: Bearer $RIPPLE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"returnAt": "2026-10-24T09:00:00-04:00"}'

You can also send timeZone, the zone to show the time in when the snooze is edited later, and alert, how the message returns. Ripple fills in sensible values for either one you leave out.

To bring a message back early, send a DELETE to the same address, with no body.

Snoozing a message in a thread snoozes the whole thread. A new message in the thread ends the snooze and brings the thread back, unread.

Tip

To act only on the message as you last saw it, send its revision as expectedRevision: in a snooze's body, or as ?expectedRevision= when you cancel one. If the message has changed, Ripple answers 409 message_changed with the message as it is now in current, and changes nothing.

Restore from Trash

Trash keeps deleted messages, threads, and sources for 30 days. Each item's purgeAt says when it will be deleted for good.

ToSend
See what's thereGET /v1/trash, with type=message, thread, source, or content (messages and threads) to narrow it
Search itPOST /v1/trash/search, with the same fields as message search except in
Open an itemGET /v1/trash/messages/{messageId} or GET /v1/trash/threads/{threadId}
Restore an itemPOST /v1/trash/{kind}/{id}/restore
Delete it for goodDELETE /v1/trash/{kind}/{id}, with no body

For restoring and deleting, kind is messages, threads, or sources. A thread comes back with all its messages. If a newer thread in its source took its key meanwhile, the restored thread gives the key up, so later sends keep joining the newer one.

Warning

Deleting from Trash can't be undone. To make sure the item is still the one you looked at, send its deletedAt as ?deletedAt=; a restore takes it in its JSON body. If it no longer matches, Ripple answers 404 not_found and does nothing.

When a request fails

Errors have the same shape everywhere: a code to match on and a message for people, as in Send messages. A few add a field, such as current on 409 message_changed.

If a request times out, or fails on Ripple's side, the change may still have happened. Read the current state before trying again. A busy search answers 503 with search_busy or search_timeout; wait the Retry-After seconds and try again.

The API reference has every operation's fields, limits, and errors.