> ## Documentation Index
> Fetch the complete documentation index at: https://developers.calendio.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. 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.



## 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. 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.
      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.
          example: mail.example.com
          type: string
        password:
          description: >-
            Password or provider-issued app password. Never returned by any
            endpoint.
          type: string
        port:
          description: >-
            Port the mail server listens on (for example 993 for IMAP, 465 or
            587 for SMTP).
          example: 587
          maximum: 65535
          minimum: 1
          type: integer
        username:
          description: Username used to authenticate with the mail server.
          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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.