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

# Create Email Account

> Requires the `email.write` token ability.

`domain_id` is a domain from `GET /domains`, `quota` is the mailbox size
in megabytes (100 to 100000). The password must be strong (a zxcvbn score
of at least 3); it is stored hashed and never returned.



## OpenAPI

````yaml /api-reference/openapi.json post /email-accounts
openapi: 3.1.2
info:
  title: Hosting Panel API
  version: 1.0.0
  description: >-
    The customer-facing hosting panel API. A request is scoped to the hosting
    account its bearer token belongs to; the token abilities decide which
    endpoints it may call.
servers:
  - url: https://hosting-panel.net/api/v1
security:
  - sanctum: []
tags:
  - name: Account
  - name: Domains
  - name: DNS
  - name: Email Accounts
  - name: Forwarders
  - name: Databases
  - name: FTP Accounts
  - name: Cron Jobs
  - name: URL Schedules
  - name: Node.js Applications
  - name: Valkey
  - name: Photon Optimizer
  - name: Statistics
  - name: PSI Metrics
  - name: PHP Versions
  - name: Reseller
paths:
  /email-accounts:
    post:
      tags:
        - Email Accounts
      summary: Create Email Account
      description: >-
        Requires the `email.write` token ability.


        `domain_id` is a domain from `GET /domains`, `quota` is the mailbox size

        in megabytes (100 to 100000). The password must be strong (a zxcvbn
        score

        of at least 3); it is stored hashed and never returned.
      operationId: emailAccount.store
      parameters:
        - name: per_page
          in: query
          description: Results per page. Defaults to 50, capped at 200.
          schema:
            type: integer
            default: 50
            minimum: 1
            maximum: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain_id:
                  type: integer
                local_part:
                  type: string
                  pattern: ^[a-zA-Z0-9_][a-zA-Z0-9._-]*$
                  maxLength: 64
                password:
                  type: string
                  maxLength: 255
                quota:
                  type: integer
                  minimum: 100
                  maximum: 100000
              required:
                - domain_id
                - local_part
                - password
                - quota
      responses:
        '201':
          description: '`EmailAccountResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/EmailAccountResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          description: An error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error overview.
                required:
                  - message
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    EmailAccountResource:
      type: object
      properties:
        id:
          type: integer
        address:
          type: string
        local_part:
          type: string
        domain:
          type: string
        is_managed:
          type: boolean
        managed_by:
          type:
            - string
            - 'null'
        quota_mb:
          type: integer
        used_bytes:
          type: integer
        spam:
          type: object
          properties:
            filter_enabled:
              type: boolean
            reject_score:
              type: number
          required:
            - filter_enabled
            - reject_score
        created_at:
          type:
            - string
            - 'null'
      required:
        - id
        - address
        - local_part
        - domain
        - is_managed
        - managed_by
        - quota_mb
        - used_bytes
        - spam
        - created_at
      title: EmailAccountResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    sanctum:
      type: http
      description: >-
        An API access token, sent as `Authorization: Bearer <token>`. Its
        abilities decide which endpoints it may call.
      scheme: bearer

````

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