Email Accounts

Connect Email Account

POST/v1/email-accounts
POST
/v1/email-accounts

Connect Email Account

Connect a Gmail or Microsoft email account using OAuth tokens obtained by the partner through their own OAuth flow. Creates the account with all warmup defaults configured and ready to start warmup.

Authorization

X-Api-Key<token>

In: header

Request Body

application/jsonRequired

fromEmailstring

Example: "user@example.com"

fromNamestring

Example: "John Doe"

typestring

Example: "gmail"Value in: "gmail" | "microsoft" | "smtp"

accessTokenstring

Example: "ya29.access_token"

refreshTokenstring

Example: "1//refresh_token"

expiresInnumber

Example: 3599

emailServiceProviderstring

Example: "other"Value in: "gmail" | "microsoft" | "gsuite" | "o365" | "other" | "yahoo" | "zoho" | "godaddy" | "yandex" | "sendgrid" | "mailgun" | "amazonses"

smtpobject

imapobject

Responses

201
201 response
{
  "emailAccountId": 123,
  "fromEmail": "user@gmail.com",
  "fromName": "John Doe",
  "type": "gmail",
  "status": "active"
}

Request

curl -X POST \
  "https://lupus-edge.trulyinbox.com/v1/email-accounts" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fromEmail": "user@example.com",
  "fromName": "John Doe",
  "type": "gmail",
  "accessToken": "ya29.access_token",
  "refreshToken": "1//refresh_token",
  "expiresIn": 3599,
  "emailServiceProvider": "other",
  "smtp": {
    "host": "smtp.example.com",
    "port": 587,
    "password": "your-password",
    "encryption": "TLS",
    "userName": "smtp-username"
  },
  "imap": {
    "host": "imap.example.com",
    "port": 993,
    "password": "your-password",
    "encryption": "SSL"
  }
}'

Response

No response body