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.
This endpoint is called from the iOS app immediately after a successful Google Sign-In flow. The OAuth tokens obtained from Google are forwarded here to be securely stored in AWS Secrets Manager, enabling PayPulse to read Gmail invoices on the user’s behalf.
Authentication
Bearer JWT token obtained from Login or Sign up . Format: Bearer <access_token>.
Request body
Accepts application/json or application/x-www-form-urlencoded.
The Google OAuth 2.0 access token returned after Google Sign-In.
The Google OAuth 2.0 refresh token. Required to renew access when the access token expires.
Lifetime of the access token in seconds.
Array of OAuth scope strings granted by the user (e.g. ["https://www.googleapis.com/auth/gmail.readonly"]). When sending application/x-www-form-urlencoded, provide a comma-separated string.
The Google account email address associated with the tokens.
Response
A human-readable confirmation message. Example: "Gmail OAuth tokens stored successfully!"
HTTP status code. 201 on success.
The Google account email address retrieved from the access token via the Google userinfo API.
Space-separated string of granted OAuth scopes.
true if the user has connected a different Google account than the one previously stored.
A message describing the account consistency check result.
Error responses
Status Error code Description 400INVALID_CREDENTIALSThe OAuth tokens failed validation (e.g. missing required scopes or token is invalid). 400INVALID_JSONThe request body is not valid JSON. 400MISSING_FIELDSA required field is absent from the request body. 502DEPENDENCY_FAILUREFailed to communicate with Google APIs or AWS Secrets Manager. 500INTERNAL_SERVER_ERRORAn unexpected server-side error occurred.
Error responses follow this structure:
{
"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."
}
}