Clojure wrapper for the Google Keep API (v1).
Provides idiomatic Clojure functions for managing notes, note permissions, and attachment downloads.
Auth: use csl/scoped-delegated-credentials or csl/user-credentials with the appropriate scope:
The Keep API is enterprise-only as of 2025 — consumers must be on a Workspace plan that exposes the Keep API.
list-notes returns {:data [...] :next-page-token "..."}. :next-page-token is absent when there are no further pages. Other functions return {:data ...} on success or {:error ...} on failure.
Clojure wrapper for the Google Keep API (v1).
Provides idiomatic Clojure functions for managing notes, note permissions,
and attachment downloads.
Auth: use csl/scoped-delegated-credentials or csl/user-credentials with
the appropriate scope:
- KeepScopes/KEEP (full read/write)
- KeepScopes/KEEP_READONLY (read-only)
The Keep API is enterprise-only as of 2025 — consumers must be on a
Workspace plan that exposes the Keep API.
list-notes returns {:data [...] :next-page-token "..."}. :next-page-token
is absent when there are no further pages. Other functions return
{:data ...} on success or {:error ...} on failure.(batch-create-permissions client parent body & [opts])Create one or more permissions on a note.
parent — the note's resource name (e.g. "notes/abc123"). body — map with kebab-case keys: :requests — vector of {:parent <note-name> :permission {:role <ROLE> :email <addr>}} Each :parent must match the top-level parent argument. Each :permission has :role ("OWNER" / "WRITER" / "READER") and an audience: :email, :family, or :group.
opts:
Create one or more permissions on a note.
parent — the note's resource name (e.g. "notes/abc123").
body — map with kebab-case keys:
:requests — vector of {:parent <note-name> :permission {:role <ROLE> :email <addr>}}
Each :parent must match the top-level parent argument.
Each :permission has :role ("OWNER" / "WRITER" / "READER") and
an audience: :email, :family, or :group.
opts:
- :fields — partial response field mask string
- :read-timeout-ms — int, override the HTTP client's default read timeout(batch-delete-permissions client parent body & [opts])Delete one or more permissions on a note.
parent — the note's resource name (e.g. "notes/abc123"). body — map with kebab-case keys: :names — vector of permission resource names to delete, each of the form "notes/<noteId>/permissions/<permissionId>".
opts:
Delete one or more permissions on a note.
parent — the note's resource name (e.g. "notes/abc123").
body — map with kebab-case keys:
:names — vector of permission resource names to delete, each of the form
"notes/<noteId>/permissions/<permissionId>".
opts:
- :fields — partial response field mask string
- :read-timeout-ms — int, override the HTTP client's default read timeout(create-note client note & [opts])Create a new note.
note — map with kebab-case keys. Common fields: :title — note title (string) :body — note body. Either: {:text {:text "..."}} for a text note, or {:list {:list-items [{:text {:text "..."} :checked false} ...]}} for a list note.
opts:
Create a new note.
note — map with kebab-case keys. Common fields:
:title — note title (string)
:body — note body. Either:
{:text {:text "..."}} for a text note, or
{:list {:list-items [{:text {:text "..."} :checked false} ...]}}
for a list note.
opts:
- :fields — partial response field mask string
- :read-timeout-ms — int, override the HTTP client's default read timeout(delete-note client note-name & [opts])Delete a note.
note-name — full resource name, e.g. "notes/abc123".
opts:
Delete a note. note-name — full resource name, e.g. "notes/abc123". opts: - :fields — partial response field mask string - :read-timeout-ms — int, override the HTTP client's default read timeout
(download-attachment client attachment-name & [opts])Download an attachment's binary content as a byte[].
attachment-name — full resource name of the attachment (e.g. "notes/<noteId>/attachments/<attachmentId>").
opts:
Returns {:data <byte[]>} on success or {:error ...} on failure. Suitable for small attachments (Keep attachments are typically photos or audio clips). Large-file streaming via OutputStream is not exposed in v0.
Download an attachment's binary content as a byte[].
attachment-name — full resource name of the attachment (e.g.
"notes/<noteId>/attachments/<attachmentId>").
opts:
- :mime-type — MIME type for the requested media (audio attachments may
be transcoded if the underlying type differs)
- :fields — partial response field mask string
- :read-timeout-ms — int, override the HTTP client's default read timeout
Returns {:data <byte[]>} on success or {:error ...} on failure. Suitable for
small attachments (Keep attachments are typically photos or audio clips).
Large-file streaming via OutputStream is not exposed in v0.(extract-note-text note)Extract plain text from a Note (as returned by get-note or list-notes).
Extract plain text from a Note (as returned by get-note or list-notes). - Text-style note: returns the body's text content. - List-style note: returns each list item on its own line, prefixed with [x] (checked) or [ ] (unchecked). - Notes with no body or unrecognized body shape: returns an empty string.
(get-note client note-name & [opts])Get a note by name.
note-name — full resource name, e.g. "notes/abc123".
opts:
Get a note by name. note-name — full resource name, e.g. "notes/abc123". opts: - :fields — partial response field mask string - :read-timeout-ms — int, override the HTTP client's default read timeout
(keep-client credentials)(keep-client credentials opts)Build an authenticated Keep v1 REST client.
credentials — a com.google.auth.oauth2.GoogleCredentials instance, typically from csl/scoped-delegated-credentials or csl/user-credentials.
opts (optional):
Per-request opts on individual call sites override the client-level defaults.
Build an authenticated Keep v1 REST client. credentials — a com.google.auth.oauth2.GoogleCredentials instance, typically from csl/scoped-delegated-credentials or csl/user-credentials. opts (optional): - :read-timeout-ms per-client default read timeout (default 120000 / 120s) - :connect-timeout-ms per-client default connect timeout (default 30000 / 30s) Per-request opts on individual call sites override the client-level defaults.
(list-notes client & [opts])List the authenticated user's notes.
opts:
List the authenticated user's notes. opts: - :filter — server-side filter (e.g. "trashed=false") - :page-token — token from a previous response to fetch the next page - :page-size — max notes per page (API default 100; max 100) - :fields — partial response field mask string - :read-timeout-ms — int, override the HTTP client's default read timeout
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |