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

# Update SMTP user

> Updates an existing SMTP user configuration



## OpenAPI

````yaml /openapi.json patch /outbound/smarthost
openapi: 3.0.0
info:
  title: JetEmail API
  version: 1.0.0
  description: API documentation for JetEmail's transactional email service.
servers:
  - url: https://api.jetemail.com
    description: Production
security:
  - apiKeyAuth: []
externalDocs:
  description: Download OpenAPI Specification
  url: /openapi.json
paths:
  /outbound/smarthost:
    patch:
      tags:
        - Outbound
      summary: Update SMTP user
      description: Updates an existing SMTP user configuration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - currentUsername
              properties:
                currentUsername:
                  type: string
                  description: Current SMTP username to update
                  example: existing-user
                newUsername:
                  type: string
                  description: >-
                    New SMTP username (will be sanitized to lowercase
                    alphanumeric with hyphens)
                  example: new-user-name
                  minLength: 1
                  maxLength: 64
                  pattern: ^[a-z0-9-]+$
                password:
                  type: string
                  description: New password
                  example: newSecurePassword123
                  minLength: 8
                  maxLength: 72
                allowAnyDomain:
                  type: boolean
                  description: >-
                    Whether to allow sending from any domain (requires paid
                    subscription). Cannot be enabled together with
                    allowAllDomains.
                  example: false
                allowAllDomains:
                  type: boolean
                  description: >-
                    Whether to allow sending from all verified domains. Cannot
                    be enabled together with allowAnyDomain.
                  example: false
                approvedDomains:
                  type: array
                  items:
                    type: string
                    pattern: >-
                      ^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?.)+[a-zA-Z]{2,}$
                  description: List of approved domains for sending
                  example:
                    - example.com
                    - mydomain.com
                  maxItems: 253
                quota:
                  type: number
                  description: Email sending quota
                  example: 1000
                  minimum: 0
                ipRestrictions:
                  type: array
                  items:
                    type: string
                    pattern: >-
                      ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
                  description: List of allowed IP addresses
                  example:
                    - 192.168.1.1
                    - 10.0.0.1
                  maxItems: 50
                status:
                  type: string
                  enum:
                    - inactive
                    - active
                    - suspended
                    - quota-locked
                    - quota-unlocked
                  description: Status of the SMTP user
            examples:
              Update username:
                value:
                  currentUsername: old-user
                  newUsername: new-user
              Update multiple fields:
                value:
                  currentUsername: existing-user
                  allowAnyDomain: true
                  approvedDomains:
                    - newdomain.com
                  quota: 2000
                  ipRestrictions:
                    - 192.168.1.100
              Update status:
                value:
                  currentUsername: existing-user
                  status: active
      responses:
        '200':
          description: SMTP user updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Smarthost updated successfully
        '400':
          description: Bad Request - Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: No valid updates provided
        '401':
          description: Unauthorized - User not authenticated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Required information not found
        '403':
          description: Forbidden - Feature not available
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Allow Any Domain feature requires a paid subscription
        '404':
          description: Not Found - Smarthost not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Smarthost not found or access denied
        '409':
          description: Conflict - New username already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: This SMTP username is already in use
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Failed to update smarthost
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````