Reads one message from the connected Gmail mailbox: headers, plain-text and HTML body, and the attachment list.
curl -X POST "https://api.primaryapi.com/v1/run/gmail.message" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"18c3a1f0e2b4d5f6"}'{
"output": {
"found": true,
"data": {
"truncated": false,
"snippet": "Here are the numbers for October.",
"from": "Alice Example <[email protected]>",
"to": "[email protected]", …
}
},
"credits": 1
}Input and output
3 fields
18c3a1f0e2b4d5f6.14 fields
Good to know
Runs as your connected Google account (read-only Gmail access).
Attachment contents are not downloaded.
A deleted or unknown message id is a miss (found: false). A miss is an answer, not an error.
More from Gmail. Same key, same credits.
The same key and credits work for every API.