REST API
Everything the web app does, over HTTP. Scripts sign in with the device flow and use a bearer token.
The REST API lives under /api/v1. Its full reference, generated from the code, is in your own instance at /api/v1/docs, and the OpenAPI document is at /api/v1/openapi.json.
Sign in from a script
Scripts use the OAuth device flow with the built-in public client aruvi-cli.
-
Ask for a code:
curl -s https://aruvi.example.com/api/auth/device/code \ -d client_id=aruvi-cli \ -d scope="openid offline_access" \ -d resource=https://aruvi.example.com/api/v1The response has a
user_code, averification_uri_completeand adevice_code. -
Open
verification_uri_completein your browser, check the code matches, and choose Connect. -
Swap the device code for tokens. Until you’ve connected, this answers
authorization_pending; wait theintervalit gives before asking again.curl -s https://aruvi.example.com/api/auth/oauth2/token \ -d grant_type=urn:ietf:params:oauth:grant-type:device_code \ -d device_code=DEVICE_CODE \ -d client_id=aruvi-cli
You get an access_token, good for an hour, and a refresh_token to get a new one. The script shows up in Settings → Connected agents, where you can disconnect it.
Use it
curl -s https://aruvi.example.com/api/v1/items/links \
-H "authorization: Bearer $TOKEN" \
-H "content-type: application/json" \
-d '{"url": "https://example.com/article", "tags": ["reading"]}'
curl -s "https://aruvi.example.com/api/v1/items?q=tag:reading" -H "authorization: Bearer $TOKEN"
Export
| Endpoint | Returns |
|---|---|
GET /api/v1/export/markdown |
A .tar.gz of Markdown files with frontmatter, in your folders, next to the original images and PDFs. The trash is left out. |
GET /api/v1/export/bookmarks |
A bookmarks HTML file any browser can import. |