canonical: https://jentic.com/apis/googleapis.com/groups-migration

# Google Groups Migration API

The Google Groups Migration API lets Workspace domain administrators import historical email messages, in RFC 822 format, directly into the archive of a Google Group. It is designed for one-way migrations from legacy mailing-list systems (Listserv, Mailman, on-premises archives) into Workspace so that group members can search and reference old discussions in Groups. The API accepts a single endpoint that uploads one message at a time as multipart media, preserving original headers and timestamps. It does not move attachments stored outside the message, send mail, or create groups.

## For AI agents

Archive RFC 822 email messages into a Google Workspace group's history so legacy mailing-list content can be searched in Google Groups.

## Scope

Does not create groups, send mail, or migrate individual user mailboxes - use for one-way import of RFC 822 messages into existing Google Group archives only.

## Capabilities

- Insert a single RFC 822 message into the archive of a specified Google group
- Preserve original sender, recipient, subject, and date headers when archiving legacy messages
- Bulk-import historical mailing list traffic from Listserv, Mailman, or on-premises archives into Workspace
- Drive idempotent migrations by submitting per-message uploads under domain-admin OAuth credentials
- Stage migrated content in a target group before opening membership for end-users

## Use cases

### Listserv to Google Groups Migration

An IT team migrating from Listserv or Mailman to Google Workspace uses the Groups Migration API to import years of historical mailing-list traffic into the corresponding Google Groups. Each .eml file is posted to the group's archive endpoint as multipart media, with original headers preserved so search by sender, subject, and date still works. The migration runs as a backfill job before members are granted access, giving them a single searchable archive on day one of Workspace adoption.

Example prompt: Read every .eml file in /tmp/listserv-export/engineering, then for each one call POST /groups/v1/groups/engineering@example.com/archive with the file as multipart media and report the count of successful inserts.

### Acquisition Mailbox Consolidation

After acquiring a company, the receiving Workspace admin uses the Groups Migration API to fold the acquired company's distribution-list archives into Google Groups owned by the parent organisation. The API accepts one message per call, so the migration tool walks the source archive in date order and inserts each message into the matching destination group. Original RFC 822 headers are retained so legal discovery and audit searches still resolve.

Example prompt: Given a directory of RFC 822 messages from acquired-co exported by date, post each one to the archive endpoint of the matching destination group and produce a CSV of message-id, group, and HTTP status.

### AI Agent Bulk Archive Loader

An AI agent acting as a one-time migration worker uses Jentic to call the Groups Migration API once per source message, retrying transient failures and reporting progress to a human operator. Because the API allows only one message per request, the agent paces uploads to stay under per-project quota and surfaces any messages that fail validation. Jentic holds the domain admin OAuth credential so the raw token never enters the agent context.

Example prompt: For groupId support@example.com, iterate over a list of 5,000 RFC 822 message paths, call the archive insert operation for each, retry on 429 with backoff, and emit a final report of inserted, retried, and failed counts.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /groups/v1/groups/{groupId}/archive | Insert one RFC 822 message into the specified group's archive |

## Key resources

- **Archive** — Insert RFC 822 messages into a Google Group's archive (single insert endpoint)

## Why Jentic

- **Setup:** Wiring the Groups Migration API by hand means configuring domain-admin OAuth2, narrowing to the apps.groups.migration scope, refreshing tokens, and building the RFC 822 multipart upload yourself. Through Jentic you install once, import the Groups Migration API from the API Directory, store the OAuth credential once, and your agent calls it.
- **Permission scoping:** The group id travels in the URL path (/groups/v1/groups/{groupId}/archive), so a rule can pin your agent to one Google Group archive: it imports messages into that group and nothing else. You choose the operations it may call, and this integration exposes only the archive-insert operation, so no membership or group-creation actions are ever available.
- **Credential handling:** Your domain-admin OAuth credential is stored once, encrypted, by your own Jentic One instance and injected at execution time as a short-lived apps.groups.migration access token. The raw admin credential never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'archive a message into a google group', and Jentic returns the archive-insert operation with its multipart input schema so the agent uploads correctly without browsing the reference docs.

## Related APIs

- **Groups Settings API** — Configures permissions on the same Google Groups whose archives this API populates.
- **Admin SDK Directory API** — Creates and manages the Google Groups that Groups Migration writes archived messages into.
- **Gmail API** — Gmail API imports messages directly into individual user mailboxes; Groups Migration imports into shared group archives.

## FAQ

### What authentication does the Groups Migration API use?

Google OAuth 2.0 with the apps.groups.migration scope, executed by a Workspace domain administrator (or via domain-wide delegation from a service account). Through Jentic, the OAuth credential is stored encrypted and exchanged for a scoped access token at call time.

### Can I migrate attachments with the Groups Migration API?

Attachments are migrated only if they are part of the RFC 822 message body uploaded to /groups/v1/groups/{groupId}/archive. Externally referenced attachments (links to file shares) are not resolved or moved by the API.

### What are the rate limits for the Groups Migration API?

Google enforces a per-project quota on the Groups Migration API (default 1,500 queries per 100 seconds). Migrations of large archives should pace requests and back off on 429 responses.

### How do I import a single .eml file into a Google Group through Jentic?

Search Jentic with 'archive a message into a google group', load the insert operation on /groups/v1/groups/{groupId}/archive, then execute with groupId set to the destination group address and the .eml content as multipart media. Jentic handles OAuth and returns the archive ID on success.

### Does this API create new Google Groups?

No. Groups must already exist in Workspace before you can post to their archive. Use the Admin SDK Directory API or the Cloud Identity Groups API to create the destination group first, then run the migration.

### Can I limit what my agent is allowed to do with the Groups Migration API?

Yes. Because you self-host Jentic One, your own rules decide which operations and credentials the agent may use, and this integration exposes only the single archive-insert operation on /groups/v1/groups/{groupId}/archive, so no membership or group-creation actions are ever available. Since the group id travels in the URL path, you can pin the agent to one Google Group archive, letting it import RFC 822 messages into that group and nothing else. The domain-admin OAuth credential is injected at execution time as a short-lived apps.groups.migration token that never enters the agent's context.
