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

# Log in

> Authenticates a user and sets an HTTP-only session cookie. Only available when user auth is enabled on the server. For a user whose password has not been set yet (`mustSetPassword`), any password is accepted and the client must immediately call `/auth/change-password`.



## OpenAPI

````yaml /openapi.yaml post /api/v1/auth/login
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.11.3
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/auth/login:
    post:
      tags:
        - Auth
      summary: Log in
      description: >-
        Authenticates a user and sets an HTTP-only session cookie. Only
        available when user auth is enabled on the server. For a user whose
        password has not been set yet (`mustSetPassword`), any password is
        accepted and the client must immediately call `/auth/change-password`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - username
                - password
              properties:
                username:
                  type: string
                password:
                  type: string
      responses:
        '200':
          description: Authenticated; session cookie set
          content:
            application/json:
              schema:
                type: object
                properties:
                  username:
                    type: string
                  role:
                    type: string
                  mustSetPassword:
                    type: boolean
        '400':
          description: Username is required
        '401':
          description: Invalid username or password
        '404':
          description: User auth is not enabled on this server
        '500':
          description: Error
      security: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````