---
title: "Update mailbox connection settings"
method: PATCH
path: "/workspaces/{workspaceID}/mailboxes/{mailboxID}/connection-settings"
tags: ["Mailboxes"]
---

# Update mailbox connection settings

`PATCH /workspaces/{workspaceID}/mailboxes/{mailboxID}/connection-settings`

## Request

- Base URL: `https://api.salesforge.ai/public/v2`
- URL: `https://api.salesforge.ai/public/v2/workspaces/{workspaceID}/mailboxes/{mailboxID}/connection-settings`
- Auth: API key in header `Authorization`

Updates SMTP and/or IMAP credentials without recreating or disconnecting the mailbox. Each supplied leg requires host, port, username and password; omitted legs and mailbox metadata are unchanged. Both supplied legs are verified before saving. Uses the same TLS settings and fallback as mailbox connection. If the mail provider has no account for this mailbox, send both SMTP and IMAP; the account is registered again. OAuth mailboxes require provider reauthorization.

## Path parameters

- `workspaceID` string, required
- `mailboxID` string, required

## Request body

- union
  - object
  - ApiUpdateMailboxConnectionSettingsRequest
    - `imap` ApiMailboxConnectionRequest
      - `host` string, required: Hostname of the mail server.
      - `password` string, required: Password or provider-issued app password. Never returned by any endpoint.
      - `port` integer, required: Port the mail server listens on (for example 993 for IMAP, 465 or 587 for SMTP).
      - `username` string, required: Username used to authenticate with the mail server.
    - `smtp` ApiMailboxConnectionRequest
      - `host` string, required: Hostname of the mail server.
      - `password` string, required: Password or provider-issued app password. Never returned by any endpoint.
      - `port` integer, required: Port the mail server listens on (for example 993 for IMAP, 465 or 587 for SMTP).
      - `username` string, required: Username used to authenticate with the mail server.

## Response `204`

No Content

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/salesforge/apis/salesforge-api.md) - [All operations](https://skmtc.dev/salesforge/apis/salesforge-api/llms.txt) - [OpenAPI document](https://skmtc.dev/salesforge/apis/salesforge-api/revisions/3f946278b378?raw)
