Skip to content

## Feature Request: Bulk Account Import (Web UI + API) #46

Description

@alay-arch

Add support for bulk account creation/import in qwen-gate through both the web panel and API, with support for API key authentication defined in configuration.


Goal

Allow administrators to add multiple accounts in a single operation via:

  • Web admin panel
  • API endpoint
  • API key authentication (if configured)

Web UI Support

Add a bulk input section in the admin panel.

Supported format:

email|password
email|password

Optional JSON format:

[
  {"email": "user1@mail.com", "password": "pass1"},
  {"email": "user2@mail.com", "password": "pass2"}
]

UI requirements:

  • Bulk text input field
  • Input validation before submission
  • Preview before applying changes
  • Per-line result reporting
  • Clear error messages (invalid format, duplicates, etc.)

API Support

Add a bulk import endpoint:

POST /api/admin/accounts/import

Authentication:

The endpoint must support:

  • Bearer JWT token authentication (admin session)
  • API key authentication from config (server-side key)

Example:

Authorization: Bearer <token>

or:

X-API-Key: <configured_api_key>

Request Body Examples

Pipe format:

{
  "format": "pipe",
  "data": "email|password\nemail|password"
}

JSON format (preferred):

{
  "accounts": [
    {"email": "user1@mail.com", "password": "pass1"},
    {"email": "user2@mail.com", "password": "pass2"}
  ]
}

Required Behavior

  • Validate email and required fields
  • Detect duplicates (database + batch)
  • Batch processing (non-blocking)
  • Per-record response (success/failure + reason)
  • Optional dry-run mode
  • Maximum batch size limit

Security Considerations

  • Require authentication (JWT or API key from config)
  • API key must be configurable in server config
  • Rate limiting for bulk imports
  • Full audit logging of all bulk operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions