Docs: no supported way to build a Gmail web link from an API ID (inverse of #790)

Open Beginner friendly
#858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Domain
cli, documentation

Research direction

Start with the README and the gws-gmail skill mentioned in the issue, then read #790 for the related direction. Document that no supported method creates a durable Gmail web link from an API hex ID, explain the limitations of the available URLs, provide the API-derivable search-link alternative, and cross-link #790.

Written by the indexing model from the issue text.

Description

Use case

This is the inverse of #790. Given an email found through the API, I want to build a clickable Gmail web URL that opens that exact message in the browser, so I can cite it in notes, summaries, or replies. This matters most for agents, which reference an email by the IDs the API hands back.

The gap

The API returns only hex IDs (id, threadId). Both ways to turn one into a URL fall short:

  1. https://mail.google.com/mail/u/0/#all/<hexId> opens the message only in a Gmail tab that is already loaded and signed in, where the web app resolves the hex as a legacy alias. On a cold click it fails.
  2. #search/rfc822msgid:<Message-ID> works, but it is a search URL, not a direct link to the message.

A durable link needs Gmail's opaque web ID (FMfcgz…, Ktbx…, CXKn…, QgrcJ…). The API never returns it, and #790 shows it cannot be derived offline because it is wrapped with a per-account server key. So the only reliable path today is to open each message in a browser and copy the address bar, which defeats automation.

What I verified

I decoded four permalinks from one account. The hex id and threadId appear nowhere in the bytes. Messages in the same thread share a leading block (the thread part) and differ in the tail (the message part), and that thread block is longer than the 8-byte hex ID, which fits an encrypted token. This matches the decode in #790.

Request

  1. Document, in the README and the gws-gmail skill, that no supported method turns an API hex ID into a durable web link. The #all/<hexId> alias is unofficial and breaks on a cold load; an rfc822msgid search is the only API-derivable link. This is the forward-direction counterpart to #790, which covers web URL to API ID.
  2. If Google later exposes a permalink, return it on message and thread reads.
  3. Cross-link #790.

Environment

  • gws 0.22.5
  • Node v24.16.0
  • Used through the agent skills (gws-gmail)
Dominant language
Rust
Stars
31.1k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleworkspace/cli

All issues in googleworkspace/cli

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.