Access the 'Gmail' 'RESTful' API
Overview
An interface to the 'Gmail' 'RESTful' API. Allows access to your 'Gmail' messages, threads, drafts and labels.
- All HTTP responses are passed through
gargle::response_process(), which updates gmailr's error handling to be consistent with other packages that use gargle for HTTP requests. Users might notice that errors are more verbose (and hopefully more informative). Also the class vector has changed: - Previously:
c("condition", "error", "gmail_error") - Now:
c("gmailr_error", "gargle_error_request_failed", "http_error_{XXX}", "gargle_error", "rlang_error", "error", "condition") - Text headers, such as
Subject, are now properly prepared as per RFC 2047, fixing a problem with long-ish headers that contain non-ASCII characters (#193). - Fixed MIME structure for emails with text+HTML bodies and attachments. These messages now correctly use nested
multipart/mixed(outer) containingmultipart/alternative(inner text/HTML), preventing the loss of some of the message parts (#202).
Deprecations
- Functions that lack the
gm_prefix have been removed, concluding a deprecation process that kicked off with gmailr 1.0.0 (released 2019-08-23). These functions were hard deprecated in gmailr 2.0.0 (released 2023-06-30). This eliminates many name conflicts with other packages (including with the base package, e.g.base::body()orbase::message()). - Legacy auth functions
clear_token(),gmail_auth(), anduse_secret_file()have been removed, following the same deprecation timeline as described above. gm_last_response()is deprecated, in favor ofgargle::gargle_last_response(), since gmailr no longer caches the last response itself.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 48 (3 internal)includes a package overview page
- Examples that run
- 22%8 run in a plain check (4 of them under a condition) · 28 never run
- Exported functions with examples
- 78%
- Documented parameters
- 98%
- Return-value docs
- 13%
- Help pages citing references
- 60%
- gmailr HTML
- Deploy a token HTML
- Sending Messages With Gmailr HTML
Downloads
Repository
- PRs merged (all time)
- 85%
- Median days to close, 50 most recently updated closed issues
- 235
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
16 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/r-lib/gmailr on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-01-30 · The repository has a site deploy workflow
pkgdown site last built 2026-01-30
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2025-11-04Seen in the repository: .claude, CLAUDE.mdNamed in .Rbuildignore: CLAUDE.md
Dependencies
Installing gmailr adds 25 packages (16 with compiled code, 9.2 MB of source tarballs). Heaviest: fs 1.4 MB, openssl 1.1 MB, jsonlite 1.0 MB.
Code & Tests
People & History
Previously maintained by Jim Hester (0.0.1 to 1.0.0).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 3.0.0Latest2026-01-30 · current release · diff ↗ ·
removed 45 exports
attach_file, attach_part, attachment, bcc, body, cc, clear_token, create_draft, create_label, date, delete_label, delete_message, delete_thread, draft, drafts, from, gmail_auth, history, html_body, id, import_message, insert_message, label, labels, message, messages, mime, modify_message, modify_thread, save_attachment and 15 more - RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 2.0.02023-06-30 · diff ↗ ·
removed 1 export
%>%added 5 exports
gm_default_email, gm_default_oauth_client, gm_oauth_client, gm_token_read, gm_token_write - RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- 1.0.12021-11-30 · diff ↗
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 1.0.02019-08-23 · diff ↗ ·
removed 1 export
last_responseadded 53 exports
gm_attach_file, gm_attach_part, gm_attachment, gm_attachments, gm_auth, gm_auth_configure, gm_bcc, gm_body, gm_cc, gm_create_draft, gm_create_label, gm_date, gm_deauth, gm_delete_draft, gm_delete_label, gm_delete_message, gm_delete_thread, gm_draft, gm_drafts, gm_from, gm_has_token, gm_history, gm_html_body, gm_id, gm_import_message, gm_insert_message, gm_label, gm_labels, gm_last_response, gm_message and 23 more - RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- 0.7.12016-04-12 · diff ↗ ·
removed 4 exports
bcc.gmail_draft, bcc.gmail_message, cc.gmail_draft, cc.gmail_messageadded 3 exports
clear_token, last_response, use_secret_file
Show 5 earlier eventsHide 5 earlier events
- RR 3.2.0 released · 2015-04-16
- 0.6.02014-12-04 · diff ↗
- 0.5.02014-09-19 · diff ↗ ·
added 20 exports
%>%, attach_file, attach_part, bcc, bcc.gmail_draft, bcc.gmail_message, cc, cc.gmail_draft, cc.gmail_message, create_draft, drafts, html_body, import_message, insert_message, messages, mime, quoted_printable_encode, send_draft, send_message, text_body - 0.0.12014-07-26
- RR 3.1.0 released · 2014-04-10
Package metadata
- First published
- 2014-07-26
- Total releases
- 8 / 12 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1
- Download size
- 274 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("gmailr")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.