> ## 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.

# Create new SMTP user

> Creates a new SMTP user for outbound email sending



## OpenAPI

````yaml /openapi.json post /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:
    post:
      tags:
        - Outbound
      summary: Create new SMTP user
      description: Creates a new SMTP user for outbound email sending
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - username
              properties:
                username:
                  type: string
                  description: >-
                    SMTP username (will be sanitized to lowercase alphanumeric
                    with hyphens)
                  example: smtp-user1
                  minLength: 1
                  maxLength: 64
                  pattern: ^[a-z0-9-]+$
                password:
                  type: string
                  description: Optional password (will be generated if not provided)
                  example: mySecurePassword123
                  minLength: 8
                  maxLength: 72
                allowAnyDomain:
                  type: boolean
                  description: >-
                    Whether to allow sending from any domain (requires paid
                    subscription). Cannot be enabled together with
                    allowAllDomains.
                  default: false
                allowAllDomains:
                  type: boolean
                  description: >-
                    Whether to allow sending from all verified domains. Cannot
                    be enabled together with allowAnyDomain.
                  default: 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
                  default: []
                  example:
                    - example.com
                    - mydomain.com
                  maxItems: 50
                quota:
                  type: number
                  description: Email sending quota
                  default: 0
                  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
                  default: []
                  example:
                    - 192.168.1.1
                    - 10.0.0.1
                  maxItems: 50
      responses:
        '200':
          description: >-
            SMTP user created successfully. If no password was provided in the
            request, a generated password will be included in the response.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: SMTP user created successfully
                  password:
                    type: string
                    description: Only present if no password was provided in the request
                    example: generated-secure-password
              examples:
                With provided password:
                  value:
                    success: true
                    message: SMTP user created successfully
                With generated password:
                  value:
                    success: true
                    message: SMTP user created successfully
                    password: generated-secure-password
        '400':
          description: Bad Request - Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: SMTP username is required
        '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
        '409':
          description: Conflict - 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 create SMTP user
components:
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: API key for account management endpoints. Use your api_ prefixed token.

````