Email Account Management
Add OAuth Email Account
Connect Gmail or Outlook account using OAuth 2.0 with automatic token refresh
POST
Adds an OAuth-authenticated email account (Gmail or Outlook). SmartLead manages token refresh automatically. Use this endpoint after obtaining OAuth tokens from the respective provider.
Query Parameters
Your SmartLead API key
Request Body
Display name for outgoing emails
Email address (must match OAuth account)
Email username (typically same as from_email)
Provider type. Valid values:
GMAIL, OUTLOOKOAuth token object obtained from provider
Whether to enable email warmup for this account
Whether to use whitelabel OAuth credentials. Must be
true or falseEmail account ID (only for updates, null for new accounts)
Maximum emails allowed per day (including warmup and campaigns)
Custom domain for tracking links
BCC email address for all outgoing emails
Minimum time to wait between emails in minutes
Email signature HTML
Number of warmup emails per day (if warmup_enabled is true)
Daily increase in warmup email count
Target reply rate percentage for warmup
Client ID for multi-tenant accounts
Response Codes
OAuth email account added successfully
Invalid OAuth token or connection validation failed
Invalid or missing API key
Missing required fields or invalid type value
Server error occurred
OAuth Flow
Obtain OAuth tokens from provider
Use Google or Microsoft OAuth flow to obtain access and refresh tokens with appropriate mail scopes.
Gmail Scope Required:
https://mail.google.com/Outlook Scope Required: https://outlook.office.com/.default or https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.AllCall this endpoint with tokens
Send the OAuth tokens and account information to this endpoint. SmartLead will validate the connection.
Usage Notes
SmartLead automatically refreshes expired OAuth tokens using the refresh_token. Ensure the refresh_token is included in the token object.
Related Endpoints
- Add SMTP Email Account - For non-OAuth accounts
- Update Email Account
- Get All Email Accounts
