Every request CaseDesk makes to your Google account
This page lists each Gmail call the tool will use, why it's needed, and exactly what is sent and received. Every item starts with a one-line plain English summary, with the technical detail underneath for anyone who wants it.
5Gmail API calls, all read only
$0 / monthRuns on Google Apps Script in your own account
Every 5 minHow often it checks for new emails
Permissions you'll be asked to approve
When you connect, Google shows a screen listing these. Each one is the narrowest option that does the job.
Google scope
What Google shows you
Why CaseDesk needs it
gmail.readonly
View your email messages and settings
To find emails from your tracked senders and copy them into cases. It cannot send, delete, move or mark anything.
Required
spreadsheets.currentonly
See, edit, create and delete only the spreadsheet this app is attached to
Your cases live in one private Google Sheet. It can't open any of your other sheets.
Required
drive.file
See and manage only the Drive files this app creates
Saves attachments into a "CaseDesk Attachments" folder. Your other Drive files stay invisible to it.
Required
script.scriptapp
Allow this app to run when you are not present
Lets the 5 minute timer check for new emails while your laptop is closed.
Required
script.send_mail
Send email as you
Only for the "new case" alert, sent to your own address. Skip email alerts and this permission isn't requested at all.
Optional
How it runs, every 5 minutes
Here's the whole loop, in the order it happens. The calls in each step are detailed further down.
1
Timer wakes up
A time based Apps Script trigger fires. Nothing runs on any outside server.
2
Ask Gmail what's new
history.list from the last saved checkpoint. On first run it uses messages.list with a from: filter instead.
3
Read each new email
messages.get returns sender, subject, date, body and the list of attachments. Senders not on your list are skipped right here.
4
New case or existing one?
If the email's threadId already belongs to a case, it's added to that case's thread. Otherwise a new row gets the next number, like CASE-0007.
5
Save attachments
attachments.get, then the file is written to the Drive folder and linked on the case.
6
Alert you
The in-app bell updates, and an email alert goes to you if you've turned that on.
Gmail API calls
Base URL for all of these: https://gmail.googleapis.com/gmail/v1. In Apps Script they're called through the built-in Gmail Advanced Service, which signs every request with your approved permissions automatically.
GET users.getProfile
/users/me/profile
In plain words: confirms which Gmail account is connected, so the app can show "Connected as you@gmail.com".
When: once, right after you connectQuota cost: 1 unit
Request
GET /gmail/v1/users/me/profile
Authorization: Bearer <access_token>
The historyId is saved as the starting checkpoint for step 2.
GET users.messages.list
/users/me/messages?q=from:(...) after:...
In plain words: searches your inbox for emails from the senders you track, the same way the Gmail search bar does.
When: first run, and as a backup if the checkpoint expiresQuota cost: 5 units
Parameter
Example
Purpose
q
from:(a@x.com OR b@y.com) after:1760572800
Built from your Settings list, so changing senders needs no code
maxResults
100
Page size
pageToken
0912...
Next page, if there are more
Request
GET /gmail/v1/users/me/messages
?q=from:(claims@northfield-insurance.example
OR support@harbourbank.example)
after:1760572800
&maxResults=100
Authorization: Bearer <access_token>
The new historyId replaces the saved checkpoint. If Google says the old checkpoint is too old (HTTP 404), the app falls back to messages.list for that run, so no email is missed.
GET users.messages.get
/users/me/messages/{id}?format=full
In plain words: opens one email and reads everything a case needs: who sent it, when, the subject, the full text, and which files are attached.
When: once per new emailQuota cost: 5 units
Request
GET /gmail/v1/users/me/messages/192f4be01a77c3d9
?format=full
Authorization: Bearer <access_token>
How each field maps to a case: From becomes the sender, Subject the subject, internalDate the date received. The text/plain part (base64url decoded) is the full body, falling back to text/html stripped to text. threadId decides new case vs. existing case, and every part with a filename is an attachment.
Apps Script built-in, sends from your account to your account
In plain words: emails you a short "New case CASE-0007" note with a link to open it. The recipient is fixed to your own address in Settings.
When: once per new case, only if alerts are onPermission: script.send_mail
Request (Apps Script)
MailApp.sendEmail({
to: settings.alertEmail, // your own address, from Settings
subject: 'New case CASE-0007: Claim update needed for policy #44821',
htmlBody: 'From claims@northfield-insurance.example<br>' +
'<a href="' + appUrl + '#/case/CASE-0007">Open case</a>'
});
// Returns nothing. The alert shows up in your inbox within seconds.
CaseDesk app functions
These run between the CaseDesk screens and your Google Sheet. The web page calls them with google.script.run, and only you can reach them because the web app is set to "only me".
FN listCases
In plain words: loads the dashboard, newest case first, with counts per status.
Google gives every account a free allowance. For a personal case tracker the usage is tiny.
Item
Typical use
Free allowance
Cost
Gmail API calls
About 2 quota units per check, plus about 10 for each new email
250 quota units per second, per user
$0
Apps Script timer
288 short runs a day (every 5 min), a few seconds each
90 minutes of trigger runtime a day on a free Gmail account
$0
Google Sheet
One row per case and one per email
10 million cells
$0
Drive storage
Attachments only
Shares your existing 15 GB Google storage
$0
Hosting
Apps Script serves the web app
Included
$0
What it never does
No deleting, moving or labelling
Calls like messages.modify, messages.trash and messages.delete are never used, and the read only permission blocks them anyway. Your inbox looks exactly the same as before.
No outside servers
Everything runs as Apps Script inside your Google account. No emails are copied to a third party database.
No push notifications from Google
users.watch would need a paid Google Cloud Pub/Sub setup. Checking every 5 minutes gives you nearly the same speed with zero setup and zero cost.
No access to other senders
Emails from addresses not on your list are skipped and never saved. You can remove a sender any time in Settings.