/gmail/v1/users/{userId}/history
GET
/gmail/v1/users/{userId}/history
users
historyId
).Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://gmail.googleapis.com//gmail/v1/users//history'
Response Response Example
{
"history": [
{
"id": "string",
"labelsAdded": [
{
"labelIds": [
"string"
],
"message": {
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
}
],
"labelsRemoved": [
{
"labelIds": [
"string"
],
"message": {
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
}
],
"messages": [
{
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
],
"messagesAdded": [
{
"message": {
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
}
],
"messagesDeleted": [
{
"message": {
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
}
]
}
],
"historyId": "string",
"nextPageToken": "string"
}
Request
Path Params
userId
stringÂ
required
me
can be used to indicate the authenticated user.Query Params
historyTypes
array[string]
optional
labelId
stringÂ
optional
maxResults
integerÂ
optional
pageToken
stringÂ
optional
startHistoryId
stringÂ
optional
startHistoryId
. The supplied startHistoryId
should be obtained from the historyId
of a message, thread, or previous list
response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId
typically returns an HTTP 404
error code. A historyId
is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404
error response, your application should perform a full sync. If you receive no nextPageToken
in the response, there are no updates to retrieve and you can store the returned historyId
for a future request.Responses
Modified at 2023-08-15 05:40:23