> ## Documentation Index
> Fetch the complete documentation index at: https://actianvectorai-docs-feedback-implementation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin login

> Authenticates the admin user and returns a JWT token. The username is always fixed to `admin`. No authorization header is required for this endpoint.

When the server starts, it uses `ACTIAN_VECTORAI_JWT_SECRET` if present and persists that value to `server_params.btr`. If the environment variable is absent, the server loads the previously persisted secret or generates and persists a new one automatically.




## OpenAPI

````yaml post /auth/admin/login
openapi: 3.0.3
info:
  title: Actian VectorAI DB - Authentication API
  description: Access token and admin user management for VectorAI DB.
  version: 1.0.0
  contact:
    name: Actian Corporation
    url: https://www.actian.com
servers:
  - url: http://localhost:6573
    description: Local development server (REST API)
  - url: https://api.vectorai.actian.com
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Access Tokens
    description: Create, list, rotate, and delete access tokens.
  - name: Admin User
    description: Create and manage the admin user, login, and authentication settings.
paths:
  /auth/admin/login:
    post:
      tags:
        - Admin User
      summary: Admin login
      description: >
        Authenticates the admin user and returns a JWT token. The username is
        always fixed to `admin`. No authorization header is required for this
        endpoint.


        When the server starts, it uses `ACTIAN_VECTORAI_JWT_SECRET` if present
        and persists that value to `server_params.btr`. If the environment
        variable is absent, the server loads the previously persisted secret or
        generates and persists a new one automatically.
      operationId: admin_login
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - password
              properties:
                password:
                  type: string
                  description: The admin user's password.
      responses:
        '200':
          description: Login successful. Returns a JWT token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: JWT token for authenticating subsequent requests.
                  message:
                    type: string
                    description: Human-readable status message.
                  expires_in:
                    type: integer
                    description: Number of seconds until the JWT token expires.
              examples:
                success:
                  value:
                    token: <jwt-token>
                    message: Login successful
                    expires_in: 3600
        '400':
          description: Missing or blank password.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_password:
                  value:
                    status: error
                    message: 'Missing required field: password'
        '401':
          description: Invalid password.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    nullable: true
                  message:
                    type: string
                  expires_in:
                    type: integer
              examples:
                invalid_password:
                  value:
                    token: null
                    message: Invalid username or password
                    expires_in: 0
      security: []
      x-codeSamples:
        - lang: cURL
          label: Admin login
          source: |
            curl -X POST http://localhost:6575/auth/admin/login \
              -H "Content-Type: application/json" \
              -H 'Authorization: Bearer <admin-jwt-or-access-token>' \
              -d '{
                "password": "MyNewSecurePwd!2"
              }'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          description: Error status indicator.
        message:
          type: string
          description: Human-readable error description.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Admin JWT obtained from the login endpoint.

````