Manage sources from code
Updated
A source is where a group of messages comes from, such as “GitHub Alerts” or “Backups”. Give each script its own, and you can tell messages apart at a glance and quiet one sender without touching the rest.
Every account starts with Inbox, which needs no setup. Create more in Ripple, or from code with an API token whose access is Everything, as this page shows. Listing them takes any level: Send only sees each source's name, and the other levels the sources they read.
Create a source
A new source needs only a name:
Ripple answers 201 Created with the new source and its sourceId. The same request can set any of its settings. To make a source that follows a status page, changelog, or project's releases, give feed instead of, or with, the name, as Feeds shows.
A name can be up to 64 characters, and each of your sources has its own: a name another source already has, ignoring capitals and repeated spaces, gets 409 source_name_taken, and so does renaming a source to one. “Inbox” is taken from the start. Names can change, but the ID never does, so keep the ID in your scripts.
Because names are unique, sending the same create twice can't make two sources: if a request times out, send it again, and a 409 source_name_taken means a source with that name exists. List your sources to find its ID.
Get its send key
Next, give your script a key that sends only to this source:
The response has the key, a webhookUrl with the key in it for tools that only take a URL, and an emailAddress with the key in it for devices that only send email. Ask again and you get the same key.
If a key may have leaked, POST /v1/ replaces it, and the old key, webhook URL, and email address stop working at once.
New source in Ripple opens the new source's page and asks only for its name, or a site to follow. Once you create it, the same page wakes with its settings and its ways to send, its key included, and waits there for its first message.
How many you can have
An account can keep up to 100 sources, counting any in Trash, and make up to 30 attempts a minute to create one. Every attempt counts, including one turned away because its name is taken, and so does each feed lookup. Inbox counts toward neither. Past those limits, Ripple answers 409 source_limit_reached or 429 source_creation_rate_limited. Deleting a source for good frees its place.
Find your sources
List every source with its settings and counts:
Inbox comes first, then the rest from oldest to newest, all on one page. Inbox's kind is system; every source you make is custom. Use Inbox's sourceId when a list or search should show only Inbox's messages. In Ripple, any source's menu has Copy source ID.
Each source also reports how it's doing:
| Field | What it counts |
|---|---|
unreadCount | Unread messages, not counting archived or snoozed ones. A thread counts once. |
importantUnreadCount | How many of those are Important |
quietUnreadCount | How many of those are Quiet |
snoozedCount | Its messages waiting in Snoozed |
lastMessageAt | When it last accepted a message, or null if it never has. A good way to spot a script that has gone silent. |
feed | The feed it follows, with when Ripple last read it and any problem, or null |
To read one source, use GET /v1/.
Change a source's settings
Send only what you want to change in a PATCH. Everything else stays as it is:
To clear a setting, send it as null, or defaultLinks as []. emailThreads is never cleared, only set to true or false. feed is an address on the way in, and comes back as the feed Ripple found.
| Setting | What it does |
|---|---|
name | The source's name, unique among your sources |
iconSymbol | The name of an icon from the app's icon picker, such as rocket, or a brand's logo, such as brand:github |
iconColor | The icon's color |
imageUrl | An https:/ image to show instead of an icon |
defaultAlert | The alert for messages that don't choose one |
defaultSound | The sound for messages that don't choose one |
defaultLinks | Up to 4 links for messages sent without links |
emailThreads | Whether emails with the same subject join one thread; true unless you turn it off |
feed | The address of a feed to follow, or of a page that names one; null stops following |
- A source shows an icon or an image, not both. To switch, clear the one it has.
- A new source without an image gets the icon its name suggests, so
Nightly backupgetsbackupandGitHub deploysgetsbrand:github, unless you choose one. A brand named with an everyday word gets its logo only when the rest of the name is words likealertsorupdates:Stripe alertsgetsbrand:stripe, butShell scriptsgetsterminal.nullshows a letter tile instead. - Brand logos come from Simple Icons:
brand:followed by the brand's slug there. A few brands, such as Slack and Microsoft, aren't available, and asking for one returns400 invalid_source; upload their image instead. - The colors are
red,orange,yellow,green,teal,blue,indigo,purple, andpink. A new source without an image gets one of your least-used colors unless you choose one, or the color nearest its brand's for a logo, andnullkeeps the neutral tile. - An image uploaded in the app brings its own color:
iconColorbecomes the one nearest the image's, ornullfor a black-and-white image, and stays when you remove the image. A source can't take another color while it shows an image, and a linkedhttps:/image has none./ - The sounds are the ones a message can choose, listed in Send messages. A
defaultSoundofnullplays the account's sound. With sounds turned off in Ripple's settings, every source stays silent. - Inbox takes icon, color, image, and default changes, but keeps its name and can't follow a feed.
Give its messages links
A Ripple source can hold up to 4 default links, so every message from a script that sends none opens its dashboard, logs, or runbook:
Each default link takes the same shape as a message's links: a link, or an object with its url and a title of up to 64 characters. An http:/ link is kept as https:/, and a blank one, as an empty form field sends, is skipped and doesn't count toward the 4; a list holds up to 20 entries. A link Ripple can't open, one listed twice, or a fifth gets 400 invalid_source, and nothing changes. Ripple answers with each link as an object with its url and title, and title is null where you gave none.
A send that leaves out links, or keeps none of the ones it lists, gets all of the source's default links, in order. Otherwise it gets only its own, and "links": [] sends none. A new list replaces the old one, and [] removes them all.
Quiet a source
When a script gets noisy, set its source's default alert to quiet:
Ripple keeps saving its messages as Quiet, so they don't notify or come to Home, unless a send asks for standard or important. To have them notify again, send "defaultAlert": null.
Disable or mark read
To stop a Ripple source taking messages for a while, or catch up on it at once, post to one of these addresses with no body:
| Address | Does |
|---|---|
/v1/ | Stops it accepting messages; sends get 403 source_disabled. /enable lets them in again. |
/v1/ | Marks all its messages read |
Home leaves out a disabled source's messages. Inbox can't be disabled.
Remove a source
To move a source to Trash, send a DELETE with no body:
Its messages stay where they are. To move them to Trash with it, add ?deleteMessages=true. Inbox can't be removed.
The source stays in Trash for 30 days, and you can restore it until then. If another source has taken its name meanwhile, it comes back numbered, such as “Builds 2”. The response's deletedAt lets a later restore or permanent deletion act only on this removal.
The API reference has every source operation in full.