> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create account

> - Creates a new account and a user if the provided email does not exist on the system.
- Associates the user with the account with root privileges.
- Sends an email to the user to verify their email address if the email is not already verified on the system.
- A user can be a member of any number of accounts but they can be a root of at most one account.



## OpenAPI

````yaml /api-reference/endpoint/accounts/openapi.json post /accounts
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    API for managing accounts, users, authentication, and payments in the
    quiva.ai platform
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Account Management
    description: Operations related to account creation, updating, and deletion
  - name: User Management
    description: Operations related to user creation, updating, and deletion
  - name: Authentication
    description: Operations related to authentication and session management
  - name: API Keys
    description: Operations related to API key management
  - name: Multi-Factor Authentication
    description: Operations related to MFA setup and verification
  - name: Payment
    description: Operations related to subscription and payment management
  - name: Mesh Nodes
    description: Operations related to mesh node management
paths:
  /accounts:
    post:
      tags:
        - Account Management
      summary: Create account
      description: >-
        - Creates a new account and a user if the provided email does not exist
        on the system.

        - Associates the user with the account with root privileges.

        - Sends an email to the user to verify their email address if the email
        is not already verified on the system.

        - A user can be a member of any number of accounts but they can be a
        root of at most one account.
      operationId: createAccount
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountRequest'
            example:
              name: acme
              root_first_name: John
              root_last_name: Doe
              root_email: admin@acme.com
              password: SecureP@ssw0rd!
              country: US
              company_name: ACME Corporation
              address: 123 Main St, Anytown, USA
              website: https://acme.com
              phone_number: '+1234567890'
      responses:
        '200':
          description: Account created successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      email_confirmed:
                        type: boolean
              example:
                data:
                  email_confirmed: false
                  description: >-
                    This flag confirms whether a new or an existing user is the
                    root of the newly created account.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security: []
components:
  schemas:
    CreateAccountRequest:
      type: object
      properties:
        name:
          type: string
          description: >-
            Account name that members of the account will be using when signing
            in. It is case-insensitive. Heading and trailing spaces are trimmed
        root_first_name:
          type: string
          description: Root user first name
        root_last_name:
          type: string
          description: Root user last name
        root_email:
          type: string
          format: email
          description: >-
            Root user email. A user is not allowed to use the same email as a
            root email for multiple accounts.
        password:
          type: string
          format: password
          description: |-
            Root user password.
            It has to be a new password if the user is new to the system.
            If the user exists, they must provide their current password.
            New password requirements:
            - Minimum length: 8 characters 
             - Must contain at least one uppercase letter 
             - Must contain at least one lowercase letter 
             - Must contain at least one digit (number) 
             - Must contain at least one special character (punctuation or symbol) 
             - Maximum length: 99 characters
        country:
          type: string
          description: Country
        company_name:
          type: string
          description: Company name
        address:
          type: string
          description: Company address
        website:
          type: string
          description: Company website
        phone_number:
          type: string
          description: Company phone number
      required:
        - name
        - root_email
        - password
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````