Stay organized with collectionsSave and categorize content based on your preferences.
Before migrating an email to Google Groups by using the Groups Migration API, do the
following
Confirm that the target group exists and the group's email is accurate before migrating an
email message to that group's archive. For more information about listing groups and users, see
theDirectory API.
If the email's sender has the same domain as the target group, confirm the email sender exists
before migrating the email message to the target group's archive.
The email message format must be in theRFC 822 standard definition.
Use theContent-type: message/rfc822header. Confirm that the email message'sTo:,From:, andDate:fields are properly formed. The
response is returned in theJSONdata format.
Migrate an email message to Google Groups
To migrate an email message to a group's archive, send aPOSTHTTP request,
include theAuthorizationheader, and replaceGROUP_EMAIL_ADDRESSwith the email address of the group that the messages
are intended for:
POST https://www.googleapis.com/upload/groups/v1/groups/GROUP_EMAIL_ADDRESS/archive?uploadType=media
Example request
This example migrates email messages to the samplegroup@googlegroups.com archive. TheContent-Lengthis limited to 25MB which includes the message's meta data, body, and any
attachments:
POST https://www.googleapis.com/upload/groups/v1/groups/samplegroup@googlegroups.com/archive?uploadType=media
Host: www.googleapis.com
Content-Type: message/rfc822
Content-Length:BYTESAuthorization: BearerAuth tokenMETADATA_BODY
Replace the following:
BYTES: the number of bytes in the email.
AUTH_TOKEN: theAuthorizationheader.
METADATA_BODY: the email's metadata, body, and any attachments.
The following is an example email message in RFC 822 text format that was migrated into the
archive of samplegroup@googlegroups.com. TheNNNN@mail.samplegroup.comis this
example's Message-ID. The migrated email's sender is samplesender@example.com and the email is
migrated to the archive of the samplegroup@googlegroups.com group:
Received: by 10.143.160.15 with HTTP; Mon, 16 Jul 2007 10:12:26 -0700 (PDT)
Message-ID: <NNNN@mail.samplegroup.com>
Date: Mon, 16 Jul 2007 10:12:26 -0700
From: samplesender@example.com
To: samplegroup@googlegroups.com
Subject: SUBJECT
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Delivered-To: samplegroup@samplegroup.com
This is the body of the migrated email message.
A successful response returns a200HTTP status code and the migration status.
For more information aboutresponseCodevalues, seethe Groups Migration API reference.
View imported messages on the Google Groups interface
On Google Groups, threads' read/unread state is stored separately for each user. When
inserting messages and threads using the Groups Migration API, they're treated as if
they were sent by the user in theFrom:header. This means that they appear as unread
for all users, except for the user whose address is in theFrom:header. For example,
after the previous JSON request example, the message titledSUBJECTappears as read
ifsamplesender@example.comlogged in to Google Groups, but appears as unread
for all other users.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Migrate emails\n\nBefore migrating an email to Google Groups by using the Groups Migration API, do the\nfollowing\n\n- Confirm that the target group exists and the group's email is accurate before migrating an email message to that group's archive. For more information about listing groups and users, see the [Directory API](/workspace/admin/directory).\n- If the email's sender has the same domain as the target group, confirm the email sender exists before migrating the email message to the target group's archive.\n- The email message format must be in the [RFC 822 standard definition](https://www.w3.org/Protocols/rfc822/). Use the `Content-type: message/rfc822` header. Confirm that the email message's `To:`, `From:`, and `Date:` fields are properly formed. The response is returned in the [JSON](https://www.json.org/) data format.\n\nMigrate an email message to Google Groups\n-----------------------------------------\n\nTo migrate an email message to a group's archive, send a `POST` HTTP request,\ninclude the `Authorization` header, and replace\n\u003cvar translate=\"no\"\u003eGROUP_EMAIL_ADDRESS\u003c/var\u003e with the email address of the group that the messages\nare intended for: \n\n```\nPOST https://www.googleapis.com/upload/groups/v1/groups/GROUP_EMAIL_ADDRESS/archive?uploadType=media\n```\n\n### Example request\n\nThis example migrates email messages to the samplegroup@googlegroups.com archive. The\n`Content-Length` is limited to 25MB which includes the message's meta data, body, and any\nattachments: \n\n```\nPOST https://www.googleapis.com/upload/groups/v1/groups/samplegroup@googlegroups.com/archive?uploadType=media\nHost: www.googleapis.com\nContent-Type: message/rfc822\nContent-Length: BYTES\nAuthorization: Bearer Auth token\n\nMETADATA_BODY\n```\n\nReplace the following:\n- \u003cvar translate=\"no\"\u003eBYTES\u003c/var\u003e: the number of bytes in the email.\n- \u003cvar translate=\"no\"\u003eAUTH_TOKEN\u003c/var\u003e: the `Authorization` header.\n- \u003cvar translate=\"no\"\u003eMETADATA_BODY\u003c/var\u003e: the email's metadata, body, and any attachments.\n- The following is an example email message in RFC 822 text format that was migrated into the archive of samplegroup@googlegroups.com. The `NNNN@mail.samplegroup.com` is this example's Message-ID. The migrated email's sender is samplesender@example.com and the email is migrated to the archive of the samplegroup@googlegroups.com group: \n\n```\n Received: by 10.143.160.15 with HTTP; Mon, 16 Jul 2007 10:12:26 -0700 (PDT)\n Message-ID: \u003cNNNN@mail.samplegroup.com\u003e\n Date: Mon, 16 Jul 2007 10:12:26 -0700\n From: samplesender@example.com\n To: samplegroup@googlegroups.com\n Subject: SUBJECT\n MIME-Version: 1.0\n Content-Type: text/plain; charset=ISO-8859-1; format=flowed\n Content-Transfer-Encoding: 7bit\n Content-Disposition: inline\n Delivered-To: samplegroup@samplegroup.com\n\n This is the body of the migrated email message.\n```\n- A successful response returns a `200` HTTP status code and the migration status. For more information about `responseCode` values, see [the Groups Migration API reference](/workspace/admin/groups-migration/v1/reference/archive/insert). \n\n```text\n{\n \"kind\": \"groupsMigration#groups\",\n \"responseCode\": \"SUCCESS\",\n}\n```\n\nView imported messages on the Google Groups interface\n-----------------------------------------------------\n\n- On Google Groups, threads' read/unread state is stored separately for each user. When inserting messages and threads using the Groups Migration API, they're treated as if they were sent by the user in the `From:` header. This means that they appear as unread for all users, except for the user whose address is in the `From:` header. For example, after the previous JSON request example, the message titled `SUBJECT` appears as read if `samplesender@example.com` logged in to Google Groups, but appears as unread for all other users."]]