curl --request POST \
--url https://api.paypulse.io/v1/auth/gmail/store-tokens \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "ya29.a0AfH6SMB...",
"refresh_token": "1//0eXx...",
"expires_in": 3599,
"scope": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
],
"email": "jane@gmail.com"
}'
{
"message": "Gmail OAuth tokens stored successfully!",
"code": 201,
"data": {
"google_email": "jane@gmail.com",
"scope": "https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/userinfo.email",
"account_switch": false,
"message": "Google account is consistent with previously stored account."
}
}
Store OAuth 2.0 tokens to connect a Gmail account to PayPulse.
curl --request POST \
--url https://api.paypulse.io/v1/auth/gmail/store-tokens \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "ya29.a0AfH6SMB...",
"refresh_token": "1//0eXx...",
"expires_in": 3599,
"scope": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
],
"email": "jane@gmail.com"
}'
{
"message": "Gmail OAuth tokens stored successfully!",
"code": 201,
"data": {
"google_email": "jane@gmail.com",
"scope": "https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/userinfo.email",
"account_switch": false,
"message": "Google account is consistent with previously stored account."
}
}
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/azfar-imtiaz/PayPulse-Cloud/llms.txt
Use this file to discover all available pages before exploring further.
application/json or application/x-www-form-urlencoded.
["https://www.googleapis.com/auth/gmail.readonly"]). When sending application/x-www-form-urlencoded, provide a comma-separated string."Gmail OAuth tokens stored successfully!"201 on success.Hide properties
true if the user has connected a different Google account than the one previously stored.| Status | Error code | Description |
|---|---|---|
400 | INVALID_CREDENTIALS | The OAuth tokens failed validation (e.g. missing required scopes or token is invalid). |
400 | INVALID_JSON | The request body is not valid JSON. |
400 | MISSING_FIELDS | A required field is absent from the request body. |
502 | DEPENDENCY_FAILURE | Failed to communicate with Google APIs or AWS Secrets Manager. |
500 | INTERNAL_SERVER_ERROR | An unexpected server-side error occurred. |
{
"error": {
"code": "INVALID_CREDENTIALS",
"message": "Invalid OAuth tokens"
}
}
curl --request POST \
--url https://api.paypulse.io/v1/auth/gmail/store-tokens \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data '{
"access_token": "ya29.a0AfH6SMB...",
"refresh_token": "1//0eXx...",
"expires_in": 3599,
"scope": [
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/userinfo.email"
],
"email": "jane@gmail.com"
}'
{
"message": "Gmail OAuth tokens stored successfully!",
"code": 201,
"data": {
"google_email": "jane@gmail.com",
"scope": "https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/userinfo.email",
"account_switch": false,
"message": "Google account is consistent with previously stored account."
}
}