# Reconnect Email Account

> Save a new password for an email account after testing it.

Requires an API key with the `write` scope.

Tests SMTP and IMAP against the account's stored hosts with the new password and saves it only if both pass. This is also how you recover an account whose Google sign-in was revoked: on success the account switches back to password authentication, its OAuth tokens are dropped, `connectionStatus` returns to `connected`, `lastError` is cleared and the account is set active.

## Path Parameters

<ParamField path="account_id" type="string" required>
  The unique identifier of the email account.
</ParamField>

## Body Parameters

<ParamField body="password" type="string" required>
  The new app password to test and save.
</ParamField>

## Response

<ResponseField name="data" type="object">
  The email account object. Passwords and OAuth tokens are never returned.

  <Expandable title="data">
    <ResponseField name="id" type="string">Email account identifier.</ResponseField>
    <ResponseField name="email" type="string">Mailbox address.</ResponseField>
    <ResponseField name="displayName" type="string">Friendly name shown on sent mail, or `null`.</ResponseField>
    <ResponseField name="provider" type="string">Provider the account was connected as.</ResponseField>
    <ResponseField name="smtpHost" type="string">SMTP host.</ResponseField>
    <ResponseField name="smtpPort" type="integer">SMTP port.</ResponseField>
    <ResponseField name="imapHost" type="string">IMAP host.</ResponseField>
    <ResponseField name="imapPort" type="integer">IMAP port.</ResponseField>
    <ResponseField name="timezone" type="string">IANA timezone used for the account's daily limit window.</ResponseField>
    <ResponseField name="dailyLimit" type="integer">Maximum campaign emails per day.</ResponseField>
    <ResponseField name="sentToday" type="integer">Campaign emails sent today in the account's timezone. Warmup sends are not counted.</ResponseField>
    <ResponseField name="warmupEnabled" type="boolean">Whether warmup is on.</ResponseField>
    <ResponseField name="warmupDailyLimit" type="integer">Warmup mail per day once the ramp is complete.</ResponseField>
    <ResponseField name="warmupRampUpDays" type="integer">Days the warmup ramp takes.</ResponseField>
    <ResponseField name="warmupStartDate" type="string">ISO 8601 timestamp the ramp started, or `null`.</ResponseField>
    <ResponseField name="healthScore" type="integer">Stored health score, or `null`. For the live placement score use [Get Account Health](/api-reference/email-accounts/get-account-health).</ResponseField>
    <ResponseField name="domainAuth" type="object">SPF, DKIM and DMARC check result, or `null` until checked.</ResponseField>
    <ResponseField name="domainAuthCheckedAt" type="string">ISO 8601 timestamp of the last domain check, or `null`.</ResponseField>
    <ResponseField name="bounceRate" type="number">Bounce rate.</ResponseField>
    <ResponseField name="replyRate" type="number">Reply rate.</ResponseField>
    <ResponseField name="isActive" type="boolean">Whether the account is used for sending.</ResponseField>
    <ResponseField name="connectionStatus" type="string">Connection state, for example `connected`.</ResponseField>
    <ResponseField name="lastError" type="string">Last connection error, or `null`.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
```bash cURL
curl -X POST "https://api.foxreach.io/api/v1/email-accounts/cea_abc123/reconnect" \
  -H "X-API-Key: otr_your_key" \
  -H "Content-Type: application/json" \
  -d '{"password": "new-app-password"}'
```

```python Python SDK
from foxreach import FoxReach
from foxreach.types import ReconnectRequest

client = FoxReach(api_key="otr_your_key")
account = client.email_accounts.reconnect("cea_abc123", ReconnectRequest(password="new-app-password"))
```

```typescript TypeScript SDK
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const account = await client.emailAccounts.reconnect("cea_abc123", { password: "new-app-password" });
```
</RequestExample>

<ResponseExample>
```json
{
  "data": {
    "id": "cea_abc123",
    "email": "outreach@company.com",
    "displayName": "John from Company",
    "provider": "gmail",
    "smtpHost": "smtp.gmail.com",
    "smtpPort": 587,
    "imapHost": "imap.gmail.com",
    "imapPort": 993,
    "timezone": "UTC",
    "dailyLimit": 50,
    "sentToday": 0,
    "warmupEnabled": false,
    "warmupDailyLimit": 5,
    "warmupRampUpDays": 14,
    "warmupStartDate": null,
    "healthScore": null,
    "domainAuth": null,
    "domainAuthCheckedAt": null,
    "bounceRate": 0,
    "replyRate": 0,
    "isActive": true,
    "connectionStatus": "connected",
    "lastError": null,
    "createdAt": "2026-10-31T10:00:00",
    "updatedAt": "2026-10-31T10:00:00"
  }
}
```
</ResponseExample>

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `write` |
| `404` | Email account not found, or it belongs to another workspace |
| `400` | `Connection failed: SMTP: <reason>; IMAP: <reason>`. Only the side that failed is listed |
| `422` | `password` is missing |

## Rate Limit

- **100 requests per minute, per API key.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (unix epoch seconds).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns (`Retry-After`, exponential backoff, monitoring `X-RateLimit-Remaining`), see [Rate Limiting](/rate-limiting).
