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

# Create Account

> Create a new account.

Creates a new account with auto-generated ID and optional slug.
Only superadmins can access this endpoint.



## OpenAPI

````yaml post /api/v1/accounts
openapi: 3.1.0
info:
  title: SnackBase
  description: Open-source Backend-as-a-Service (BaaS)
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/accounts:
    post:
      tags:
        - accounts
      summary: Create Account
      description: |-
        Create a new account.

        Creates a new account with auto-generated ID and optional slug.
        Only superadmins can access this endpoint.
      operationId: create_account_api_v1_accounts_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountDetailResponse'
        '403':
          description: Superadmin access required
        '422':
          description: Validation error
components:
  schemas:
    CreateAccountRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
          description: Account name
        slug:
          anyOf:
            - type: string
              maxLength: 32
              minLength: 3
              pattern: ^[a-z0-9-]+$
            - type: 'null'
          title: Slug
          description: URL-friendly identifier (auto-generated if not provided)
      type: object
      required:
        - name
      title: CreateAccountRequest
      description: Request body for creating a new account.
    AccountDetailResponse:
      properties:
        id:
          type: string
          title: Id
          description: Account ID (UUID)
        account_code:
          type: string
          title: Account Code
          description: Human-readable account code in XX#### format (e.g., AB1234)
        slug:
          type: string
          title: Slug
          description: URL-friendly account identifier
        name:
          type: string
          title: Name
          description: Display name for the account
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the account was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the account was last updated
        user_count:
          type: integer
          title: User Count
          description: Number of users in this account
        collections_used:
          items:
            type: string
          type: array
          title: Collections Used
          description: Collections used by this account
      type: object
      required:
        - id
        - account_code
        - slug
        - name
        - created_at
        - updated_at
        - user_count
      title: AccountDetailResponse
      description: Detailed account information.

````