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

# create mail server



## OpenAPI

````yaml /spec/mail.yaml post /api/v1/mails
openapi: 3.0.1
info:
  title: Liara Mail API Documentaion
  description: |-
    A fully featured mail delivery platform for incoming & outgoing e-mail

    Parameters:
    - `teamID`: To access services in a team
  contact:
    name: liara
    url: https://liara.ir
    email: support@liara.ir
  version: 1.0.0
servers:
  - url: https://mail-service.iran.liara.ir
security:
  - jwt: []
tags:
  - name: mails
    description: Everything about your mails
  - name: inboundrules
    description: Email address (or domain) that you would like to block from sending.
  - name: smtp
    description: SMTP endpoints.
  - name: accounts
    description: Accounts of your mails.
  - name: messages
    description: Messages endpoints.
  - name: forward
    description: Forward endpoints.
  - name: attachments
    description: Attachments endpoints.
  - name: event
    description: Event endpoints.
  - name: tags
    description: Tags endpoints.
  - name: plan
    description: Plan endpoints.
externalDocs:
  description: Find out more about Liara Mail Server
  url: https://docs.liara.ir/email/create-mail-server/
paths:
  /api/v1/mails:
    post:
      tags:
        - mails
      summary: create mail server
      operationId: postMails
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model1'
        required: false
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
        '400':
          description: Invalid request for plan
          content: {}
        '402':
          description: Not enough balance
          content: {}
        '403':
          description: Allowed to create only one Mail Server on the free plan
          content: {}
        '500':
          description: Unexpected error
          content: {}
components:
  schemas:
    Model1:
      required:
        - domain
        - mode
        - plan
      type: object
      properties:
        plan:
          maxLength: 64
          type: string
        domain:
          type: string
          x-convert:
            case: lower
        mode:
          $ref: '#/components/schemas/mode'
    mode:
      type: string
      enum:
        - DEV
        - LIVE
  securitySchemes:
    jwt:
      type: apiKey
      description: 'Enter the token with the `Bearer: ` prefix, e.g. "Bearer abcde12345".  #'
      name: Authorization
      in: header

````