Gmail Port
This is the reference integration for Harbor `http_api` Action Model authoring.
Gmail Port
Purpose
This is the reference integration for Harbor http_api Action Model authoring.
Use it when:
- building Gmail actions in Harbor
- extending the Dock / Hub Gmail entry
- teaching Codex or OpenClaw how to map a real API into Harbor Ports and Harbor Actions
Harbor Port worksheet
Product
- Product: Gmail API
- Publisher slug:
google - Publisher name:
Google - Category:
Email - Tags:
google,gmail,email,productivity
Safe Harbor Port metadata
- Kind:
http_api - Label:
Gmail API - Description:
Gmail API connection managed locally through Harbor. - Base URL:
https://gmail.googleapis.com/ - Auth mode:
header_token - Auth header name:
Authorization - Auth token prefix:
Bearer
Hidden local config
authToken
Harbor stores the token locally only. Dock / Hub manifests must never contain it.
Harbor action design notes
Gmail is a good Harbor fit when we stay on fixed /users/me/... routes and keep write payloads in input.body. For future bounded writes, keep request data in input.body and keep any filter-like values explicit rather than stringly-typed.
Good Harbor Gmail actions:
- stable
GETlist/read routes - explicit
POSTroutes for draft/create/send flows requestBodyMode: "none"for readsrequestBodyMode: "json"for bounded writesresultMode: "json_summary"for all starter actions
Avoid for now:
- path-parameter-heavy actions that need arbitrary message ids
- query-string-specific search actions
- giant unrestricted mail admin surfaces
- automatic publish of broad write actions
Starter Gmail actions
Automatic read actions
get-profile->GET /gmail/v1/users/me/profilelist-labels->GET /gmail/v1/users/me/labelslist-messages->GET /gmail/v1/users/me/messageslist-threads->GET /gmail/v1/users/me/threadslist-drafts->GET /gmail/v1/users/me/draftslist-send-as-identities->GET /gmail/v1/users/me/settings/sendAslist-forwarding-addresses->GET /gmail/v1/users/me/settings/forwardingAddresseslist-filters->GET /gmail/v1/users/me/settings/filtersget-auto-forwarding->GET /gmail/v1/users/me/settings/autoForwardingget-imap-settings->GET /gmail/v1/users/me/settings/imapget-language-settings->GET /gmail/v1/users/me/settings/languageget-pop-settings->GET /gmail/v1/users/me/settings/popget-vacation-settings->GET /gmail/v1/users/me/settings/vacation
Approval-friendly write actions
create-draft->POST /gmail/v1/users/me/draftssend-message->POST /gmail/v1/users/me/messages/sendcreate-label->POST /gmail/v1/users/me/labelscreate-filter->POST /gmail/v1/users/me/settings/filterscreate-forwarding-address->POST /gmail/v1/users/me/settings/forwardingAddresses
Why these actions
These routes fit Harbor's Action Model well because they:
- stay under one fixed Gmail API origin
- use fixed paths relative to the Harbor Port
- do not require arbitrary full URLs
- can be reviewed as named capabilities
- keep hidden auth entirely local to Harbor Node
Suggested operator workflow
- Import the Gmail Dock entry from Dock / Hub.
- Configure the local Gmail bearer token in Harbor Node.
- Use the imported live action set immediately for low-risk reads after local auth is configured.
- Keep send/create actions on
require_approvalunless there is a very deliberate local policy reason not to. - Create new drafts only when you want to extend the imported Gmail surface beyond the Dock starter set.
Suggested agent workflow
- Inspect the existing Gmail Harbor Port.
- Inspect live actions and drafts.
- Propose additional fixed-path actions only.
- Validate and test drafts.
- Request publish instead of self-publishing unless Harbor explicitly allows it.
Agents should never:
- ask Harbor for the stored token
- edit hidden Gmail auth
- widen Gmail into a generic arbitrary proxy
Current update strategy
For now, Gmail updates are manual:
- update the Dock / Hub Gmail integration document in
apps/hub/catalog/integrations/google/gmail.json - bump the manifest version when the action set changes materially
- re-import into Harbor or create new drafts from the updated Dock entry
Future options such as a gmail:latest background sync or a manual "check for Hub updates" flow are intentionally deferred until Harbor has clearer version and update semantics.
Official reference starting points
- Gmail API reference root:
https://developers.google.com/workspace/gmail/api/reference/rest - Gmail profile:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users/getProfile - Gmail labels list:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.labels/list - Gmail messages list:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/list - Gmail threads list:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/list - Gmail drafts list:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.drafts/list - Gmail send message:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.messages/send - Gmail create draft:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.drafts/create - Gmail send-as list:
https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.settings.sendAs/list