Authentication
Store Gmail tokens
Store OAuth 2.0 tokens to connect a Gmail account to PayPulse.
POST
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
Request body
Acceptsapplication/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.Error responses
| 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. |