Access
Check what the key you're using is and what it may do.
Check your key
GET/v1/access
Says what the key you call with is and what it may do, so a script or the CLI can check its setup before relying on it. A send key gets the one source it sends to, which a send already reveals. An API token gets its label, access level, and the sources it reads. A terminal signed in with ripple login also gets the account's email address.
Responses
- 200
The key you called with
Response fields
One of
kindstringRequiredsend_keysourceobjectRequiredThe source the key sends to, the only one it reaches.
Fields
sourceIdstring · starts with src_RequirednamestringRequired
Or
kindstringRequiredapi_tokenlabelstringRequiredThe token's name, as Settings → Developer → API tokens shows it.
accessstringRequiredread_onlysend_onlyread_and_sendeverythingWhat an API token or a connected app can do.
read_onlylists, reads, and searches messages, threads, sources, and Trash.send_onlysends to Inbox or any source and sees source names, nothing else.read_and_senddoes both, and tidies: marks read, archives, snoozes, and moves.everythingalso creates and changes sources and their send keys, moves messages to Trash, restores them, and deletes them for good.sourcesstring or list of stringsRequiredThe sources an API token or a connected app reads:
all, which includes sources added later, or a list of source IDs. A token's list grows only when the token creates a source. Sending reaches every source whatever this says, andsend_onlyalways hasall.
Or
kindstringRequiredsign_inemailstringRequiredThe account's contact email, or the address it signed in with when it has none.
accessstringRequiredread_onlysend_onlyread_and_sendeverythingWhat an API token or a connected app can do.
read_onlylists, reads, and searches messages, threads, sources, and Trash.send_onlysends to Inbox or any source and sees source names, nothing else.read_and_senddoes both, and tidies: marks read, archives, snoozes, and moves.everythingalso creates and changes sources and their send keys, moves messages to Trash, restores them, and deletes them for good.sourcesstring or list of stringsRequiredThe sources an API token or a connected app reads:
all, which includes sources added later, or a list of source IDs. A token's list grows only when the token creates a source. Sending reaches every source whatever this says, andsend_onlyalways hasall.
- 401
The request has no valid API token or sign-in (
unauthorized) - 429
Your IP address sent 20 invalid keys within a minute (
invalid_key_rate_limited), so Ripple refuses every key from it, valid or not, until that minute ends.Retry-Aftersays how many seconds that is. - 503
Ripple is busy right now (
database_busy). Wait the number of seconds inRetry-After, then try again.
curl https://api.ripple.do/v1/access \
-H "Authorization: Bearer $RIPPLE_KEY"const response = await fetch("https://api.ripple.do/v1/access", {
headers: {
Authorization: `Bearer ${process.env.RIPPLE_KEY}`,
},
});
console.log(response.status, await response.text());import os
import urllib.request
request = urllib.request.Request(
"https://api.ripple.do/v1/access",
headers={
"Authorization": "Bearer " + os.environ["RIPPLE_KEY"],
},
method="GET",
)
with urllib.request.urlopen(request, timeout=30) as response:
print(response.status, response.read().decode()){
"kind": "api_token",
"label": "Home server",
"access": "read_and_send",
"sources": [
"src_06gnkvcmntkp91yv"
]
}{
"code": "unauthorized",
"message": "Send a valid API token, or sign in."
}{
"code": "invalid_key_rate_limited",
"message": "Too many invalid keys from this IP address. Try again in a moment."
}The key you called with