API reference · Email
POST/api/email/refresh-watch

Refresh Gmail watch registration

Forces Pub/Sub setup and Gmail watch registration refresh for an active Google email provider. Requires a valid Auth.js session. The providerId must reference email_providers.id for a provider_type=google record with a google_email_provider_config row and project_id. Internally this calls configureGmailProvider with force=true.

Request body

Content type: application/json · schema EmailRefreshWatchRequest

providerIdstring <uuid>Required
Active Gmail email provider ID from email_providers.id to refresh.

Response body

Success response 200 · schema EmailRefreshWatchResponse

successbooleanRequired
Refresh completed successfully.
Enum: true
messagestringRequired
Human-readable success message.
providerIdstring <uuid>Required
Email provider ID that was refreshed.
mailboxstring <email>Required
Mailbox address for the Gmail provider.

Response codes

200
Gmail provider Pub/Sub and watch registration refreshed successfully.
400
providerId is missing, or the Gmail provider has no project_id configured.
401
No authenticated user session was found.
404
Gmail provider or Gmail configuration row was not found.
500
Refresh failed unexpectedly. Response includes success=false and an error message.