> ## Documentation Index
> Fetch the complete documentation index at: https://developer.salesforge.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update mailbox connection settings

> 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. OAuth mailboxes require provider reauthorization.



## OpenAPI

````yaml https://api.salesforge.ai/public/v2/swagger/doc.json patch /workspaces/{workspaceID}/mailboxes/{mailboxID}/connection-settings
openapi: 3.1.0
info:
  description: Get mailboxes associated with the workspace.
  termsOfService: https://www.salesforge.ai/terms
  title: Salesforge API
  version: '2.0'
servers:
  - url: https://api.salesforge.ai/public/v2
security:
  - ApiKeyAuth: []
externalDocs:
  description: ''
  url: ''
paths:
  /workspaces/{workspaceID}/mailboxes/{mailboxID}/connection-settings:
    patch:
      tags:
        - Mailboxes
      summary: Update mailbox connection settings
      description: >-
        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. OAuth mailboxes require provider reauthorization.
      parameters:
        - description: Workspace ID
          in: path
          name: workspaceID
          required: true
          schema:
            type: string
        - description: Mailbox ID
          in: path
          name: mailboxID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                - $ref: >-
                    #/components/schemas/api.UpdateMailboxConnectionSettingsRequest
                  description: Connection settings
                  summary: request
        description: Connection settings
        required: true
      responses:
        '204':
          description: No Content
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.Error'
          description: Internal Server Error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    api.UpdateMailboxConnectionSettingsRequest:
      properties:
        imap:
          $ref: '#/components/schemas/api.MailboxConnectionRequest'
        smtp:
          $ref: '#/components/schemas/api.MailboxConnectionRequest'
      type: object
    errors.Error:
      allOf:
        - $ref: '#/components/schemas/data'
      properties:
        data: {}
        message:
          type: string
      type: object
    api.MailboxConnectionRequest:
      properties:
        host:
          description: >-
            Hostname of the mail server. Your mail provider publishes this; it
            is usually of the form

            imap.yourprovider.com or smtp.yourprovider.com.
          example: mail.example.com
          type: string
        password:
          description: >-
            Password or provider-issued app password for the username above.
            Sent over TLS, stored

            encrypted, and never returned by any endpoint. Where your provider
            supports app passwords,

            prefer one over the account password so it can be revoked
            independently.
          type: string
        port:
          description: >-
            Port the mail server listens on. It also selects how the connection
            is encrypted: 993 (IMAP)

            and 465 (SMTP) use implicit TLS, 587 (SMTP) uses STARTTLS. Any other
            port is attempted with

            TLS first and retried without strict certificate verification.
          example: 587
          maximum: 65535
          minimum: 1
          type: integer
        username:
          description: >-
            Username the mail server authenticates with. Often, but not always,
            the mailbox address —

            check your provider, as some issue a separate login.
          example: jane@example.com
          type: string
      required:
        - host
        - password
        - port
        - username
      type: object
    data:
      properties:
        data:
          items:
            $ref: '#/components/schemas/api.DNCResponse'
          type: array
      type: object
    api.DNCResponse:
      properties:
        createdAt:
          type: string
        type:
          $ref: '#/components/schemas/models.DncType'
        value:
          type: string
      type: object
    models.DncType:
      enum:
        - email
        - domain
        - linkedin
      type: string
      x-enum-varnames:
        - DncTypeEmail
        - DncTypeDomain
        - DncTypeLinkedin
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````