Gmail
Sending mail from a Gmail account, for example an order confirmation or a reply to an enquiry sent from your own address.
Connection type: For the app and the agent. Sign-in: Sign in with a Google account in the provider's window and approve the permissions listed below. No passwords or keys are entered in Bloklo.
How it works
The app and the agent never see the credentials. They call the Gmail API through the Bloklo gateway, for example fetch("/gw/<connection id>/v1/userinfo"). The gateway appends the path to the address https://gmail.googleapis.com, adds an access token from the Google sign-in, renewed automatically, and passes the service's response back to the app.
- Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an
approval_idand the write waits for approval in the panel (see Agent permissions). - The Test button sends
GET /v1/userinfoand checks that the service accepted the credentials.
Some methods run on another host of the same service (noted in the methods table). Choose that host with the X-Bloklo-Host header, for example X-Bloklo-Host: openidconnect.googleapis.com; the gateway accepts only the provider hosts allowed in the connector definition.
Gmail API v1 at gmail.googleapis.com, user “me”, JSON bodies, sending only (gmail.send scope). Sending needs the whole RFC 2822 message base64url-encoded in the raw field; the sender is the connected account. The account address comes from OpenID userinfo at openidconnect.googleapis.com. Reading the mailbox, drafts and labels need Google restricted scopes, so the connector does not include them.
Before you start
- A Google account with access to the data the app should use.
Connecting in Bloklo
- Open Connectors in the sidebar and find Gmail.
- Click Connect and enter a connection name in Details.
- Click Connect. The Google sign-in window opens.
- Choose the Google account and approve the permissions. After approval you return to Bloklo and the connection is active.
- Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat.
Until Google verifies the Bloklo app, the sign-in window may warn that the app is unverified. To continue, choose Advanced and then Go to bloklo.com. Until then at most 100 Google accounts can connect.
Provider permissions
Bloklo asks Google for exactly these scopes: openid, https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/gmail.send. Access can be revoked at any time by removing the connection in Bloklo or in the Google account settings.
Bloklo asks only to send email on your behalf (and for the account address, to show which one is connected). It does not read, search, change or delete mail. A Gmail account sends to about 500 recipients a day, a Google Workspace account to 2,000. After a Google password change the connection has to be authorised again. A Google account created on an address with other mail (for example a company address in Microsoft 365) has no Gmail mailbox and cannot send: use that mail's connector instead, for example Microsoft Outlook.
Example prompts
Prompts to type in the chat of a project with the connection attached:
- “Add a contact form that sends a message to my Gmail address.”
- “Send the customer a booking confirmation from my Gmail address.”
- “Send an order confirmation email to the customer.”
API methods
The most commonly used Gmail API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.
| Method | Path | What it does | In the gateway |
|---|---|---|---|
POST | /gmail/v1/users/me/messages/send | Send a message | write (approval) |
GET | /v1/userinfo | Connected account address (host openidconnect.googleapis.com) | read |
Service limits
Limits are in quota units: 6,000 per minute per user and 1,200,000 per minute per project; sending costs 100. Sending: a Google Workspace account up to 2,000 messages per day (up to 500 recipients per message via the API), a regular Gmail account up to 500 messages per day. The gmail.send scope is a sensitive scope.
Agent actions and permissions
| Action | Type | What the agent uses it for |
|---|---|---|
| Wyślij e-mail | write | Wysyła wiadomość. |
By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).
Troubleshooting
The connection says it needs reconnecting
Access was revoked in the Google account, expired, or the password changed. Open the connection and click Authorize.
The test returns HTTP 403
The account has no access to this data, or some permissions were unticked during sign-in. Reconnect and approve all permissions.
Limits and security
- One connection can make up to 1,000 requests per minute; the service's own limits also apply.
- Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
- A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.
Something unclear or out of date? Contact us