Connect a Google account and read and send Gmail, manage Google Calendar events, work with Google Drive files and sync Google Contacts through one Zernio API.
Authentication details
Connecting accounts guideConnect a person's Google account once and use their Gmail, Google Calendar, Google Drive and Google Contacts with your Zernio API key. A connected account uses platform: "google" and represents one mailbox.
Quick reference
You choose which of the four areas it grants when you connect it.
| Property | Value |
|---|---|
| Platform value | google |
| Areas | email (Gmail), calendar (Google Calendar), files (Google Drive), contacts (Google Contacts) |
| Auth | OAuth 2.0 with Google sign-in, scopes required. Or an organization connection: a Workspace admin delegates once and you add mailboxes without user sign-in |
| Accounts | One per Google account and profile. Connecting again widens the same account |
| List, search, read, send, reply, forward, label, trash, drafts, scheduled send, tracking, send-as and signatures. 200 sends a day (500 on Google Workspace), doubling after 14 clean days | |
| Calendar | Events, RSVP, free-busy and availability on the user's calendars |
| Files | Only files Zernio created or the user picked (drive.file) |
| Contacts | Synced into /v1/contacts, read-only |
| Inbox | Inbound and sent mail appears as conversations, with message.received |
| Webhooks | message.received, email.*, calendar.event.*, file.*, contact.*, account.rate_limited |
| Social posting | No |
| List the accounts | GET /v1/accounts?platform=google |
Before you start
- The person connecting needs a Gmail or Google Workspace account. A Workspace admin can block third-party apps for the whole domain.
- Sending from Gmail needs a payment method on your Zernio workspace. Reading, calendar, files and contacts do not.
Connect
Call GET /v1/connect/google with profileId and the areas you need in scopes, such as scopes=email,calendar, and send the user to the returned authUrl. See Connect.
To ask for the address first and route any mailbox, use the hosted email connect link from GET /v1/connect/email. Gmail and Microsoft addresses go to their sign-in, every other mailbox connects over IMAP.
Common errors
| Error | Cause | Fix |
|---|---|---|
400 invalid_field_value on connect | scopes is missing | Pass a subset of email, calendar, files, contacts. |
412 account_scope_missing | The account was connected without the area this call needs | Connect again with that area added to scopes. |
error=no_access_granted on your redirect_url | The user unticked every permission on Google's consent screen, so no account was saved | Ask them to connect again and keep at least one permission ticked. |
404 with reason: "file_not_granted" | The Drive file was not created by Zernio or picked by the user | Let the user pick it in a picker session. |
In this section
Connect
Connect a Google account to a profile for any mix of Gmail, Google Calendar, Google Drive and Google Contacts, and widen it later.
Organization connection
Let a Google Workspace admin grant Zernio access to the domain's mailboxes once, then add mailboxes through the API without each user signing in.
Read and search Gmail, send, reply and forward, schedule and track sends, work with drafts, labels, send-as aliases and signatures, and catch bounces.
Calendar
List Google calendars and events, create and update events with Google Meet links, RSVP to invitations, and find free time across mailboxes.
Files
Let users pick Google Drive files, then list, upload, download, share and organise them, or use a Drive file as post media.
Contacts
Sync a Google account's contacts into your Zernio contacts, merged by email address with the people you already know from other channels.
Webhooks
The webhook events a Google account sends for new mail, calendar changes, Drive changes and contact syncs, and how Zernio keeps Google's push channels alive.
Limits & errors
Send caps, size limits and rate limits on Google accounts, what the connection cannot do, and the errors every Gmail, Calendar and Drive call can return.
Related
- GET
- GET
- PATCH
- GET
- POST
- GET
- GET
- DELETE
- GET
- PATCH
- DELETE
- POST
Contacts
9· Unified API, shared with other platforms- GET
- POST
- GET
- GET
- GET
- PATCH
- DELETE
- GET
- POST